Skip to content

Commit 2a58ea9

Browse files
committed
Added laravel 9 and PHP 8.1 support
1 parent e54a3ff commit 2a58ea9

File tree

7 files changed

+32
-28
lines changed

7 files changed

+32
-28
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
/.idea
33
/coverage
44
.phpunit.result.cache
5-
.php_cs.cache
5+
.php-cs-fixer.cache
66
composer.lock

.php_cs renamed to .php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
return PhpCsFixer\Config::create()
3+
return (new PhpCsFixer\Config())
44
->setRiskyAllowed(false)
55
->setRules([
66
'@PSR2' => true,

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ cache:
44

55
language: php
66

7+
dist: bionic
8+
79
matrix:
810
include:
911
# Laravel 5.8.*
@@ -28,12 +30,17 @@ matrix:
2830
- php: 8.0
2931
env: LARAVEL='7.*' TESTBENCH='5.*' COMPOSER_FLAGS='--prefer-stable'
3032
# Laravel 8.*
31-
- php: 7.3
32-
env: LARAVEL='8.*' TESTBENCH='6.*' COMPOSER_FLAGS='--prefer-stable'
3333
- php: 7.4
3434
env: LARAVEL='8.*' TESTBENCH='6.*' COMPOSER_FLAGS='--prefer-stable'
3535
- php: 8.0
3636
env: LARAVEL='8.*' TESTBENCH='6.*' COMPOSER_FLAGS='--prefer-stable'
37+
- php: 8.1.0
38+
env: LARAVEL='8.*' TESTBENCH='6.*' COMPOSER_FLAGS='--prefer-stable'
39+
# Laravel 9.*
40+
- php: 8.0
41+
env: LARAVEL='9.*' TESTBENCH='7.*' COMPOSER_FLAGS='--prefer-stable'
42+
- php: 8.1.0
43+
env: LARAVEL='9.*' TESTBENCH='7.*' COMPOSER_FLAGS='--prefer-stable'
3744
fast_finish: true
3845

3946
before_install:

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"license": "MIT",
1313
"require": {
1414
"php": "^7.1|^8.0",
15-
"illuminate/support": "^5.8|^6|^7|^8",
16-
"illuminate/database": "^5.8|^6|^7|^8"
15+
"illuminate/support": "^5.8|^6|^7|^8|^9",
16+
"illuminate/database": "^5.8|^6|^7|^8|^9"
1717
},
1818
"require-dev": {
19-
"orchestra/testbench": "^3.8|^4.0|^5.0|^6.0",
19+
"orchestra/testbench": "^3.8|^4.0|^5.0|^6.0|^7.0",
2020
"phpunit/phpunit": "^7.0|^8.0|^9.0",
21-
"friendsofphp/php-cs-fixer": "^2.16",
21+
"friendsofphp/php-cs-fixer": "2.*|^3.6",
2222
"squizlabs/php_codesniffer": "^3.5"
2323
},
2424
"autoload": {

src/Rules/ExistsEloquent.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class ExistsEloquent implements Rule
5959
/**
6060
* Create a new rule instance.
6161
*
62-
* @param string $model Class name of model
63-
* @param string|null $key Relevant key in the model
64-
* @param Closure|null $builderClosure Closure that can extend the eloquent builder
62+
* @param string $model Class name of model
63+
* @param string|null $key Relevant key in the model
64+
* @param Closure|null $builderClosure Closure that can extend the eloquent builder
6565
*/
6666
public function __construct(string $model, ?string $key = null, ?Closure $builderClosure = null)
6767
{
@@ -86,7 +86,6 @@ public function setMessage(string $message, bool $translated): void
8686
* Set a custom validation message.
8787
*
8888
* @param string $message
89-
*
9089
* @return $this
9190
*/
9291
public function withMessage(string $message): self
@@ -100,7 +99,6 @@ public function withMessage(string $message): self
10099
* Set a translated custom validation message.
101100
*
102101
* @param string $translationKey
103-
*
104102
* @return $this
105103
*/
106104
public function withCustomTranslation(string $translationKey): self
@@ -170,15 +168,15 @@ public function message(): string
170168
}
171169

172170
/**
173-
* @param Closure|null $builderClosure
171+
* @param Closure|null $builderClosure
174172
*/
175173
public function setBuilderClosure(?Closure $builderClosure)
176174
{
177175
$this->builderClosure = $builderClosure;
178176
}
179177

180178
/**
181-
* @param Closure $builderClosure
179+
* @param Closure $builderClosure
182180
* @return $this
183181
*/
184182
public function query(Closure $builderClosure): self

src/Rules/UniqueEloquent.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ class UniqueEloquent implements Rule
5858

5959
/**
6060
* UniqueEloquent constructor.
61-
* @param string $model
62-
* @param string|null $key
63-
* @param Closure|null $builderClosure
61+
*
62+
* @param string $model
63+
* @param string|null $key
64+
* @param Closure|null $builderClosure
6465
*/
6566
public function __construct(string $model, ?string $key = null, ?Closure $builderClosure = null)
6667
{
@@ -72,8 +73,8 @@ public function __construct(string $model, ?string $key = null, ?Closure $builde
7273
/**
7374
* Determine if the validation rule passes.
7475
*
75-
* @param string $attribute
76-
* @param mixed $value
76+
* @param string $attribute
77+
* @param mixed $value
7778
* @return bool
7879
*/
7980
public function passes($attribute, $value): bool
@@ -115,7 +116,6 @@ public function setMessage(string $message, bool $translated): void
115116
* Set a custom validation message.
116117
*
117118
* @param string $message
118-
*
119119
* @return $this
120120
*/
121121
public function withMessage(string $message): self
@@ -129,7 +129,6 @@ public function withMessage(string $message): self
129129
* Set a translated custom validation message.
130130
*
131131
* @param string $translationKey
132-
*
133132
* @return $this
134133
*/
135134
public function withCustomTranslation(string $translationKey): self
@@ -172,15 +171,15 @@ public function message(): string
172171
}
173172

174173
/**
175-
* @param Closure|null $builderClosure
174+
* @param Closure|null $builderClosure
176175
*/
177176
public function setBuilderClosure(?Closure $builderClosure): void
178177
{
179178
$this->builderClosure = $builderClosure;
180179
}
181180

182181
/**
183-
* @param Closure $builderClosure
182+
* @param Closure $builderClosure
184183
* @return $this
185184
*/
186185
public function query(Closure $builderClosure): self
@@ -191,8 +190,8 @@ public function query(Closure $builderClosure): self
191190
}
192191

193192
/**
194-
* @param mixed $id
195-
* @param string|null $column
193+
* @param mixed $id
194+
* @param string|null $column
196195
*/
197196
public function setIgnore($id, ?string $column = null): void
198197
{
@@ -202,7 +201,7 @@ public function setIgnore($id, ?string $column = null): void
202201

203202
/**
204203
* @param $id
205-
* @param string|null $column
204+
* @param string|null $column
206205
* @return UniqueEloquent
207206
*/
208207
public function ignore($id, ?string $column = null): self

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function setUp(): void
2020
}
2121

2222
/**
23-
* @param Application $app
23+
* @param Application $app
2424
* @return array
2525
*/
2626
protected function getPackageProviders($app): array

0 commit comments

Comments
 (0)