diff --git a/src/Commands/stubs/json.stub b/src/Commands/stubs/json.stub index da7355274..43095e7e5 100644 --- a/src/Commands/stubs/json.stub +++ b/src/Commands/stubs/json.stub @@ -7,7 +7,5 @@ "providers": [ "$MODULE_NAMESPACE$\\$STUDLY_NAME$\\$PROVIDER_NAMESPACE$\\$STUDLY_NAME$ServiceProvider" ], - "aliases": {}, - "files": [], - "requires": [] + "files": [] } diff --git a/src/Contracts/RepositoryInterface.php b/src/Contracts/RepositoryInterface.php index d31281846..af225657e 100644 --- a/src/Contracts/RepositoryInterface.php +++ b/src/Contracts/RepositoryInterface.php @@ -87,15 +87,6 @@ public function getByStatus($status); */ public function find(string $name); - /** - * Find all modules that are required by a module. If the module cannot be found, throw an exception. - * - * @param $name - * @return array - * @throws ModuleNotFoundException - */ - public function findRequirements($name): array; - /** * Find a specific module. If there return that, otherwise throw exception. * @@ -128,13 +119,6 @@ public function config(string $key, $default = null); */ public function getPath(): string; - /** - * Find a specific module by its alias. - * @param string $alias - * @return Module|void - */ - public function findByAlias(string $alias); - /** * Boot the modules. */ diff --git a/src/FileRepository.php b/src/FileRepository.php index 3b00cc47f..854984411 100644 --- a/src/FileRepository.php +++ b/src/FileRepository.php @@ -346,36 +346,6 @@ public function find(string $name) return; } - /** - * @inheritDoc - */ - public function findByAlias(string $alias) - { - foreach ($this->all() as $module) { - if ($module->getAlias() === $alias) { - return $module; - } - } - - return; - } - - /** - * @inheritDoc - */ - public function findRequirements($name): array - { - $requirements = []; - - $module = $this->findOrFail($name); - - foreach ($module->getRequires() as $requirementName) { - $requirements[] = $this->findByAlias($requirementName); - } - - return $requirements; - } - /** * Find a specific module, if there return that, otherwise throw exception. * diff --git a/src/Module.php b/src/Module.php index d95af0439..a3148141c 100644 --- a/src/Module.php +++ b/src/Module.php @@ -124,16 +124,6 @@ public function getDescription(): string return $this->get('description'); } - /** - * Get alias. - * - * @return string - */ - public function getAlias(): string - { - return $this->get('alias'); - } - /** * Get priority. * @@ -144,16 +134,6 @@ public function getPriority(): string return $this->get('priority'); } - /** - * Get module requirements. - * - * @return array - */ - public function getRequires(): array - { - return $this->get('requires'); - } - /** * Get path. * diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt index afe890969..92e3b4504 100644 --- a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generates_module_files__1.txt @@ -7,7 +7,5 @@ "providers": [ "Modules\\Blog\\Providers\\BlogServiceProvider" ], - "aliases": {}, - "files": [], - "requires": [] + "files": [] } diff --git a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt index 66f3c7fe2..c59f26953 100644 --- a/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt +++ b/tests/Commands/__snapshots__/ModuleMakeCommandTest__it_generes_module_with_new_provider_location__1.txt @@ -7,7 +7,5 @@ "providers": [ "Modules\\Blog\\Base\\Providers\\BlogServiceProvider" ], - "aliases": {}, - "files": [], - "requires": [] + "files": [] } diff --git a/tests/LaravelFileRepositoryTest.php b/tests/LaravelFileRepositoryTest.php index 125210f76..9c544672f 100644 --- a/tests/LaravelFileRepositoryTest.php +++ b/tests/LaravelFileRepositoryTest.php @@ -88,15 +88,6 @@ public function it_finds_a_module() $this->assertInstanceOf(Module::class, $this->repository->find('recipe')); } - /** @test */ - public function it_finds_a_module_by_alias() - { - $this->repository->addLocation(__DIR__ . '/stubs/valid'); - - $this->assertInstanceOf(Module::class, $this->repository->findByAlias('recipe')); - $this->assertInstanceOf(Module::class, $this->repository->findByAlias('required_module')); - } - /** @test */ public function it_find_or_fail_throws_exception_if_module_not_found() { @@ -233,17 +224,6 @@ public function it_can_delete_a_module() $this->assertFalse(is_dir(base_path('modules/Blog'))); } - /** @test */ - public function it_can_find_all_requirements_of_a_module() - { - $this->repository->addLocation(__DIR__ . '/stubs/valid'); - - $requirements = $this->repository->findRequirements('Recipe'); - - $this->assertCount(1, $requirements); - $this->assertInstanceOf(Module::class, $requirements[0]); - } - /** @test */ public function it_can_register_macros() { diff --git a/tests/LaravelModuleTest.php b/tests/LaravelModuleTest.php index 1776327cf..27577a1a0 100644 --- a/tests/LaravelModuleTest.php +++ b/tests/LaravelModuleTest.php @@ -75,12 +75,6 @@ public function it_gets_module_description() $this->assertEquals('recipe module', $this->module->getDescription()); } - /** @test */ - public function it_gets_module_alias() - { - $this->assertEquals('recipe', $this->module->getAlias()); - } - /** @test */ public function it_gets_module_path() { @@ -99,12 +93,6 @@ public function it_gets_module_path_with_symlink() // symlink deleted in tearDownAfterClass } - /** @test */ - public function it_gets_required_modules() - { - $this->assertEquals(['required_module'], $this->module->getRequires()); - } - /** @test */ public function it_loads_module_translations() { diff --git a/tests/LumenModuleTest.php b/tests/LumenModuleTest.php index cec0aab67..73ab59522 100644 --- a/tests/LumenModuleTest.php +++ b/tests/LumenModuleTest.php @@ -61,24 +61,12 @@ public function it_gets_module_description() $this->assertEquals('recipe module', $this->module->getDescription()); } - /** @test */ - public function it_gets_module_alias() - { - $this->assertEquals('recipe', $this->module->getAlias()); - } - /** @test */ public function it_gets_module_path() { $this->assertEquals(__DIR__ . '/stubs/valid/Recipe', $this->module->getPath()); } - /** @test */ - public function it_gets_required_modules() - { - $this->assertEquals(['required_module'], $this->module->getRequires()); - } - /** @test */ public function it_loads_module_translations() {