Skip to content

Commit 4973312

Browse files
authored
Merge pull request #51 from cakephp/php-56-support
Remove strict typing for PHP 5.6 compatibility
2 parents 549548a + 672dacb commit 4973312

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.2.0",
13+
"php": ">=5.6.0",
1414
"composer-plugin-api": "^1.0 || ^2.0"
1515
},
1616
"require-dev": {
17-
"cakephp/cakephp-codesniffer": "^4.1",
18-
"composer/composer": "^2.0@RC",
17+
"cakephp/cakephp-codesniffer": "^3.3",
18+
"composer/composer": "^2.0",
1919
"phpunit/phpunit": "^8.5 || ^9.3"
2020
},
2121
"autoload": {

src/Plugin.php

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

64
use Composer\Composer;
@@ -88,8 +86,8 @@ public function postAutoloadDump(Event $event)
8886
public function findPlugins(
8987
array $packages,
9088
array $pluginDirs = ['plugins'],
91-
string $vendorDir = 'vendor'
92-
): array {
89+
$vendorDir = 'vendor'
90+
) {
9391
$plugins = [];
9492

9593
foreach ($packages as $package) {
@@ -133,7 +131,7 @@ public function findPlugins(
133131
* @param string $vendorDir The path to the vendor dir.
134132
* @return string
135133
*/
136-
public function getFullPath(string $path, string $vendorDir): string
134+
public function getFullPath($path, $vendorDir)
137135
{
138136
if (preg_match('{^(?:/|[a-z]:|[a-z0-9.]+://)}i', $path)) {
139137
return rtrim($path, '/');
@@ -154,7 +152,7 @@ public function getFullPath(string $path, string $vendorDir): string
154152
* @param string|null $root The root directory. Defaults to a value generated from `$configFile`.
155153
* @return void
156154
*/
157-
public function writeConfigFile(string $configFile, array $plugins, ?string $root = null): void
155+
public function writeConfigFile($configFile, array $plugins, $root = null)
158156
{
159157
$root = $root ?: dirname(dirname($configFile));
160158

@@ -214,7 +212,7 @@ public function writeConfigFile(string $configFile, array $plugins, ?string $roo
214212
* @param string $vendorDir Path to composer-vendor dir.
215213
* @return string Absolute file path.
216214
*/
217-
public function getConfigFilePath(string $vendorDir): string
215+
public function getConfigFilePath($vendorDir)
218216
{
219217
return $vendorDir . DIRECTORY_SEPARATOR . 'cakephp-plugins.php';
220218
}
@@ -226,7 +224,7 @@ public function getConfigFilePath(string $vendorDir): string
226224
* @return string The package's primary namespace.
227225
* @throws \RuntimeException When the package's primary namespace cannot be determined.
228226
*/
229-
public function getPrimaryNamespace(PackageInterface $package): string
227+
public function getPrimaryNamespace(PackageInterface $package)
230228
{
231229
$primaryNs = null;
232230
$autoLoad = $package->getAutoload();

0 commit comments

Comments
 (0)