From 712b6e291f770d2027d9a582ea4d7914a45967d7 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 1 Oct 2019 16:19:58 +0300 Subject: [PATCH] more updates --- README.md | 1 - composer.json | 4 ++-- src/Commands/ListenerMakeCommand.php | 10 +++------- src/Commands/stubs/factory.stub | 2 ++ src/Generators/ModuleGenerator.php | 2 +- src/Migrations/Migrator.php | 2 +- src/Traits/ModuleCommandTrait.php | 2 +- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 837acf6..d06d3a1 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,6 @@ Pull requests are more than welcome. You must follow the PSR coding standards. ## Credits - [Denis Duliçi](https://github.com/denisdulici) -- [Nicolas Widart](https://github.com/nwidart) - [All Contributors](../../contributors) ## License diff --git a/composer.json b/composer.json index d49de6b..941e37f 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~7.0", + "phpunit/phpunit": "~7.0|~8.0", "mockery/mockery": "~1.0", "orchestra/testbench": "^3.8", - "friendsofphp/php-cs-fixer": "^2.14", + "friendsofphp/php-cs-fixer": "^2.15", "spatie/phpunit-snapshot-assertions": "^2.1.0", "phpstan/phpstan": "^0.9.2" }, diff --git a/src/Commands/ListenerMakeCommand.php b/src/Commands/ListenerMakeCommand.php index dded89d..6942ac3 100644 --- a/src/Commands/ListenerMakeCommand.php +++ b/src/Commands/ListenerMakeCommand.php @@ -62,20 +62,16 @@ protected function getTemplateContents() return (new Stub($this->getStubName(), [ 'ALIAS' => $module->getAlias(), - 'NAMESPACE' => $this->getNamespace($module), + 'NAMESPACE' => $this->getClassNamespace($module), 'EVENTNAME' => $this->getEventName($module), 'SHORTEVENTNAME' => $this->option('event'), 'CLASS' => $this->getClass(), ]))->render(); } - private function getNamespace($module) + public function getDefaultNamespace() { - $listenerPath = GenerateConfigReader::read('listener'); - - $namespace = str_replace('/', '\\', $listenerPath->getPath()); - - return $this->getClassNamespace($module) . "\\" . $namespace; + return $this->laravel['module']->config('paths.generator.listener.path', 'Listeners'); } protected function getEventName(Module $module) diff --git a/src/Commands/stubs/factory.stub b/src/Commands/stubs/factory.stub index 65e4221..af7fe6d 100644 --- a/src/Commands/stubs/factory.stub +++ b/src/Commands/stubs/factory.stub @@ -1,5 +1,7 @@ define(Model::class, function (Faker $faker) { diff --git a/src/Generators/ModuleGenerator.php b/src/Generators/ModuleGenerator.php index 30bf725..403ebca 100644 --- a/src/Generators/ModuleGenerator.php +++ b/src/Generators/ModuleGenerator.php @@ -41,7 +41,7 @@ class ModuleGenerator extends Generator protected $console; /** - * The pingpong module instance. + * The module instance. * * @var \Akaunting\Module\Module */ diff --git a/src/Migrations/Migrator.php b/src/Migrations/Migrator.php index 8e85e70..257c5c2 100644 --- a/src/Migrations/Migrator.php +++ b/src/Migrations/Migrator.php @@ -11,7 +11,7 @@ class Migrator { /** - * Pingpong Module instance. + * Module instance. * * @var \Akaunting\Module\Module */ diff --git a/src/Traits/ModuleCommandTrait.php b/src/Traits/ModuleCommandTrait.php index 8110b9e..422afb4 100644 --- a/src/Traits/ModuleCommandTrait.php +++ b/src/Traits/ModuleCommandTrait.php @@ -7,7 +7,7 @@ trait ModuleCommandTrait /** * Get the module instance. * - * @return string + * @return \Akaunting\Module\Module */ public function getModule() {