示例#1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $group = $this->input->getArgument('group');
     $line = $this->input->getArgument('line');
     $this->manager->removeLine($group, $line);
     $this->info("Translation '{$group}.{$line}' has been removed.");
 }
示例#2
0
 protected function processGroup($group, $lines)
 {
     // Do nothing if there is no line
     if (empty($lines) || is_string($lines)) {
         return;
     }
     array_set($this->missing, $group, array());
     $this->line("Processing {$group} group...");
     $this->progress->start($this->output, count($lines, COUNT_RECURSIVE));
     // Iterate over passed lines
     foreach ($lines as $line => $translation) {
         // Run recursive if translation is an array
         if (is_array($translation)) {
             $this->processGroup($group . '.' . $line, $line);
         } else {
             if ($this->manager->findLineCount($group, $line) == 0) {
                 array_push($this->missing[$group], $line);
             }
             $this->progress->advance();
         }
     }
     $this->line(" ");
     // Add line break to stop lines from joining
     if ($missing = array_get($this->missing, $group)) {
         foreach ($missing as $m) {
             if ($this->input->getOption('silent') or $confirm = $this->confirm("{$group}.{$m} is missing. Remove? [yes/no]")) {
                 $this->manager->removeLine($group, $m);
                 $this->info("Removed {$m} from {$group}");
             }
         }
     }
 }