Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot authored and StyleCIBot committed Jul 25, 2018
1 parent 40e1519 commit f24c11a
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/Console/Commands/ExportMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace KgBot\LaravelLocalization\Console\Commands;

use Illuminate\Console\Command;
use KgBot\LaravelLocalization\Facades\ExportLocalizations;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;
use KgBot\LaravelLocalization\Facades\ExportLocalizations;

class ExportMessages extends Command
{
Expand Down Expand Up @@ -42,26 +42,23 @@ public function handle()
{
$messages = ExportLocalizations::export()->toArray();

$filepath = config( 'laravel-localization.js.filepath', resource_path( 'assets/js' ) );
$filename = config( 'laravel-localization.js.filename', 'll_messages.js' );
$filepath = config('laravel-localization.js.filepath', resource_path('assets/js'));
$filename = config('laravel-localization.js.filename', 'll_messages.js');

$adapter = new Local( $filepath );
$filesystem = new Filesystem( $adapter );
$adapter = new Local($filepath);
$filesystem = new Filesystem($adapter);

$contents = 'export default ' . json_encode( $messages );

if ( $filesystem->has( $filename ) ) {

$filesystem->delete( $filename );
$filesystem->write( $filename, $contents );
$contents = 'export default '.json_encode($messages);

if ($filesystem->has($filename)) {
$filesystem->delete($filename);
$filesystem->write($filename, $contents);
} else {

$filesystem->write( $filename, $contents );
$filesystem->write($filename, $contents);
}

$this->info( 'Messages exported to JavaScript file, you can find them at ' . $filepath . DIRECTORY_SEPARATOR
. $filename );
$this->info('Messages exported to JavaScript file, you can find them at '.$filepath.DIRECTORY_SEPARATOR
.$filename);

return true;
}
Expand Down

0 comments on commit f24c11a

Please sign in to comment.