for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Thinktomorrow\Squanto\Services;
use Exception;
use Illuminate\Console\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;
class CacheTranslationsCommand extends Command
{
private $cacher;
private $locales = [];
public function __construct(CachedTranslationFile $cacher)
parent::__construct();
$this->cacher = $cacher;
$this->locales = config('squanto.locales', []);
config('squanto.locales', array())
*
array
$locales
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
/**
* The name and signature of the console command.
* @var string
*/
protected $signature = 'squanto:cache';
* The console command description.
protected $description = 'Clear cache and rebuild it from the database translations';
public function handle()
if (empty($this->locales)) {
throw new Exception('No locales set for the cache rebuild. Make sure you set your locales in the squanto config file');
$this->info('Clear and rebuild squanto cache for locales ['.implode(',', $this->locales).'].');
$this->cacher->delete()->write();
$this->info('Translation cache refreshed.');
$this->output->writeln('');
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..