Skip to content

Commit f444e4b

Browse files
authored
Merge (#23)
* Fix typo * Remove extra whitespace * Fix typos (#20) * Pass an empty array instead of null so the JSON will properly encode (#21) * Pass an empty array instead of null so the JSON will properly encode * Force data to be an array even if its explicitly null * Swap PHP security checker * Fix action syntax * Remove deprecated --no-suggest flag * Don't need this; it defaults to finding the lock file there * Feature/bugfixes (#22) * Pass an empty array instead of null so the JSON will properly encode * Force data to be an array even if its explicitly null * Switch our PHP Security Checker * Bump version number * If data is empty, make sure that the body of the request is null and not empty JSON * Fix test * Bump version number
1 parent f020c70 commit f444e4b

File tree

9 files changed

+12
-15
lines changed

9 files changed

+12
-15
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ jobs:
3434
coverage: pcov
3535

3636
- name: Install dependencies
37-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
37+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
3838

3939
- name: PHP Security Checker
40-
uses: StephaneBour/actions-php-security-checker@1.0
40+
uses: symfonycorp/security-checker-action@v2
4141
if: ${{ matrix.stability == 'prefer-stable' }}
42-
with:
43-
composer-lock: './composer.lock'
4442

4543
- name: Execute tests
4644
run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.5
1+
1.2.7

src/Api/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function delete($path): ?array
7474
*/
7575
public function get($path): ?array
7676
{
77-
return $this->request($path, null, 'GET');
77+
return $this->request($path, [], 'GET');
7878
}
7979

8080
/**
@@ -195,7 +195,7 @@ public function request($path, $data = [], $method = 'GET'): ?array
195195
'Authorization' => $this->token,
196196
'Content-Type' => 'application/json',
197197
],
198-
'body' => json_encode($data),
198+
'body' => empty($data) ? null : json_encode($data),
199199
]
200200
)
201201
->getBody()

src/Concerns/HasClickUp.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public function getClickupAttribute()
6868
*/
6969
public function getClickupTokenAttribute()
7070
{
71-
7271
if (!is_null($this->attributes['clickup_token'])) {
7372
return $this->resolveEncrypter()
7473
->decrypt($this->attributes['clickup_token']);

src/Interval.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Interval extends Model
3737
'time' => 'integer',
3838
];
3939

40-
// TODO: Figure out how to setup reflation to task
40+
// TODO: Figure out how to setup relation to task
4141
/**
4242
* @return ChildOf
4343
* @throws InvalidRelationshipException

src/Support/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function __construct(array $attributes = [], Model $parentModel = null)
151151
{
152152
// All dates from API comes as epoch with milliseconds
153153
$this->dateFormat = 'Uv';
154-
// None of this models will use timestamps, but need the date casting
154+
// None of these models will use timestamps, but need the date casting
155155
$this->timestamps = false;
156156

157157
$this->syncOriginal();

tests/Api/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function it_makes_expected_request_to_api($function, $method, $data, $par
259259
'Authorization' => $token,
260260
'Content-Type' => 'application/json',
261261
],
262-
'body' => json_encode($data),
262+
'body' => empty($options) ? null : json_encode($options),
263263
],
264264
]
265265
)

tests/Support/ModelTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function it_raises_exception_to_using_an_non_relation_as_a_relation()
203203
{
204204
$this->expectException(LogicException::class);
205205

206-
$this->model->nonrealation;
206+
$this->model->nonrelation;
207207
}
208208

209209
/**
@@ -213,7 +213,7 @@ public function it_raises_exception_to_using_a_null_as_a_relation()
213213
{
214214
$this->expectException(LogicException::class);
215215

216-
$this->model->nullrealation;
216+
$this->model->nullrelation;
217217
}
218218

219219
/**

tests/Support/Stubs/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public function related(): HasMany
6363
return $this->hasMany(Model::class);
6464
}
6565

66-
public function nonrealation()
66+
public function nonrelation()
6767
{
6868
return new stdClass();
6969
}
7070

71-
public function nullrealation()
71+
public function nullrelation()
7272
{
7373
return null;
7474
}

0 commit comments

Comments
 (0)