Skip to content

Commit 8a8d36d

Browse files
authored
Run tests in PHP 8.1 (#3)
* Run tests in PHP 8.1 * Apply fixes from StyleCI Co-authored-by: Daniel Mason <dmason30@users.noreply.github.com>
1 parent 7998513 commit 8a8d36d

File tree

4 files changed

+35
-41
lines changed

4 files changed

+35
-41
lines changed

.github/workflows/psalm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.0'
20-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
19+
php-version: '8.1'
20+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
2121
coverage: none
2222

2323
- name: Cache composer dependencies

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest, windows-latest]
12-
php: [8.0, 7.4, 7.3]
12+
php: ['8.1', '8.0', '7.4', '7.3']
1313
laravel: [8.*]
1414
dependency-version: [prefer-lowest, prefer-stable]
1515

@@ -29,7 +29,7 @@ jobs:
2929
uses: shivammathur/setup-php@v2
3030
with:
3131
php-version: ${{ matrix.php }}
32-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
32+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
3333
coverage: pcov
3434

3535
- name: Install dependencies

src/HasMorphToOne.php

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ trait HasMorphToOne
1111
/**
1212
* Define a one-to-one via pivot relationship.
1313
*
14-
* @param string $related
15-
* @param string $name
16-
* @param string $table
17-
* @param string $foreignPivotKey
18-
* @param string $relatedPivotKey
19-
* @param string $parentKey
20-
* @param string $relatedKey
21-
* @param bool $inverse
22-
*
14+
* @param string $related
15+
* @param string $name
16+
* @param string $table
17+
* @param string $foreignPivotKey
18+
* @param string $relatedPivotKey
19+
* @param string $parentKey
20+
* @param string $relatedKey
21+
* @param bool $inverse
2322
* @return MorphToOne
2423
*/
2524
public function morphToOne($related, $name, $table = null, $foreignPivotKey = null,
@@ -52,17 +51,16 @@ public function morphToOne($related, $name, $table = null, $foreignPivotKey = nu
5251
/**
5352
* Instantiate a new MorphToOne relationship.
5453
*
55-
* @param Builder $query
56-
* @param Model $parent
57-
* @param string $name
58-
* @param string $table
59-
* @param string $foreignPivotKey
60-
* @param string $relatedPivotKey
61-
* @param string $parentKey
62-
* @param string $relatedKey
63-
* @param string $relationName
64-
* @param bool $inverse
65-
*
54+
* @param Builder $query
55+
* @param Model $parent
56+
* @param string $name
57+
* @param string $table
58+
* @param string $foreignPivotKey
59+
* @param string $relatedPivotKey
60+
* @param string $parentKey
61+
* @param string $relatedKey
62+
* @param string $relationName
63+
* @param bool $inverse
6664
* @return MorphToOne
6765
*/
6866
protected function newMorphToOne(Builder $query, Model $parent, $name, $table, $foreignPivotKey,
@@ -76,14 +74,13 @@ protected function newMorphToOne(Builder $query, Model $parent, $name, $table, $
7674
/**
7775
* Define a polymorphic, inverse many-to-many relationship but one.
7876
*
79-
* @param string $related
80-
* @param string $name
81-
* @param string $table
82-
* @param string $foreignPivotKey
83-
* @param string $relatedPivotKey
84-
* @param string $parentKey
85-
* @param string $relatedKey
86-
*
77+
* @param string $related
78+
* @param string $name
79+
* @param string $table
80+
* @param string $foreignPivotKey
81+
* @param string $relatedPivotKey
82+
* @param string $parentKey
83+
* @param string $relatedKey
8784
* @return MorphToOne
8885
*/
8986
public function morphedByOne($related, $name, $table = null, $foreignPivotKey = null,

src/MorphToOne.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ public function getResults()
2424
/**
2525
* Initialize the relation on a set of models.
2626
*
27-
* @param array $models
28-
* @param string $relation
29-
*
27+
* @param array $models
28+
* @param string $relation
3029
* @return array
3130
*/
3231
public function initRelation(array $models, $relation)
@@ -41,10 +40,9 @@ public function initRelation(array $models, $relation)
4140
/**
4241
* Match the eagerly loaded results to their parents.
4342
*
44-
* @param array $models
45-
* @param Collection $results
46-
* @param string $relation
47-
*
43+
* @param array $models
44+
* @param Collection $results
45+
* @param string $relation
4846
* @return array
4947
*/
5048
public function match(array $models, Collection $results, $relation)
@@ -69,8 +67,7 @@ public function match(array $models, Collection $results, $relation)
6967
/**
7068
* Make a new related instance for the given model.
7169
*
72-
* @param Model $parent
73-
*
70+
* @param Model $parent
7471
* @return Model
7572
*/
7673
public function newRelatedInstanceFor(Model $parent)

0 commit comments

Comments
 (0)