Skip to content

Commit b0859d4

Browse files
authored
Merge pull request #31 from maartenpaauw/feat/dependency-upgrades
Laravel 12 support
2 parents 9e70250 + 8f6e274 commit b0859d4

File tree

11 files changed

+48
-46
lines changed

11 files changed

+48
-46
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ body:
2828
attributes:
2929
label: Package Version
3030
description: What version of our Package are you running? Please be as specific as possible
31-
placeholder: 2.0.0
31+
placeholder: 3.0.0
3232
validations:
3333
required: true
3434
- type: input
3535
id: php-version
3636
attributes:
3737
label: PHP Version
3838
description: What version of PHP are you running? Please be as specific as possible
39-
placeholder: 8.3.0
39+
placeholder: 8.4.0
4040
validations:
4141
required: true
4242
- type: input
4343
id: laravel-version
4444
attributes:
4545
label: Laravel Version
4646
description: What version of Laravel are you running? Please be as specific as possible
47-
placeholder: 10.0.0
47+
placeholder: 12.0.0
4848
validations:
4949
required: true
5050
- type: dropdown

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ contact_links:
1111
about: Learn how to notify us for sensitive bugs
1212
- name: Report a bug
1313
url: https://github.com/maartenpaauw/laravel-specification-pattern/issues/new
14-
about: Report a reproducable bug
14+
about: Report a reproducible bug

.github/workflows/code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: 8.1
21+
php-version: 8.2
2222
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
2323
coverage: xdebug
2424

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: '8.1'
21+
php-version: '8.2'
2222
coverage: none
2323

2424
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
php: [8.3, 8.2, 8.1]
17-
laravel: [11.*, 10.*]
16+
php: [8.4, 8.3, 8.2]
17+
laravel: [12.*, 11.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20+
- laravel: 12.*
21+
testbench: 10.*
2022
- laravel: 11.*
2123
testbench: 9.*
22-
- laravel: 10.*
23-
testbench: ^8.14
24-
exclude:
25-
- laravel: 11.*
26-
php: 8.1
2724

2825
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
2926

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to `laravel-specification-pattern` will be documented in this file.
44

5+
## [v3.0.0] - 2025-02-26
6+
7+
### Added
8+
9+
- Support for Laravel 12.
10+
11+
### Removed
12+
13+
- Deprecated `meets` method.
14+
- Support for Laravel 10.
15+
- Support for PHP 8.1.
16+
517
## [v2.8.0] - 2024-11-21
618

719
### Added
@@ -88,6 +100,7 @@ All notable changes to `laravel-specification-pattern` will be documented in thi
88100

89101
- initial release
90102

103+
[v3.0.0]: https://github.com/maartenpaauw/laravel-specification-pattern/compare/v2.8.0...v3.0.0
91104
[v2.8.0]: https://github.com/maartenpaauw/laravel-specification-pattern/compare/v2.7.0...v2.8.0
92105
[v2.7.0]: https://github.com/maartenpaauw/laravel-specification-pattern/compare/v2.6.0...v2.7.0
93106
[v2.6.0]: https://github.com/maartenpaauw/laravel-specification-pattern/compare/v2.5.0...v2.6.0

composer.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.1",
20-
"illuminate/console": "^10.0|^11.0",
21-
"illuminate/support": "^10.0|^11.0",
19+
"php": "^8.2",
20+
"illuminate/console": "^11.0|^12.0",
21+
"illuminate/support": "^11.0|^12.0",
2222
"spatie/laravel-package-tools": "^1.16.2",
2323
"symfony/polyfill-php83": "^1.30",
2424
"webmozart/assert": "^1.11"
2525
},
2626
"require-dev": {
27-
"illuminate/testing": "^10.0|^11.0",
28-
"larastan/larastan": "^2.8",
27+
"illuminate/testing": "^11.0|^12.0",
28+
"larastan/larastan": "^2.9|^3.0",
2929
"laravel/pint": "^1.0",
30-
"nunomaduro/collision": "^7.8|^8.1",
31-
"orchestra/testbench": "^8.8|^9.0",
32-
"pestphp/pest": "^2.20",
33-
"pestphp/pest-plugin-arch": "^2.5",
34-
"pestphp/pest-plugin-laravel": "^2.2",
35-
"pestphp/pest-plugin-type-coverage": "^2.8",
36-
"phpstan/extension-installer": "^1.1",
37-
"phpstan/phpstan-deprecation-rules": "^1.0",
38-
"phpstan/phpstan-phpunit": "^1.0",
30+
"nunomaduro/collision": "^v7.11|^8.1",
31+
"orchestra/testbench": "^v9.11|^10.0",
32+
"pestphp/pest": "^3.0",
33+
"pestphp/pest-plugin-arch": "^v3.0",
34+
"pestphp/pest-plugin-laravel": "^v2.4|^v3.0",
35+
"pestphp/pest-plugin-type-coverage": "^3.0",
36+
"phpstan/extension-installer": "^1.4",
37+
"phpstan/phpstan-deprecation-rules": "^2.0",
38+
"phpstan/phpstan-phpunit": "^2.0",
3939
"spatie/laravel-ray": "^1.35",
4040
"spatie/phpunit-snapshot-assertions": "^5.1"
4141
},

