Пример #1
0
 /** @return CommandInvoker */
 protected function getCommandInvoker()
 {
     if ($this->commandInvoker) {
         return $this->commandInvoker;
     }
     $commandInvoker = new CommandInvoker();
     $commandInvoker->addCommand(new LineInsertAboveCommand($this->getTextSanitizer(), $this->getLocationSanitizer()));
     $commandInvoker->addCommand(new LineInsertBelowCommand($this->getTextSanitizer(), $this->getLocationSanitizer()));
     $commandInvoker->addCommand(new LineReplaceAllCommand($this->getContentFactory(), $this->getTextSanitizer()));
     $commandInvoker->addCommand(new LineReplaceCommand($this->getTextSanitizer(), $this->getLocationSanitizer()));
     $commandInvoker->addCommand(new LineRemoveCommand($this->getTextSanitizer(), $this->getLocationSanitizer()));
     foreach ($this->commands as $command) {
         $commandInvoker->addCommand($command);
     }
     return $commandInvoker;
 }