public function fire()
{
$lemma = $this->argument('lemma');
$folders = $this->manager->getPath($this->folders);
//////////////////////////////////////////////////
// Display where translatations are searched in //
//////////////////////////////////////////////////
if ($this->option('verbose')) {
$this->writeLine("Lemmas will be searched in the following directories:");
foreach ($folders as $path) {
$this->writeLine(' <info>' . $path . '</info>');
}
$this->writeLine('');
}
////////////////////////////////
// Parse all lemmas from code //
////////////////////////////////
$files = $this->manager->findLemma($lemma, $folders, $this->trans_methods, $this->option('regex'), $this->option('short'));
if (is_array($files) && count($files) > 0) {
$this->writeLine('Lemma <info>' . $lemma . '</info> has been found in:');
foreach ($files as $file) {
$this->writeLine(' <info>' . $file . '</info>');
}
return self::SUCCESS;
} else {
return self::ERROR;
}
}