Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Oct 1, 2019
1 parent 4fd19e9 commit 712b6e2
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
10 changes: 3 additions & 7 deletions src/Commands/ListenerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/Commands/stubs/factory.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use Faker\Generator as Faker;

$factory->define(Model::class, function (Faker $faker) {
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/ModuleGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ModuleGenerator extends Generator
protected $console;

/**
* The pingpong module instance.
* The module instance.
*
* @var \Akaunting\Module\Module
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Migrator
{
/**
* Pingpong Module instance.
* Module instance.
*
* @var \Akaunting\Module\Module
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/ModuleCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trait ModuleCommandTrait
/**
* Get the module instance.
*
* @return string
* @return \Akaunting\Module\Module
*/
public function getModule()
{
Expand Down

0 comments on commit 712b6e2

Please sign in to comment.