Skip to content

Commit 00e2d11

Browse files
Upgrade
1 parent e9d89c0 commit 00e2d11

File tree

8 files changed

+152
-93
lines changed

8 files changed

+152
-93
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php: [8.1, 8.2]
16-
dependency-version: [prefer-lowest, prefer-stable]
17-
os: [ubuntu-latest]
15+
php: [ 8.2, 8.3 ]
16+
dependency-version: [ prefer-lowest, prefer-stable ]
17+
os: [ ubuntu-latest ]
1818

1919
steps:
2020
- name: Check out code

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All Notable changes to `sebastiaanluca/laravel-boolean-dates` will be documented
44

55
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
66

7+
## 8.0.0 (2024-02-25)
8+
9+
### Added
10+
11+
- Added support for PHP 8.3
12+
- Added support for Laravel 11
13+
14+
### Removed
15+
16+
- Dropped support for PHP 8.1
17+
718
## 7.0.1 (2023-02-06)
819

920
## 7.0.0 (2023-02-06)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ composer require sebastiaanluca/laravel-boolean-dates
7272

7373
**Set up your Eloquent model** by:
7474

75-
1. Adding your datetime columns to `$casts`
75+
1. Adding your datetime columns to the `$casts` property or `casts()` method
7676
2. Adding the boolean attributes to `$appends`
7777
3. Creating attribute accessors and mutators for each field
7878

composer.json

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@
2525
}
2626
],
2727
"require": {
28-
"php": "~8.1|~8.2",
29-
"illuminate/database": "^10.0",
30-
"illuminate/support": "^10.0"
28+
"php": "~8.2|~8.3",
29+
"illuminate/database": "^10.0|^11.0",
30+
"illuminate/support": "^10.0|^11.0"
3131
},
3232
"require-dev": {
33-
"friendsofphp/php-cs-fixer": "^3.14",
34-
"phpunit/phpunit": "^9.6"
33+
"friendsofphp/php-cs-fixer": "^3.50",
34+
"laravel/pint": "^1.14",
35+
"phpunit/phpunit": "^11.0.3",
36+
"rector/rector": "^1.0.1",
37+
"roave/security-advisories": "dev-latest"
3538
},
3639
"autoload": {
3740
"psr-4": {
@@ -44,27 +47,42 @@
4447
}
4548
},
4649
"config": {
50+
"optimize-autoloader": true,
51+
"preferred-install": "dist",
4752
"sort-packages": true
4853
},
4954
"minimum-stability": "dev",
5055
"prefer-stable": true,
5156
"scripts": {
52-
"composer:validate": "@composer validate --strict --ansi",
53-
"test": "vendor/bin/phpunit",
54-
"lint": "PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --dry-run --diff --ansi",
55-
"fix": "PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --ansi",
56-
"check": [
57-
"@composer:validate",
58-
"@lint",
59-
"@test"
57+
"post-update-cmd": [
58+
"@fix"
59+
],
60+
61+
"validate:composer": "@composer validate --strict --ansi",
62+
"pint:check": "@php vendor/bin/pint --test --ansi",
63+
"pint": "@php vendor/bin/pint --ansi",
64+
"rector:check": "@php vendor/bin/rector --dry-run --ansi",
65+
"rector": "@php vendor/bin/rector --ansi",
66+
"phpunit": "@php vendor/bin/phpunit --order-by=random",
67+
68+
"test": [
69+
"@validate:composer",
70+
"@pint:check",
71+
"@rector:check",
72+
"@phpunit"
73+
],
74+
"fix": [
75+
"@pint",
76+
"@rector"
6077
],
61-
"check:lowest": [
78+
79+
"test:lowest": [
6280
"composer update --prefer-lowest --prefer-dist --no-interaction --ansi",
63-
"@check"
81+
"@test"
6482
],
65-
"check:stable": [
83+
"test:stable": [
6684
"composer update --prefer-stable --prefer-dist --no-interaction --ansi",
67-
"@check"
85+
"@test"
6886
]
6987
}
7088
}

phpunit.xml.dist

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
bootstrap="vendor/autoload.php"
6-
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false"
12-
verbose="true"
13-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
15-
>
16-
<coverage>
17-
<include>
18-
<directory suffix=".php">src/</directory>
19-
</include>
20-
</coverage>
21-
<testsuites>
22-
<testsuite name="Feature tests">
23-
<directory>tests</directory>
24-
</testsuite>
25-
</testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="Feature tests">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<source>
9+
<include>
10+
<directory suffix=".php">src/</directory>
11+
</include>
12+
</source>
2613
</phpunit>

pint.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"phpdoc_single_line_var_spacing": true,
5+
"phpdoc_align": false,
6+
"class_attributes_separation": {
7+
"elements": {
8+
"method": "one"
9+
}
10+
}
11+
}
12+
}

rector.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector;
6+
use Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector;
7+
use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
8+
use Rector\CodeQuality\Rector\FuncCall\StrvalToTypeCastRector;
9+
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
10+
use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
11+
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
12+
use Rector\Config\RectorConfig;
13+
use Rector\EarlyReturn\Rector\If_\ChangeAndIfToEarlyReturnRector;
14+
use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector;
15+
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
16+
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
17+
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
18+
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
19+
use Rector\PHPUnit\Set\PHPUnitSetList;
20+
21+
return RectorConfig::configure()
22+
->withParallel()
23+
->withPaths([
24+
__DIR__.'/src',
25+
__DIR__.'/tests',
26+
])
27+
->withImportNames(
28+
importDocBlockNames: false,
29+
removeUnusedImports: true,
30+
)
31+
->withPhpSets()
32+
->withPreparedSets(
33+
deadCode: true,
34+
codingStyle: true,
35+
typeDeclarations: true,
36+
privatization: true,
37+
earlyReturn: true,
38+
strictBooleans: true,
39+
)
40+
->withSets([
41+
PHPUnitSetList::PHPUNIT_80,
42+
PHPUnitSetList::PHPUNIT_90,
43+
PHPUnitSetList::PHPUNIT_100,
44+
// PHPUnitSetList::PHPUNIT_110,
45+
])
46+
->withRules([
47+
BoolvalToTypeCastRector::class,
48+
FloatvalToTypeCastRector::class,
49+
IntvalToTypeCastRector::class,
50+
StrvalToTypeCastRector::class,
51+
ReadOnlyClassRector::class,
52+
ReadOnlyPropertyRector::class,
53+
])
54+
->withSkip([
55+
ArraySpreadInsteadOfArrayMergeRector::class,
56+
CatchExceptionNameMatchingTypeRector::class,
57+
ChangeAndIfToEarlyReturnRector::class,
58+
ChangeOrIfContinueToMultiContinueRector::class,
59+
ClosureToArrowFunctionRector::class,
60+
FirstClassCallableRector::class,
61+
NewlineAfterStatementRector::class,
62+
]);

0 commit comments

Comments
 (0)