| @@ 24-65 (lines=42) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | class OverwriteFileCommandBuilder extends CommandBuilder |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * {@inheritdoc} |
|
| 28 | */ |
|
| 29 | public function register($file) |
|
| 30 | { |
|
| 31 | $this->container->setDefinition( |
|
| 32 | $this->definitionName($file), |
|
| 33 | (new Definition( |
|
| 34 | OverwriteFileHandler::class, [ |
|
| 35 | $this->container->getDefinition( |
|
| 36 | 'bengor.file.infrastructure.domain.model.' . $file . '_filesystem' |
|
| 37 | ), |
|
| 38 | $this->container->getDefinition( |
|
| 39 | 'bengor.file.infrastructure.persistence.' . $file . '_repository' |
|
| 40 | ), |
|
| 41 | ] |
|
| 42 | ))->addTag( |
|
| 43 | 'bengor_file_' . $file . '_command_bus_handler', [ |
|
| 44 | 'handles' => OverwriteFileCommand::class, |
|
| 45 | ] |
|
| 46 | ) |
|
| 47 | ); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * {@inheritdoc} |
|
| 52 | */ |
|
| 53 | protected function definitionName($file) |
|
| 54 | { |
|
| 55 | return 'bengor.file.application.command.overwrite_' . $file; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * {@inheritdoc} |
|
| 60 | */ |
|
| 61 | protected function aliasDefinitionName($file) |
|
| 62 | { |
|
| 63 | return 'bengor_file.' . $file . '.overwrite'; |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| @@ 24-65 (lines=42) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | class RemoveFileCommandBuilder extends CommandBuilder |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * {@inheritdoc} |
|
| 28 | */ |
|
| 29 | public function register($file) |
|
| 30 | { |
|
| 31 | $this->container->setDefinition( |
|
| 32 | $this->definitionName($file), |
|
| 33 | (new Definition( |
|
| 34 | RemoveFileHandler::class, [ |
|
| 35 | $this->container->getDefinition( |
|
| 36 | 'bengor.file.infrastructure.domain.model.' . $file . '_filesystem' |
|
| 37 | ), |
|
| 38 | $this->container->getDefinition( |
|
| 39 | 'bengor.file.infrastructure.persistence.' . $file . '_repository' |
|
| 40 | ), |
|
| 41 | ] |
|
| 42 | ))->addTag( |
|
| 43 | 'bengor_file_' . $file . '_command_bus_handler', [ |
|
| 44 | 'handles' => RemoveFileCommand::class, |
|
| 45 | ] |
|
| 46 | ) |
|
| 47 | ); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * {@inheritdoc} |
|
| 52 | */ |
|
| 53 | protected function definitionName($file) |
|
| 54 | { |
|
| 55 | return 'bengor.file.application.command.remove_' . $file; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * {@inheritdoc} |
|
| 60 | */ |
|
| 61 | protected function aliasDefinitionName($file) |
|
| 62 | { |
|
| 63 | return 'bengor_file.' . $file . '.remove'; |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||
| @@ 24-65 (lines=42) @@ | ||
| 21 | * |
|
| 22 | * @author Beñat Espiña <[email protected]> |
|
| 23 | */ |
|
| 24 | class RenameFileCommandBuilder extends CommandBuilder |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * {@inheritdoc} |
|
| 28 | */ |
|
| 29 | public function register($file) |
|
| 30 | { |
|
| 31 | $this->container->setDefinition( |
|
| 32 | $this->definitionName($file), |
|
| 33 | (new Definition( |
|
| 34 | RenameFileHandler::class, [ |
|
| 35 | $this->container->getDefinition( |
|
| 36 | 'bengor.file.infrastructure.domain.model.' . $file . '_filesystem' |
|
| 37 | ), |
|
| 38 | $this->container->getDefinition( |
|
| 39 | 'bengor.file.infrastructure.persistence.' . $file . '_repository' |
|
| 40 | ), |
|
| 41 | ] |
|
| 42 | ))->addTag( |
|
| 43 | 'bengor_file_' . $file . '_command_bus_handler', [ |
|
| 44 | 'handles' => RenameFileCommand::class, |
|
| 45 | ] |
|
| 46 | ) |
|
| 47 | ); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * {@inheritdoc} |
|
| 52 | */ |
|
| 53 | protected function definitionName($file) |
|
| 54 | { |
|
| 55 | return 'bengor.file.application.command.rename_' . $file; |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * {@inheritdoc} |
|
| 60 | */ |
|
| 61 | protected function aliasDefinitionName($file) |
|
| 62 | { |
|
| 63 | return 'bengor_file.' . $file . '.rename'; |
|
| 64 | } |
|
| 65 | } |
|
| 66 | ||