Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.1']
php-versions: ['8.4']

name: Upload coverage report
steps:
Expand Down
34 changes: 5 additions & 29 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
analyze:
name: PHP 8.1 Test / Analysis / Coverage
name: PHP 8.4 Test / Analysis / Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -14,7 +14,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.4'
extensions: mbstring, intl, xdebug, sqlite3, xml, simplexml
tools: composer:v2
coverage: xdebug
Expand All @@ -24,6 +24,8 @@ jobs:

- name: Install
run: |
composer self-update
rm -rf composer.lock
composer install --prefer-dist --no-interaction --no-progress
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sequence of commands is inefficient: composer install is immediately followed by composer update, making the install step redundant. Since composer.lock is removed, running composer update alone would be sufficient. Consider removing line 29 to avoid unnecessary work.

Suggested change
composer install --prefer-dist --no-interaction --no-progress

Copilot uses AI. Check for mistakes.
composer update

Expand All @@ -37,32 +39,6 @@ jobs:
composer global require php-coveralls/php-coveralls
export CODECOVERAGE=1 && vendor/bin/phpunit --coverage-clover=clover.xml
php-coveralls --coverage_clover=clover.xml -v
test:
name: PHP 8.3 Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl, xdebug, sqlite3

- name: PHP Version
run: php -v

- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer self-update
composer validate
composer install --prefer-dist --no-progress

- name: Test Suite
run: |
composer test

#
# CakePHP version compatability
Expand All @@ -72,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['~5.0']
version: ['~5.0.0', '^5.0']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"require": {
"php": "^8.1",
"cakephp/cakephp": "^5.0",
"kcs/class-finder": "^0.3"
"kcs/class-finder": "^0.6"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^5.0",
"phpmd/phpmd": "^2.10",
"phpstan/phpstan": "^1.8.5",
"cakephp/cakephp-codesniffer": "~5.3.0",
"phpmd/phpmd": "~2.15.0",
"phpstan/phpstan": "~1.12.0",
"phpunit/phpunit": "^10"
},
"autoload": {
Expand Down
1 change: 0 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
<ruleset name="App">
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />
<rule ref="CakePHP"/>
</ruleset>
2 changes: 1 addition & 1 deletion src/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Model
public function __construct(
private TableSchema $schema,
private Table $table,
private EntityInterface $entity
private EntityInterface $entity,
) {
$this->assignProperties();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function create(): ?Model
return new Model(
$this->connection->getSchemaCollection()->describe($this->table->getTable()),
$this->table,
new $entityFqn()
new $entityFqn(),
);
}
}
2 changes: 1 addition & 1 deletion src/Model/ModelPropertyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
private TableSchema $schema,
private Table $table,
private string $columnName,
private EntityInterface $entity
private EntityInterface $entity,
) {
}

Expand Down
42 changes: 0 additions & 42 deletions src/Response/ResponseModifier.php

This file was deleted.

4 changes: 3 additions & 1 deletion src/Utility/NamespaceUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public static function findClasses(?string $namespace = null, array $paths = [])

$finder = (new ComposerFinder())
->inNamespace($namespace)
->in($paths);
->in($paths)
->useAutoloading(false);

$classes = [];
foreach ($finder as $className => $reflector) {
$classes[] = $className;
Expand Down
33 changes: 0 additions & 33 deletions tests/TestCase/Response/ResponseModifierTest.php

This file was deleted.

10 changes: 2 additions & 8 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,21 @@
* Add additional configuration/setup your application needs when running
* unit tests in this file.
*/
require dirname(__DIR__) . '/vendor/autoload.php';

// Path constants to a few helpful things.
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}

define('ROOT', dirname(__DIR__));
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp');
define('CORE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp' . DS);
define('CAKE', CORE_PATH . 'src' . DS);
define('TESTS', ROOT . DS . 'tests');
define('APP', ROOT . DS . 'tests' . DS . 'test_app' . DS);
define('APP_DIR', 'test_app');
define('WEBROOT_DIR', 'webroot');
define('WWW_ROOT', APP . 'webroot' . DS);

require_once CORE_PATH . 'config/bootstrap.php';

$_SERVER['PHP_SELF'] = '/';

define('IS_TEST', true);

Configure::write('App.fullBaseUrl', 'http://localhost');
putenv('DB=sqlite');

Expand All @@ -66,6 +59,7 @@

define('TMP', sys_get_temp_dir() . DS);
define('CACHE', TMP . 'cache' . DS);

Cache::setConfig([
'_cake_core_' => [
'engine' => 'File',
Expand Down