Skip to content

Commit 7df69cd

Browse files
authored
Upgrade kcs/class-finder and more!
- Updates alekitto/class-finder from ^0.3 to ^0.6 and resolves breaking changes in that library a long the way. This resolves PHP 8.4 deprecations being emitted by a class-finder dependency: thecodingmachine/safe. - Handle some breaking changes in linters and lock linter versions - Improve upper and lower bound version check in CI pipeline. - Remove `RequestModifier` which is no longer needed since the `RequestHandlerComponent` was removed by CakePHP in version 5.
2 parents 4ddf2a5 + 3c3a59e commit 7df69cd

11 files changed

Lines changed: 18 additions & 122 deletions

File tree

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
php-versions: ['8.1']
12+
php-versions: ['8.4']
1313

1414
name: Upload coverage report
1515
steps:

.github/workflows/pull-request.yml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
analyze:
8-
name: PHP 8.1 Test / Analysis / Coverage
8+
name: PHP 8.4 Test / Analysis / Coverage
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup PHP
1515
uses: shivammathur/setup-php@v2
1616
with:
17-
php-version: '8.1'
17+
php-version: '8.4'
1818
extensions: mbstring, intl, xdebug, sqlite3, xml, simplexml
1919
tools: composer:v2
2020
coverage: xdebug
@@ -24,6 +24,8 @@ jobs:
2424

2525
- name: Install
2626
run: |
27+
composer self-update
28+
rm -rf composer.lock
2729
composer install --prefer-dist --no-interaction --no-progress
2830
composer update
2931
@@ -37,32 +39,6 @@ jobs:
3739
composer global require php-coveralls/php-coveralls
3840
export CODECOVERAGE=1 && vendor/bin/phpunit --coverage-clover=clover.xml
3941
php-coveralls --coverage_clover=clover.xml -v
40-
test:
41-
name: PHP 8.3 Test
42-
runs-on: ubuntu-latest
43-
steps:
44-
- name: Checkout
45-
uses: actions/checkout@v2
46-
47-
- name: Setup PHP
48-
uses: shivammathur/setup-php@v2
49-
with:
50-
php-version: '8.3'
51-
extensions: mbstring, intl, xdebug, sqlite3
52-
53-
- name: PHP Version
54-
run: php -v
55-
56-
- name: Install dependencies
57-
if: steps.composer-cache.outputs.cache-hit != 'true'
58-
run: |
59-
composer self-update
60-
composer validate
61-
composer install --prefer-dist --no-progress
62-
63-
- name: Test Suite
64-
run: |
65-
composer test
6642
6743
#
6844
# CakePHP version compatability
@@ -72,7 +48,7 @@ jobs:
7248
runs-on: ubuntu-latest
7349
strategy:
7450
matrix:
75-
version: ['~5.0']
51+
version: ['~5.0.0', '^5.0']
7652
steps:
7753
- name: Checkout
7854
uses: actions/checkout@v2

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"require": {
88
"php": "^8.1",
99
"cakephp/cakephp": "^5.0",
10-
"kcs/class-finder": "^0.3"
10+
"kcs/class-finder": "^0.6"
1111
},
1212
"require-dev": {
13-
"cakephp/cakephp-codesniffer": "^5.0",
14-
"phpmd/phpmd": "^2.10",
15-
"phpstan/phpstan": "^1.8.5",
13+
"cakephp/cakephp-codesniffer": "~5.3.0",
14+
"phpmd/phpmd": "~2.15.0",
15+
"phpstan/phpstan": "~1.12.0",
1616
"phpunit/phpunit": "^10"
1717
},
1818
"autoload": {

phpcs.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0"?>
22
<ruleset name="App">
3-
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />
43
<rule ref="CakePHP"/>
54
</ruleset>

src/Model/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Model
2727
public function __construct(
2828
private TableSchema $schema,
2929
private Table $table,
30-
private EntityInterface $entity
30+
private EntityInterface $entity,
3131
) {
3232
$this->assignProperties();
3333
}

src/Model/ModelFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function create(): ?Model
3131
return new Model(
3232
$this->connection->getSchemaCollection()->describe($this->table->getTable()),
3333
$this->table,
34-
new $entityFqn()
34+
new $entityFqn(),
3535
);
3636
}
3737
}

src/Model/ModelPropertyFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
private TableSchema $schema,
2626
private Table $table,
2727
private string $columnName,
28-
private EntityInterface $entity
28+
private EntityInterface $entity,
2929
) {
3030
}
3131

src/Response/ResponseModifier.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/Utility/NamespaceUtility.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public static function findClasses(?string $namespace = null, array $paths = [])
4242

4343
$finder = (new ComposerFinder())
4444
->inNamespace($namespace)
45-
->in($paths);
45+
->in($paths)
46+
->useAutoloading(false);
47+
4648
$classes = [];
4749
foreach ($finder as $className => $reflector) {
4850
$classes[] = $className;

tests/TestCase/Response/ResponseModifierTest.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)