Skip to content

Commit e9a13bc

Browse files
committed
fix deprecations
1 parent f13d0e6 commit e9a13bc

File tree

8 files changed

+52
-39
lines changed

8 files changed

+52
-39
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99

1010
jobs:
1111
testsuite:
12-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-version: ['8.1']
16+
php-version: ['8.2', '8.3', '8.4']
1717
db-type: ['sqlite', 'mysql', 'pgsql']
1818
prefer-lowest: ['']
1919
include:
20-
- php-version: '8.1'
20+
- php-version: '8.2'
2121
db-type: 'sqlite'
2222
prefer-lowest: 'prefer-lowest'
2323

@@ -90,20 +90,20 @@ jobs:
9090
run: if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then vendor/bin/validate-prefer-lowest -m; fi
9191

9292
- name: Code Coverage Report
93-
if: success() && matrix.php-version == '8.1' && matrix.db-type == 'sqlite'
93+
if: success() && matrix.php-version == '8.2' && matrix.db-type == 'sqlite'
9494
uses: codecov/codecov-action@v1
9595

9696
validation:
9797
name: Coding Standard & Static Analysis
98-
runs-on: ubuntu-22.04
98+
runs-on: ubuntu-24.04
9999

100100
steps:
101101
- uses: actions/checkout@v2
102102

103103
- name: Setup PHP
104104
uses: shivammathur/setup-php@v2
105105
with:
106-
php-version: '8.1'
106+
php-version: '8.4'
107107
extensions: mbstring, intl
108108
coverage: none
109109

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"license": "MIT",
66
"require": {
77
"php": ">=8.1",
8-
"cakephp/cakephp": "^5.0"
8+
"cakephp/cakephp": "5.3.0-RC2"
99
},
1010
"require-dev": {
11-
"cakedc/cakephp-phpstan": "^3.0",
11+
"cakedc/cakephp-phpstan": "^4.0",
1212
"cakephp/cakephp-codesniffer": "^5.0.0",
13-
"phpunit/phpunit": "^10.1.0"
13+
"phpunit/phpunit": "^10.1.0 || ^11 || ^12"
1414
},
1515
"autoload": {
1616
"psr-4": {
@@ -33,10 +33,10 @@
3333
},
3434
"scripts": {
3535
"test": "phpunit",
36-
"cs-check": "phpcs --colors --parallel=16 -p src/",
37-
"cs-fix": "phpcbf --colors --parallel=16 -p src/",
36+
"cs-check": "phpcs --colors --parallel=16 -p",
37+
"cs-fix": "phpcbf --colors --parallel=16 -p",
3838
"stan": "phpstan analyse",
39-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.7.0 && mv composer.backup composer.json",
39+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^2.1.0 && mv composer.backup composer.json",
4040
"lowest-setup": "composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction && cp composer.json composer.backup && composer require --dev dereuromark/composer-prefer-lowest && mv composer.backup composer.json"
4141
},
4242
"prefer-stable": true

phpcs.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0"?>
2-
<ruleset name="CakePHP DebugKit">
3-
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" />
4-
2+
<ruleset name="CakePHP Vite">
3+
<file>src/</file>
54
<rule ref="CakePHP" />
5+
<arg value="s"/>
6+
67
<rule ref="Generic.Files.LineLength">
78
<properties>
89
<property name="lineLimit" value="150"/>

phpstan.neon

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
parameters:
22
level: 6
3-
checkMissingIterableValueType: false
4-
checkGenericClassInNonGenericObjectType: false
5-
paths:
6-
- src
73
bootstrapFiles:
84
- tests/bootstrap.php
5+
paths:
6+
- src
7+
ignoreErrors:
8+
- identifier: missingType.generics
9+
- identifier: missingType.iterableValue
910

1011
includes:
1112
- vendor/cakedc/cakephp-phpstan/extension.neon

src/Plugin.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,9 @@
33

44
namespace ViteHelper;
55

6-
use Cake\Core\BasePlugin;
7-
use Cake\Core\Configure;
8-
use Cake\Core\PluginApplicationInterface;
9-
106
/**
11-
* Plugin for ViteHelper
7+
* @deprecated 2.5.0 Use ViteHelperPlugin instead
128
*/
13-
class Plugin extends BasePlugin
9+
class Plugin extends ViteHelperPlugin
1410
{
15-
/**
16-
* @inheritDoc
17-
*/
18-
public function bootstrap(PluginApplicationInterface $app): void
19-
{
20-
parent::bootstrap($app);
21-
22-
if (file_exists(ROOT . DS . 'config' . DS . 'app_vite.php')) {
23-
Configure::load('app_vite');
24-
}
25-
}
2611
}

src/Utilities/ViteManifest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static function getRecords(ViteHelperConfig $config): ManifestRecords
4545
"\u0000",
4646
],
4747
'',
48-
$json
48+
$json,
4949
);
5050

5151
$manifest = json_decode($json, false, 512, JSON_THROW_ON_ERROR);

src/View/Helper/ViteScriptsHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function devScript(array $options, ViteHelperConfig $config): void
130130
[
131131
'type' => 'module',
132132
'block' => $options['cssBlock'],
133-
]
133+
],
134134
);
135135

136136
$files = $this->getFilesForDevelopment($options, $config, 'scriptEntries');
@@ -289,7 +289,7 @@ private function getFilesForDevelopment(array $options, ViteHelperConfig $config
289289
if (empty($files)) {
290290
throw new ConfigurationException(
291291
'There are no valid entry points for the dev server. '
292-
. 'Be sure to set the ViteHelper.development.' . $configOption . ' config or pass entries to the helper.'
292+
. 'Be sure to set the ViteHelper.development.' . $configOption . ' config or pass entries to the helper.',
293293
);
294294
}
295295

src/ViteHelperPlugin.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace ViteHelper;
5+
6+
use Cake\Core\BasePlugin;
7+
use Cake\Core\Configure;
8+
use Cake\Core\PluginApplicationInterface;
9+
10+
/**
11+
* Plugin for ViteHelper
12+
*/
13+
class ViteHelperPlugin extends BasePlugin
14+
{
15+
/**
16+
* @inheritDoc
17+
*/
18+
public function bootstrap(PluginApplicationInterface $app): void
19+
{
20+
parent::bootstrap($app);
21+
22+
if (file_exists(ROOT . DS . 'config' . DS . 'app_vite.php')) {
23+
Configure::load('app_vite');
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)