Skip to content

Commit 29a0ae3

Browse files
authored
Remove Shim plugin dependency (#325)
* Remove shim dep
1 parent 3b86e10 commit 29a0ae3

14 files changed

+60
-29
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"require-dev": {
4141
"cakephp/plugin-installer": "^2.0.1",
4242
"cakephp/migrations": "^4.0.1",
43-
"dereuromark/cakephp-shim": "dev-cake5",
43+
"dereuromark/cakephp-shim": "^3.0.0",
4444
"fig-r/psr2r-sniffer": "dev-next",
4545
"phpunit/phpunit": "^10.1"
4646
},

src/Command/Annotate/CallbacksCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
5959
* @return void
6060
*/
6161
protected function _callbacks(string $folder) {
62-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
62+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
6363

6464
$folderContent = glob($folder . '*') ?: [];
6565
foreach ($folderContent as $path) {
@@ -83,7 +83,7 @@ protected function _callbacks(string $folder) {
8383
continue;
8484
}
8585

86-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
86+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
8787

8888
$annotator = $this->getAnnotator(CallbackAnnotator::class);
8989
$annotator->annotate($path);

src/Command/Annotate/ClassesCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
7878
* @return void
7979
*/
8080
protected function _classes(string $folder) {
81-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
81+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
8282

8383
$folderContent = glob($folder . '*') ?: [];
8484
foreach ($folderContent as $path) {
@@ -108,7 +108,7 @@ protected function _classes(string $folder) {
108108
continue;
109109
}
110110

111-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
111+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
112112

113113
$annotator = $this->getAnnotator(ClassAnnotator::class);
114114
$annotator->annotate($path);

src/Command/Annotate/CommandsCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
4444
* @return void
4545
*/
4646
protected function _commands(string $folder) {
47-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
47+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
4848

4949
$folderContent = glob($folder . '*') ?: [];
5050
foreach ($folderContent as $file) {
@@ -56,7 +56,7 @@ protected function _commands(string $folder) {
5656
continue;
5757
}
5858

59-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
59+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
6060
$annotator = $this->getAnnotator(CommandAnnotator::class);
6161
$annotator->annotate($file);
6262
}

src/Command/Annotate/ComponentsCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
4444
* @return void
4545
*/
4646
protected function _components(string $folder) {
47-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
47+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
4848

4949
$folderContent = glob($folder . '*') ?: [];
5050
foreach ($folderContent as $path) {
@@ -56,7 +56,7 @@ protected function _components(string $folder) {
5656
continue;
5757
}
5858

59-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
59+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
6060
$annotator = $this->getAnnotator(ComponentAnnotator::class);
6161
$annotator->annotate($path);
6262
}

src/Command/Annotate/ControllersCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
4545
* @return void
4646
*/
4747
protected function _controllers(string $folder) {
48-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
48+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
4949

5050
$folderContent = glob($folder . '*') ?: [];
5151
foreach ($folderContent as $path) {
@@ -69,7 +69,7 @@ protected function _controllers(string $folder) {
6969
continue;
7070
}
7171

72-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
72+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
7373

7474
$annotator = $this->getAnnotator(ControllerAnnotator::class);
7575
$annotator->annotate($path);

src/Command/Annotate/HelpersCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
4444
* @return void
4545
*/
4646
protected function _helpers($folder) {
47-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
47+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
4848

4949
$folderContent = glob($folder . '*') ?: [];
5050
foreach ($folderContent as $path) {
@@ -56,7 +56,7 @@ protected function _helpers($folder) {
5656
continue;
5757
}
5858

59-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
59+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
6060
$annotator = $this->getAnnotator(HelperAnnotator::class);
6161
$annotator->annotate($path);
6262
}

src/Command/Annotate/ModelsCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
4444
* @return void
4545
*/
4646
protected function _models(string $folder) {
47-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
47+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
4848

4949
$folderContent = glob($folder . '*') ?: [];
5050
foreach ($folderContent as $file) {
@@ -56,7 +56,7 @@ protected function _models(string $folder) {
5656
continue;
5757
}
5858

59-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
59+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
6060

6161
$annotator = $this->getAnnotator(ModelAnnotator::class);
6262
$annotator->annotate($file);

src/Command/Annotate/TemplatesCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function execute(Arguments $args, ConsoleIo $io): int {
4444
* @return void
4545
*/
4646
protected function _templates($folder) {
47-
$this->io?->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
47+
$this->io->out(str_replace(ROOT, '', $folder), 1, ConsoleIo::VERBOSE);
4848

4949
$folderContent = glob($folder . '*') ?: [];
5050
foreach ($folderContent as $path) {
@@ -61,8 +61,8 @@ protected function _templates($folder) {
6161
continue;
6262
}
6363

64-
if ($this->args?->getOption('verbose')) {
65-
$this->io?->warning(sprintf('Skipped template folder `%s`', str_replace(ROOT, '', $subFolder)));
64+
if ($this->args->getOption('verbose')) {
65+
$this->io->warning(sprintf('Skipped template folder `%s`', str_replace(ROOT, '', $subFolder)));
6666
}
6767

6868
break;
@@ -84,7 +84,7 @@ protected function _templates($folder) {
8484
continue;
8585
}
8686

87-
$this->io?->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
87+
$this->io->out('-> ' . $name, 1, ConsoleIo::VERBOSE);
8888
$annotator = $this->getAnnotator(TemplateAnnotator::class);
8989
$annotator->annotate($path);
9090
}

src/Command/AnnotateCommand.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace IdeHelper\Command;
44

5+
use Cake\Command\Command;
56
use Cake\Console\Arguments;
67
use Cake\Console\ConsoleIo;
78
use Cake\Console\ConsoleOptionParser;
89
use Cake\Core\Configure;
910
use IdeHelper\Annotator\AbstractAnnotator;
1011
use IdeHelper\Console\Io;
11-
use Shim\Command\Command;
1212

1313
abstract class AnnotateCommand extends Command {
1414

@@ -36,6 +36,16 @@ abstract class AnnotateCommand extends Command {
3636
*/
3737
protected array $_instantiatedAnnotators = [];
3838

39+
/**
40+
* @var \Cake\Console\Arguments
41+
*/
42+
protected Arguments $args;
43+
44+
/**
45+
* @var \Cake\Console\ConsoleIo
46+
*/
47+
protected ConsoleIo $io;
48+
3949
/**
4050
* @return void
4151
*/
@@ -59,6 +69,9 @@ public function initialize(): void {
5969
* @return int|null|void The exit code or null for success
6070
*/
6171
public function execute(Arguments $args, ConsoleIo $io) {
72+
$this->args = $args;
73+
$this->io = $io;
74+
6275
parent::execute($args, $io);
6376

6477
if ($args->getOption('ci')) {

0 commit comments

Comments
 (0)