Skip to content

Commit 993331b

Browse files
committed
Upgrade to cakephp codesniffer v4
1 parent 7b47aff commit 993331b

5 files changed

Lines changed: 17 additions & 12 deletions

File tree

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@
99
"homepage": "https://cakephp.org"
1010
}
1111
],
12+
"require": {
13+
"php": "^7.2"
14+
},
1215
"require-dev": {
1316
"composer/composer": "^1.0",
1417
"phpunit/phpunit": "^4.8|^5.7|^6.0",
15-
"cakephp/cakephp-codesniffer": "^3.0"
18+
"cakephp/cakephp-codesniffer": "^4.1"
1619
},
1720
"autoload": {
1821
"psr-4": {

src/Installer/PluginInstaller.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
namespace Cake\Composer\Installer;
35

46
use Composer\Composer;
@@ -22,12 +24,12 @@ class PluginInstaller extends LibraryInstaller
2224
/**
2325
* Check usage upon construction
2426
*
25-
* @param IOInterface $io composer object
26-
* @param Composer $composer composer object
27+
* @param \Composer\IO\IOInterface $io composer object
28+
* @param \Composer\Composer $composer composer object
2729
* @param string $type what are we loading
28-
* @param Filesystem $filesystem composer object
30+
* @param \Composer\Util\Filesystem $filesystem composer object
2931
*/
30-
public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null)
32+
public function __construct(IOInterface $io, Composer $composer, $type = 'library', ?Filesystem $filesystem = null)
3133
{
3234
parent::__construct($io, $composer, $type, $filesystem);
3335
$this->checkUsage($composer);
@@ -39,7 +41,7 @@ public function __construct(IOInterface $io, Composer $composer, $type = 'librar
3941
* If not, warn the user they need to update their application's composer file.
4042
* Do nothing if the main project is not a project (if it's a plugin in development).
4143
*
42-
* @param Composer $composer object
44+
* @param \Composer\Composer $composer object
4345
* @return void
4446
*/
4547
public function checkUsage(Composer $composer)
@@ -76,7 +78,6 @@ public function checkUsage(Composer $composer)
7678
*
7779
* @param string $title Warning title
7880
* @param string $text warning text
79-
*
8081
* @return void
8182
*/
8283
public function warnUser($title, $text)
@@ -109,7 +110,7 @@ public function warnUser($title, $text)
109110
* Recreates CakePHP's plugin path map, based on composer information
110111
* and available app-plugins.
111112
*
112-
* @param Event $event the composer event object
113+
* @param \Composer\Script\Event $event the composer event object
113114
* @return void
114115
*/
115116
public static function postAutoloadDump(Event $event)
@@ -337,7 +338,7 @@ public static function primaryNamespace($package)
337338
*/
338339
public function supports($packageType)
339340
{
340-
return 'cakephp-plugin' === $packageType;
341+
return $packageType === 'cakephp-plugin';
341342
}
342343

343344
/**
@@ -370,7 +371,6 @@ public function install(InstalledRepositoryInterface $repo, PackageInterface $pa
370371
* @param \Composer\Package\PackageInterface $target Updated version.
371372
* @return void
372373
* @deprecated superceeded by the post-autoload-dump hook
373-
*
374374
* @throws \InvalidArgumentException if $initial package is not installed
375375
*/
376376
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)

tests/Installer/PluginInstaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
namespace Cake\Test\Composer\Installer;
45

@@ -9,7 +10,6 @@
910
*/
1011
class PluginInstaller extends PluginInstallerSrc
1112
{
12-
1313
/**
1414
* Overriden to return a test-config file
1515
*

tests/TestCase/Installer/PluginInstallerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
declare(strict_types=1);
3+
24
namespace Cake\Test\TestCase\Composer\Installer;
35

46
use Cake\Test\Composer\Installer\PluginInstaller;
@@ -9,7 +11,6 @@
911

1012
class PluginInstallerTest extends TestCase
1113
{
12-
1314
public $package;
1415

1516
public $installer;

tests/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
$loader = require __DIR__ . '/../vendor/autoload.php';
45
$loader->add('Cake\Test\TestCase\Composer', __DIR__ . 'TestCase');

0 commit comments

Comments
 (0)