phpstan.neon.dist

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ parameters:
88
- src
99
- tests
1010
tmpDir: build/phpstan
11-
checkOctaneCompatibility: true
1211
checkModelProperties: true
13-
checkMissingIterableValueType: false
14-
12+
checkOctaneCompatibility: true
13+
treatPhpDocTypesAsCertain: false
14+
ignoreErrors:
15+
-
16+
identifier: trait.unused
17+
path: src/HasSpecifications.php

src/Commands/MakeSpecificationCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
)]
1616
final class MakeSpecificationCommand extends GeneratorCommand
1717
{
18-
/**
19-
* @var string
20-
*/
2118
protected $type = 'Specification';
2219

2320
#[Override]
@@ -40,7 +37,7 @@ protected function getStub(): string
4037
#[Override]
4138
protected function getDefaultNamespace(mixed $rootNamespace): string
4239
{
43-
return sprintf('%s\Specifications', $rootNamespace);
40+
return \sprintf('%s\Specifications', $rootNamespace);
4441
}
4542

4643
/**
@@ -49,6 +46,7 @@ protected function getDefaultNamespace(mixed $rootNamespace): string
4946
#[Override]
5047
protected function buildClass(mixed $name): string
5148
{
49+
/** @var array<string, string> $replacements */
5250
$replacements = [
5351
'{{ candidate }}' => $this->option('candidate'),
5452
];

src/HasSpecifications.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,18 @@
77
trait HasSpecifications
88
{
99
/**
10-
* @param Specification<self> $specification
10+
* @param Specification<self> $specification
1111
*/
1212
public function satisfies(Specification $specification): bool
1313
{
1414
return $specification->isSatisfiedBy($this);
1515
}
1616

1717
/**
18-
* @param Specification<self> $specification
18+
* @param Specification<self> $specification
1919
*/
2020
public function dissatisfies(Specification $specification): bool
2121
{
2222
return (new NotSpecification($specification))->isSatisfiedBy($this);
2323
}
24-
25-
/**
26-
* @deprecated use `satisfies()` instead
27-
*
28-
* @param Specification<self> $specification
29-
*/
30-
public function meets(Specification $specification): bool
31-
{
32-
return $this->satisfies($specification);
33-
}
3424
}

tests/CollectionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function test_it_should_filter_the_collection_based_on_the_given_specific
2727
$result = $collection->matching(new UppercaseSpecification());
2828

2929
// Assert
30+
$this->assertInstanceOf(Collection::class, $result);
3031
$this->assertCount(1, $result);
3132
}
3233
}

0 commit comments

Comments
 (0)