Skip to content

Commit

Permalink
PHP 8.3 compatibility (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-m authored Jun 12, 2024
1 parent 8a6b992 commit 9b421c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
- when:
condition:
and:
- equal: [ "8.1", <<parameters.version>> ]
- equal: [ "8.3", <<parameters.version>> ]
- equal: [ "", <<parameters.install-flags>> ]
steps:
- run-phpunit-tests:
Expand All @@ -164,7 +164,7 @@ jobs:
condition:
not:
and:
- equal: [ "8.1", <<parameters.version>> ]
- equal: [ "8.3", <<parameters.version>> ]
- equal: [ "", <<parameters.install-flags>> ]
steps:
- run-phpunit-tests:
Expand All @@ -176,5 +176,5 @@ workflows:
- matrix-conditions:
matrix:
parameters:
version: ["7.4", "8.0", "8.1", "8.2"]
version: ["7.4", "8.0", "8.1", "8.2", "8.3"]
install-flags: ["", "--prefer-lowest"]
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "getdkan/pdlt",
"description": "PHP Date Language Tool",
"type": "library",
"license": "GPL-2.0-or-later",
"type": "library",
"authors": [
{
"name": "Clayton Liddell",
Expand All @@ -13,10 +13,10 @@
"php": ">=7.4"
},
"require-dev": {
"drupal/coder": "^8.3.14",
"phpunit/phpunit": "^9.6",
"rector/rector": "^0.15.17",
"squizlabs/php_codesniffer": "^3.7",
"drupal/coder": "^8.3.14"
"squizlabs/php_codesniffer": "^3.7"
},
"autoload": {
"psr-4": {
Expand All @@ -28,16 +28,16 @@
"PDLT\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"phpcbf": "./vendor/bin/phpcbf",
"phpcs": "./vendor/bin/phpcs",
"rector": "./vendor/bin/rector process",
"rector-dry-run": "./vendor/bin/rector process --dry-run",
"test": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --testsuite all --coverage-html ./coverage"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.4/phpunit.xsd">
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
Expand Down
6 changes: 2 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,22 @@
$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
__FILE__,
]);

$rectorConfig->rules([
CompleteDynamicPropertiesRector::class,
]);

$rectorConfig->sets([
SetList::PHP_74,
// Please no dead code or unneeded variables.
SetList::DEAD_CODE,
// Try to figure out type hints.
SetList::TYPE_DECLARATION,
// Interestingly, LevelSetList::UP_TO_PHP_82 does not preserve PHP 7.4,
// so we have to specify all the PHP versions leading up to it if we
// want to keep 7.4 idioms.
SetList::PHP_74,
SetList::PHP_80,
SetList::PHP_81,
SetList::PHP_82,
]);

$rectorConfig->skip([
Expand Down

0 comments on commit 9b421c9

Please sign in to comment.