Skip to content

Commit 87ef9d3

Browse files
Nicks18dereuromark
andauthored
Fix PHP 8.4 property compatibility in ImportCommand and InitCommand (#11)
* Refactor ImportCommand constructor to set modelClass PHP 8.3+ $modelClass class property composition fix. * Refactor InitCommand constructor to set modelClass PHP 8.3+ class property composition fix. * Use modern defaultTable property instead of deprecated modelClass * Fix defaultTable type to match parent --------- Co-authored-by: mscherer <[email protected]>
1 parent a771902 commit 87ef9d3

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/Command/ImportCommand.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Cake\Console\ConsoleIo;
77
use Cake\Console\ConsoleOptionParser;
88
use Cake\Core\Configure;
9-
use Cake\Datasource\ModelAwareTrait;
109
use Shim\Command\Command;
1110
use TinyAuthBackend\Utility\AdapterConfig;
1211
use TinyAuthBackend\Utility\Importer;
@@ -16,12 +15,7 @@
1615
*/
1716
class ImportCommand extends Command {
1817

19-
use ModelAwareTrait;
20-
21-
/**
22-
* @var string|null
23-
*/
24-
protected ?string $modelClass = 'TinyAuthBackend.AllowRules';
18+
protected ?string $defaultTable = 'TinyAuthBackend.AllowRules';
2519

2620
/**
2721
* @inheritDoc

src/Command/InitCommand.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Cake\Console\Arguments;
66
use Cake\Console\ConsoleIo;
77
use Cake\Console\ConsoleOptionParser;
8-
use Cake\Datasource\ModelAwareTrait;
98
use Cake\Routing\Router;
109
use Shim\Command\Command;
1110
use TinyAuth\Utility\TinyAuth;
@@ -16,12 +15,7 @@
1615
*/
1716
class InitCommand extends Command {
1817

19-
use ModelAwareTrait;
20-
21-
/**
22-
* @var string|null
23-
*/
24-
protected ?string $modelClass = 'TinyAuthBackend.AllowRules';
18+
protected ?string $defaultTable = 'TinyAuthBackend.AllowRules';
2519

2620
/**
2721
* @inheritDoc

0 commit comments

Comments
 (0)