Skip to content

Commit 3eae9a9

Browse files
authored
Merge pull request #173 from lilHermit/php8-support
PHP 8.1 support
2 parents a1a2291 + a8704f0 commit 3eae9a9

18 files changed

Lines changed: 432 additions & 179 deletions

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"source": "https://github.com/cakephp/acl"
2222
},
2323
"require": {
24-
"php": "^7.2",
24+
"php": ">=7.2",
2525
"cakephp/cakephp": "^4.0",
2626
"cakephp/plugin-installer": "^1.2"
2727
},

phpunit.xml.dist

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<ini name="memory_limit" value="-1"/>
1111
<ini name="apc.enable_cli" value="1"/>
1212

13+
<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/>
1314
<!-- SQLite
1415
<env name="db_class" value="Cake\Database\Driver\Sqlite"/>
1516
<env name="db_dsn" value="sqlite:///:memory:"/>
@@ -30,13 +31,9 @@
3031
<directory>./tests/TestCase/</directory>
3132
</testsuite>
3233
</testsuites>
33-
<listeners>
34-
<listener class="\Cake\TestSuite\Fixture\FixtureInjector" file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
35-
<arguments>
36-
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
37-
</arguments>
38-
</listener>
39-
</listeners>
34+
<extensions>
35+
<extension class="\Cake\TestSuite\Fixture\PHPUnitExtension" />
36+
</extensions>
4037

4138
<filter>
4239
<whitelist>

src/Model/Table/AclNodesTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function node($ref = null)
5757

5858
if (empty($ref)) {
5959
return null;
60-
} elseif (is_int($ref) || ctype_digit($ref)) {
60+
} elseif (is_int($ref) || (is_string($ref) && ctype_digit($ref))) {
6161
$ref = [
6262
'id' => $ref,
6363
];

src/Model/Table/PermissionsTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ public function getAclLink($aro, $aco)
230230
if (empty($obj['Aro']) || empty($obj['Aco'])) {
231231
return false;
232232
}
233-
$aro = $obj['Aro']->extract('id')->toArray();
234-
$aco = $obj['Aco']->extract('id')->toArray();
233+
$aro = $obj['Aro']->all()->extract('id')->toArray();
234+
$aco = $obj['Aco']->all()->extract('id')->toArray();
235235
$aro = current($aro);
236236
$aco = current($aco);
237237
$alias = $this->getAlias();

tests/Fixture/AcoActionsFixture.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
class AcoActionsFixture extends TestFixture
2525
{
2626

27-
/**
28-
* fields property
29-
*
30-
* @var array
31-
*/
32-
public $fields = [
33-
'id' => ['type' => 'integer'],
34-
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
35-
'model' => ['type' => 'string', 'default' => ''],
36-
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
37-
'alias' => ['type' => 'string', 'default' => ''],
38-
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
39-
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
40-
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
41-
];
42-
4327
/**
4428
* records property
4529
*

tests/Fixture/AcoTwosFixture.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
class AcoTwosFixture extends TestFixture
2525
{
2626

27-
/**
28-
* fields property
29-
*
30-
* @var array
31-
*/
32-
public $fields = [
33-
'id' => ['type' => 'integer'],
34-
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
35-
'model' => ['type' => 'string', 'null' => true],
36-
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
37-
'alias' => ['type' => 'string', 'default' => ''],
38-
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
39-
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
40-
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
41-
];
42-
4327
/**
4428
* records property
4529
*

tests/Fixture/AcosFixture.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
class AcosFixture extends TestFixture
2525
{
2626

27-
/**
28-
* fields property
29-
*
30-
* @var array
31-
*/
32-
public $fields = [
33-
'id' => ['type' => 'integer'],
34-
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
35-
'model' => ['type' => 'string', 'null' => true],
36-
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
37-
'alias' => ['type' => 'string', 'default' => ''],
38-
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
39-
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
40-
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
41-
];
42-
4327
/**
4428
* records property
4529
*

tests/Fixture/AroTwosFixture.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
class AroTwosFixture extends TestFixture
2525
{
2626

27-
/**
28-
* fields property
29-
*
30-
* @var array
31-
*/
32-
public $fields = [
33-
'id' => ['type' => 'integer'],
34-
'parent_id' => ['type' => 'integer', 'length' => 10, 'null' => true],
35-
'model' => ['type' => 'string', 'null' => true],
36-
'foreign_key' => ['type' => 'integer', 'length' => 10, 'null' => true],
37-
'alias' => ['type' => 'string', 'default' => ''],
38-
'lft' => ['type' => 'integer', 'length' => 10, 'null' => true],
39-
'rght' => ['type' => 'integer', 'length' => 10, 'null' => true],
40-
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
41-
];
42-
4327
/**
4428
* records property
4529
*

tests/Fixture/ArosAcoTwosFixture.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
class ArosAcoTwosFixture extends TestFixture
2525
{
2626

27-
/**
28-
* fields property
29-
*
30-
* @var array
31-
*/
32-
public $fields = [
33-
'id' => ['type' => 'integer'],
34-
'aro_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
35-
'aco_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
36-
'_create' => ['type' => 'string', 'length' => 2, 'default' => 0],
37-
'_read' => ['type' => 'string', 'length' => 2, 'default' => 0],
38-
'_update' => ['type' => 'string', 'length' => 2, 'default' => 0],
39-
'_delete' => ['type' => 'string', 'length' => 2, 'default' => 0],
40-
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
41-
];
42-
4327
/**
4428
* records property
4529
*

tests/Fixture/ArosAcosFixture.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@
2424
class ArosAcosFixture extends TestFixture
2525
{
2626

27-
/**
28-
* fields property
29-
*
30-
* @var array
31-
*/
32-
public $fields = [
33-
'id' => ['type' => 'integer'],
34-
'aro_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
35-
'aco_id' => ['type' => 'integer', 'length' => 10, 'null' => false],
36-
'_create' => ['type' => 'string', 'length' => 2, 'default' => 0],
37-
'_read' => ['type' => 'string', 'length' => 2, 'default' => 0],
38-
'_update' => ['type' => 'string', 'length' => 2, 'default' => 0],
39-
'_delete' => ['type' => 'string', 'length' => 2, 'default' => 0],
40-
'_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
41-
];
42-
4327
/**
4428
* records property
4529
*

0 commit comments

Comments
 (0)