From ce0f34339d549330186f5934b28c91d2783f0961 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 1 Sep 2023 16:20:16 +0800 Subject: [PATCH 1/2] wip Signed-off-by: Mior Muhammad Zaki --- src/Processors/GeneratesControllerCode.php | 6 +++--- src/Processors/GeneratesFactoryCode.php | 6 +++--- src/Processors/GeneratesListenerCode.php | 6 +++--- src/Processors/GeneratesPolicyCode.php | 6 +++--- src/Processors/GeneratesRuleCode.php | 6 +++--- src/Processors/GeneratesTestingCode.php | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Processors/GeneratesControllerCode.php b/src/Processors/GeneratesControllerCode.php index ec947478..ea600b32 100644 --- a/src/Processors/GeneratesControllerCode.php +++ b/src/Processors/GeneratesControllerCode.php @@ -14,11 +14,11 @@ class GeneratesControllerCode extends GeneratesCode { /** - * Replace the namespace for the given stub. + * Handle generating code. */ - protected function replaceNamespace(string $stub, string $name): string + protected function generatingCode(string $stub, string $name): string { - $stub = parent::replaceNamespace($stub, $name); + $stub = parent::generatingCode($stub, $name); $controllerNamespace = $this->getNamespace($name); diff --git a/src/Processors/GeneratesFactoryCode.php b/src/Processors/GeneratesFactoryCode.php index c99093d7..efc173d4 100644 --- a/src/Processors/GeneratesFactoryCode.php +++ b/src/Processors/GeneratesFactoryCode.php @@ -13,11 +13,11 @@ class GeneratesFactoryCode extends GeneratesCode { /** - * Replace the namespace for the given stub. + * Handle generating code. */ - protected function replaceNamespace(string $stub, string $name): string + protected function generatingCode(string $stub, string $name): string { - $stub = parent::replaceNamespace($stub, $name); + $stub = parent::generatingCode($stub, $name); $namespaceModel = ! empty($this->options['model']) ? $this->qualifyClass($this->options['model']) diff --git a/src/Processors/GeneratesListenerCode.php b/src/Processors/GeneratesListenerCode.php index 71053ecc..b4c644d2 100644 --- a/src/Processors/GeneratesListenerCode.php +++ b/src/Processors/GeneratesListenerCode.php @@ -13,11 +13,11 @@ class GeneratesListenerCode extends GeneratesCode { /** - * Replace the namespace for the given stub. + * Handle generating code. */ - protected function replaceNamespace(string $stub, string $name): string + protected function generatingCode(string $stub, string $name): string { - $stub = parent::replaceNamespace($stub, $name); + $stub = parent::generatingCode($stub, $name); $event = $this->options['event']; diff --git a/src/Processors/GeneratesPolicyCode.php b/src/Processors/GeneratesPolicyCode.php index f7c34baf..704e0f0c 100644 --- a/src/Processors/GeneratesPolicyCode.php +++ b/src/Processors/GeneratesPolicyCode.php @@ -13,12 +13,12 @@ class GeneratesPolicyCode extends GeneratesCode { /** - * Replace the namespace for the given stub. + * Handle generating code. */ - protected function replaceNamespace(string $stub, string $name): string + protected function generatingCode(string $stub, string $name): string { $stub = $this->replaceUserNamespace( - parent::replaceNamespace($stub, $name) + parent::generatingCode($stub, $name) ); $model = $this->options['model']; diff --git a/src/Processors/GeneratesRuleCode.php b/src/Processors/GeneratesRuleCode.php index a712cb1e..a99c40e1 100644 --- a/src/Processors/GeneratesRuleCode.php +++ b/src/Processors/GeneratesRuleCode.php @@ -12,11 +12,11 @@ class GeneratesRuleCode extends GeneratesCode { /** - * Replace the namespace for the given stub. + * Handle generating code. */ - protected function replaceNamespace(string $stub, string $name): string + protected function generatingCode(string $stub, string $name): string { - $stub = parent::replaceNamespace($stub, $name); + $stub = parent::generatingCode($stub, $name); return str_replace( '{{ ruleType }}', $this->options['implicit'] ? 'ImplicitRule' : 'Rule', $stub diff --git a/src/Processors/GeneratesTestingCode.php b/src/Processors/GeneratesTestingCode.php index d923661e..5d1013b8 100644 --- a/src/Processors/GeneratesTestingCode.php +++ b/src/Processors/GeneratesTestingCode.php @@ -14,11 +14,11 @@ class GeneratesTestingCode extends GeneratesCode { /** - * Replace the namespace for the given stub. + * Handle generating code. */ - protected function replaceNamespace(string $stub, string $name): string + protected function generatingCode(string $stub, string $name): string { - $stub = parent::replaceNamespace($stub, $name); + $stub = parent::generatingCode($stub, $name); $testCase = $this->options['unit'] ? $this->preset->config('testing.extends.unit', 'PHPUnit\Framework\TestCase') From 3c697e6ee5c1e52df83bccd6594912e39a7e1f2d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 1 Sep 2023 16:20:40 +0800 Subject: [PATCH 2/2] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1007c827..73754d52 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "php": "^7.3 || ^8.0", "illuminate/database": "^8.83.27", "illuminate/support": "^8.83.27", - "orchestra/canvas-core": "^6.6", + "orchestra/canvas-core": "^6.7", "symfony/yaml": "^5.0" }, "require-dev": {