@@ -6,26 +6,26 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | class DatabaseConnectionCommand extends Command |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * The name and signature of the console command. |
|
| 11 | - * |
|
| 12 | - * @var string |
|
| 13 | - */ |
|
| 14 | - protected $signature = 'epesi:database-connection {--connection= : DB connection settings}'; |
|
| 9 | + /** |
|
| 10 | + * The name and signature of the console command. |
|
| 11 | + * |
|
| 12 | + * @var string |
|
| 13 | + */ |
|
| 14 | + protected $signature = 'epesi:database-connection {--connection= : DB connection settings}'; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * The console command description. |
|
| 18 | - * |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 21 | - protected $description = 'Update database connection for epesi application'; |
|
| 16 | + /** |
|
| 17 | + * The console command description. |
|
| 18 | + * |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | + protected $description = 'Update database connection for epesi application'; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Execute the console command. |
|
| 25 | - */ |
|
| 26 | - public function handle() |
|
| 27 | - { |
|
| 28 | - $connection = $this->option('connection'); |
|
| 23 | + /** |
|
| 24 | + * Execute the console command. |
|
| 25 | + */ |
|
| 26 | + public function handle() |
|
| 27 | + { |
|
| 28 | + $connection = $this->option('connection'); |
|
| 29 | 29 | |
| 30 | 30 | $map = [ |
| 31 | 31 | 'driver' => 'DB_CONNECTION', |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $this->call('epesi:env', [ |
|
| 52 | - 'name' => $env |
|
| 53 | - ]); |
|
| 51 | + $this->call('epesi:env', [ |
|
| 52 | + 'name' => $env |
|
| 53 | + ]); |
|
| 54 | 54 | |
| 55 | - $this->comment('DB connection settings updated!'); |
|
| 56 | - } |
|
| 55 | + $this->comment('DB connection settings updated!'); |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -38,7 +38,9 @@ |
||
| 38 | 38 | |
| 39 | 39 | $env = []; |
| 40 | 40 | foreach ($map as $key => $name) { |
| 41 | - if (!isset($connection[$key])) continue; |
|
| 41 | + if (!isset($connection[$key])) { |
|
| 42 | + continue; |
|
| 43 | + } |
|
| 42 | 44 | |
| 43 | 45 | $env[$name] = $connection[$key]; |
| 44 | 46 | } |
@@ -7,33 +7,33 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ModuleInstallCommand extends Command |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * The name and signature of the console command. |
|
| 12 | - * |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $signature = 'epesi:module-install {module : The class name or alias of the module.}'; |
|
| 10 | + /** |
|
| 11 | + * The name and signature of the console command. |
|
| 12 | + * |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $signature = 'epesi:module-install {module : The class name or alias of the module.}'; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * The console command description. |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - protected $description = 'Install the epesi module'; |
|
| 17 | + /** |
|
| 18 | + * The console command description. |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + protected $description = 'Install the epesi module'; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Execute the console command. |
|
| 26 | - */ |
|
| 27 | - public function handle() |
|
| 28 | - { |
|
| 29 | - try { |
|
| 30 | - ob_start(); |
|
| 31 | - ModuleManager::install($this->argument('module')); |
|
| 24 | + /** |
|
| 25 | + * Execute the console command. |
|
| 26 | + */ |
|
| 27 | + public function handle() |
|
| 28 | + { |
|
| 29 | + try { |
|
| 30 | + ob_start(); |
|
| 31 | + ModuleManager::install($this->argument('module')); |
|
| 32 | 32 | |
| 33 | - $this->alert(ob_get_clean()); |
|
| 34 | - } catch (\Exception $e) { |
|
| 35 | - $this->error($e->getMessage()); |
|
| 36 | - } |
|
| 37 | - } |
|
| 33 | + $this->alert(ob_get_clean()); |
|
| 34 | + } catch (\Exception $e) { |
|
| 35 | + $this->error($e->getMessage()); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | } |
@@ -8,58 +8,58 @@ |
||
| 8 | 8 | |
| 9 | 9 | class DatabaseCreateCommand extends Command |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * The name and signature of the console command. |
|
| 13 | - * |
|
| 14 | - * @var string |
|
| 15 | - */ |
|
| 16 | - protected $signature = 'epesi:database-create {name : The name of the database.} |
|
| 11 | + /** |
|
| 12 | + * The name and signature of the console command. |
|
| 13 | + * |
|
| 14 | + * @var string |
|
| 15 | + */ |
|
| 16 | + protected $signature = 'epesi:database-create {name : The name of the database.} |
|
| 17 | 17 | {--connection=mysql DB connection settings}'; |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * The console command description. |
|
| 21 | - * |
|
| 22 | - * @var string |
|
| 23 | - */ |
|
| 24 | - protected $description = 'Create database for the epesi application'; |
|
| 19 | + /** |
|
| 20 | + * The console command description. |
|
| 21 | + * |
|
| 22 | + * @var string |
|
| 23 | + */ |
|
| 24 | + protected $description = 'Create database for the epesi application'; |
|
| 25 | 25 | |
| 26 | - protected $connection; |
|
| 26 | + protected $connection; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Execute the console command. |
|
| 30 | - */ |
|
| 31 | - public function handle() |
|
| 32 | - { |
|
| 33 | - DB::connection($this->connection())->statement('CREATE DATABASE `' . $this->argument('name') . '`'); |
|
| 34 | - } |
|
| 28 | + /** |
|
| 29 | + * Execute the console command. |
|
| 30 | + */ |
|
| 31 | + public function handle() |
|
| 32 | + { |
|
| 33 | + DB::connection($this->connection())->statement('CREATE DATABASE `' . $this->argument('name') . '`'); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Creates the configuration for the connection and returns the key |
|
| 38 | - * |
|
| 39 | - * @return void |
|
| 40 | - */ |
|
| 41 | - protected function connection() |
|
| 42 | - { |
|
| 43 | - $connection = $this->option('connection'); |
|
| 36 | + /** |
|
| 37 | + * Creates the configuration for the connection and returns the key |
|
| 38 | + * |
|
| 39 | + * @return void |
|
| 40 | + */ |
|
| 41 | + protected function connection() |
|
| 42 | + { |
|
| 43 | + $connection = $this->option('connection'); |
|
| 44 | 44 | |
| 45 | - // Just get access to the config. |
|
| 46 | - $config = App::make('config'); |
|
| 45 | + // Just get access to the config. |
|
| 46 | + $config = App::make('config'); |
|
| 47 | 47 | |
| 48 | - // Will contain the array of connections that appear in our database config file. |
|
| 49 | - $connections = $config->get('database.connections'); |
|
| 48 | + // Will contain the array of connections that appear in our database config file. |
|
| 49 | + $connections = $config->get('database.connections'); |
|
| 50 | 50 | |
| 51 | - $driver = is_string($connection)? $connection: $connection['driver']; |
|
| 51 | + $driver = is_string($connection)? $connection: $connection['driver']; |
|
| 52 | 52 | |
| 53 | - $defaultConnection = $connections[$driver]?? $connections[$config->get('database.default')]; |
|
| 53 | + $defaultConnection = $connections[$driver]?? $connections[$config->get('database.default')]; |
|
| 54 | 54 | |
| 55 | - $newConnection = array_merge($defaultConnection, is_string($connection)? []: $connection); |
|
| 55 | + $newConnection = array_merge($defaultConnection, is_string($connection)? []: $connection); |
|
| 56 | 56 | |
| 57 | - // Do not select database |
|
| 58 | - $newConnection['database'] = ''; |
|
| 57 | + // Do not select database |
|
| 58 | + $newConnection['database'] = ''; |
|
| 59 | 59 | |
| 60 | - // This will add our new connection to the run-time configuration for the duration of the request. |
|
| 61 | - $config->set('database.connections.create-db', $newConnection); |
|
| 60 | + // This will add our new connection to the run-time configuration for the duration of the request. |
|
| 61 | + $config->set('database.connections.create-db', $newConnection); |
|
| 62 | 62 | |
| 63 | - return 'create-db'; |
|
| 64 | - } |
|
| 63 | + return 'create-db'; |
|
| 64 | + } |
|
| 65 | 65 | } |
@@ -48,11 +48,11 @@ |
||
| 48 | 48 | // Will contain the array of connections that appear in our database config file. |
| 49 | 49 | $connections = $config->get('database.connections'); |
| 50 | 50 | |
| 51 | - $driver = is_string($connection)? $connection: $connection['driver']; |
|
| 51 | + $driver = is_string($connection) ? $connection : $connection['driver']; |
|
| 52 | 52 | |
| 53 | - $defaultConnection = $connections[$driver]?? $connections[$config->get('database.default')]; |
|
| 53 | + $defaultConnection = $connections[$driver] ?? $connections[$config->get('database.default')]; |
|
| 54 | 54 | |
| 55 | - $newConnection = array_merge($defaultConnection, is_string($connection)? []: $connection); |
|
| 55 | + $newConnection = array_merge($defaultConnection, is_string($connection) ? [] : $connection); |
|
| 56 | 56 | |
| 57 | 57 | // Do not select database |
| 58 | 58 | $newConnection['database'] = ''; |
@@ -8,24 +8,24 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | class EpesiCommand extends Command |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * The name and signature of the console command. |
|
| 13 | - * |
|
| 14 | - * @var string |
|
| 15 | - */ |
|
| 16 | - protected $signature = 'epesi'; |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * The console command description. |
|
| 20 | - * |
|
| 21 | - * @var string |
|
| 22 | - */ |
|
| 23 | - protected $description = 'List all epesi commands'; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * @var string |
|
| 27 | - */ |
|
| 28 | - public static $logo = <<<LOGO |
|
| 11 | + /** |
|
| 12 | + * The name and signature of the console command. |
|
| 13 | + * |
|
| 14 | + * @var string |
|
| 15 | + */ |
|
| 16 | + protected $signature = 'epesi'; |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * The console command description. |
|
| 20 | + * |
|
| 21 | + * @var string |
|
| 22 | + */ |
|
| 23 | + protected $description = 'List all epesi commands'; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * @var string |
|
| 27 | + */ |
|
| 28 | + public static $logo = <<<LOGO |
|
| 29 | 29 | ____ ____ ____ ____ __ |
| 30 | 30 | ( __)( _ \( __)/ ___)( ) |
| 31 | 31 | ) _) ) __/ ) _) \___ \ )( |
@@ -33,74 +33,74 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | LOGO; |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Execute the console command. |
|
| 38 | - */ |
|
| 39 | - public function handle() |
|
| 40 | - { |
|
| 41 | - $this->line(static::$logo); |
|
| 42 | - |
|
| 43 | - $this->comment(''); |
|
| 44 | - $this->comment('Available commands:'); |
|
| 45 | - |
|
| 46 | - $this->listEpesiCommands(); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * List all epesi commands. |
|
| 51 | - * |
|
| 52 | - * @return void |
|
| 53 | - */ |
|
| 54 | - protected function listEpesiCommands() |
|
| 55 | - { |
|
| 56 | - $commands = collect(Artisan::all())->mapWithKeys(function ($command, $key) { |
|
| 57 | - if (Str::startsWith($key, 'epesi:')) { |
|
| 58 | - return [$key => $command]; |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - return []; |
|
| 62 | - })->toArray(); |
|
| 63 | - |
|
| 64 | - $width = $this->getColumnWidth($commands); |
|
| 65 | - |
|
| 66 | - /** @var Command $command */ |
|
| 67 | - foreach ($commands as $command) { |
|
| 68 | - $this->line(sprintf(" %-{$width}s %s", $command->getName(), $command->getDescription())); |
|
| 69 | - } |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - /** |
|
| 73 | - * @param (Command|string)[] $commands |
|
| 74 | - * |
|
| 75 | - * @return int |
|
| 76 | - */ |
|
| 77 | - private function getColumnWidth(array $commands) |
|
| 78 | - { |
|
| 79 | - $widths = []; |
|
| 80 | - |
|
| 81 | - foreach ($commands as $command) { |
|
| 82 | - $widths[] = static::strlen($command->getName()); |
|
| 83 | - foreach ($command->getAliases() as $alias) { |
|
| 84 | - $widths[] = static::strlen($alias); |
|
| 85 | - } |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - return $widths ? max($widths) + 2 : 0; |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * Returns the length of a string, using mb_strwidth if it is available. |
|
| 93 | - * |
|
| 94 | - * @param string $string The string to check its length |
|
| 95 | - * |
|
| 96 | - * @return int The length of the string |
|
| 97 | - */ |
|
| 98 | - public static function strlen($string) |
|
| 99 | - { |
|
| 100 | - if (false === $encoding = mb_detect_encoding($string, null, true)) { |
|
| 101 | - return strlen($string); |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - return mb_strwidth($string, $encoding); |
|
| 105 | - } |
|
| 36 | + /** |
|
| 37 | + * Execute the console command. |
|
| 38 | + */ |
|
| 39 | + public function handle() |
|
| 40 | + { |
|
| 41 | + $this->line(static::$logo); |
|
| 42 | + |
|
| 43 | + $this->comment(''); |
|
| 44 | + $this->comment('Available commands:'); |
|
| 45 | + |
|
| 46 | + $this->listEpesiCommands(); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * List all epesi commands. |
|
| 51 | + * |
|
| 52 | + * @return void |
|
| 53 | + */ |
|
| 54 | + protected function listEpesiCommands() |
|
| 55 | + { |
|
| 56 | + $commands = collect(Artisan::all())->mapWithKeys(function ($command, $key) { |
|
| 57 | + if (Str::startsWith($key, 'epesi:')) { |
|
| 58 | + return [$key => $command]; |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + return []; |
|
| 62 | + })->toArray(); |
|
| 63 | + |
|
| 64 | + $width = $this->getColumnWidth($commands); |
|
| 65 | + |
|
| 66 | + /** @var Command $command */ |
|
| 67 | + foreach ($commands as $command) { |
|
| 68 | + $this->line(sprintf(" %-{$width}s %s", $command->getName(), $command->getDescription())); |
|
| 69 | + } |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * @param (Command|string)[] $commands |
|
| 74 | + * |
|
| 75 | + * @return int |
|
| 76 | + */ |
|
| 77 | + private function getColumnWidth(array $commands) |
|
| 78 | + { |
|
| 79 | + $widths = []; |
|
| 80 | + |
|
| 81 | + foreach ($commands as $command) { |
|
| 82 | + $widths[] = static::strlen($command->getName()); |
|
| 83 | + foreach ($command->getAliases() as $alias) { |
|
| 84 | + $widths[] = static::strlen($alias); |
|
| 85 | + } |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + return $widths ? max($widths) + 2 : 0; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * Returns the length of a string, using mb_strwidth if it is available. |
|
| 93 | + * |
|
| 94 | + * @param string $string The string to check its length |
|
| 95 | + * |
|
| 96 | + * @return int The length of the string |
|
| 97 | + */ |
|
| 98 | + public static function strlen($string) |
|
| 99 | + { |
|
| 100 | + if (false === $encoding = mb_detect_encoding($string, null, true)) { |
|
| 101 | + return strlen($string); |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + return mb_strwidth($string, $encoding); |
|
| 105 | + } |
|
| 106 | 106 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | protected function listEpesiCommands() |
| 55 | 55 | { |
| 56 | - $commands = collect(Artisan::all())->mapWithKeys(function ($command, $key) { |
|
| 56 | + $commands = collect(Artisan::all())->mapWithKeys(function($command, $key) { |
|
| 57 | 57 | if (Str::startsWith($key, 'epesi:')) { |
| 58 | 58 | return [$key => $command]; |
| 59 | 59 | } |
@@ -67,7 +67,9 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | public function addGroupResults($group, $testResults = [], $container = null) |
| 69 | 69 | { |
| 70 | - if (! $testResults) return; |
|
| 70 | + if (! $testResults) { |
|
| 71 | + return; |
|
| 72 | + } |
|
| 71 | 73 | |
| 72 | 74 | $container = $container?: $this; |
| 73 | 75 | |
@@ -153,8 +155,7 @@ discard block |
||
| 153 | 155 | $severity = 0; |
| 154 | 156 | if ($actualSizeBytes < $requiredSizeBytes) { |
| 155 | 157 | $severity = 2; |
| 156 | - } |
|
| 157 | - elseif ($actualSizeBytes == $requiredSizeBytes) { |
|
| 158 | + } elseif ($actualSizeBytes == $requiredSizeBytes) { |
|
| 158 | 159 | $severity = 1; |
| 159 | 160 | } |
| 160 | 161 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | public function addLegend($container = null) |
| 91 | 91 | { |
| 92 | - $container = $container?: $this; |
|
| 92 | + $container = $container ?: $this; |
|
| 93 | 93 | |
| 94 | 94 | $legend = \atk4\ui\Header::addTo($container, [__('Scan of Environment Parameters')])->setStyle('margin-left', '2em'); |
| 95 | 95 | $legend = View::addTo($container)->setStyle('margin-left', 'auto'); |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | public function addGroupResults($group, $testResults = [], $container = null) |
| 103 | 103 | { |
| 104 | - if (! $testResults) return; |
|
| 104 | + if (!$testResults) return; |
|
| 105 | 105 | |
| 106 | - $container = $container?: $this; |
|
| 106 | + $container = $container ?: $this; |
|
| 107 | 107 | |
| 108 | 108 | $container->add([Header::class, $group]); |
| 109 | 109 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | foreach ($testResults as $test) { |
| 113 | 113 | $color = $severityMap[$test['severity']]['color']; |
| 114 | - $result = $test['result']?? $severityMap[$test['severity']]['result']; |
|
| 114 | + $result = $test['result'] ?? $severityMap[$test['severity']]['result']; |
|
| 115 | 115 | |
| 116 | 116 | $row = View::addTo($container, ['class' => ['row']]); |
| 117 | 117 | View::addTo($row, [$test['name'], 'class' => ['nine wide column']]); |
@@ -125,13 +125,13 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | @Schema::dropIfExists('test'); |
| 127 | 127 | |
| 128 | - @Schema::create('test', function (Blueprint $table) { |
|
| 128 | + @Schema::create('test', function(Blueprint $table) { |
|
| 129 | 129 | $table->increments('id'); |
| 130 | 130 | }); |
| 131 | 131 | |
| 132 | 132 | $create = Schema::hasTable('test'); |
| 133 | 133 | |
| 134 | - @Schema::table('test', function (Blueprint $table) { |
|
| 134 | + @Schema::table('test', function(Blueprint $table) { |
|
| 135 | 135 | $table->addColumn('TEXT', 'field_name'); |
| 136 | 136 | }); |
| 137 | 137 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $delete = @DB::delete('DELETE FROM test'); |
| 143 | 143 | @Schema::dropIfExists('test'); |
| 144 | 144 | |
| 145 | - $drop = ! Schema::hasTable('test'); |
|
| 145 | + $drop = !Schema::hasTable('test'); |
|
| 146 | 146 | |
| 147 | 147 | ob_end_clean(); |
| 148 | 148 | |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | array_walk($result, function(& $testResult, $testName) { |
| 152 | 152 | $testResult = [ |
| 153 | 153 | 'name' => __(':permission permission', ['permission' => strtoupper($testName)]), |
| 154 | - 'result' => $testResult? __('OK'): __('Failed'), |
|
| 155 | - 'severity' => $testResult? 0: 2 |
|
| 154 | + 'result' => $testResult ? __('OK') : __('Failed'), |
|
| 155 | + 'severity' => $testResult ? 0 : 2 |
|
| 156 | 156 | ]; |
| 157 | 157 | }); |
| 158 | 158 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | protected function unitToInt($string) |
| 163 | 163 | { |
| 164 | - return (int) preg_replace_callback('/(\-?\d+)(.?)/', function ($m) { |
|
| 164 | + return (int) preg_replace_callback('/(\-?\d+)(.?)/', function($m) { |
|
| 165 | 165 | return $m[1] * pow(1024, strpos('BKMG', $m[2])); |
| 166 | 166 | }, strtoupper($string)); |
| 167 | 167 | } |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $ret = []; |
| 172 | 172 | |
| 173 | - if ($requiredPhpVersion = $this->getApp()->packageInfo()['require']['php']?? null) { |
|
| 173 | + if ($requiredPhpVersion = $this->getApp()->packageInfo()['require']['php'] ?? null) { |
|
| 174 | 174 | $ret[] = [ |
| 175 | 175 | 'name' => __('PHP version required :version', ['version' => $requiredPhpVersion]), |
| 176 | 176 | 'result' => PHP_VERSION, |
| 177 | - 'severity' => version_compare(PHP_VERSION, $requiredPhpVersion, '>=')? 0: 2 |
|
| 177 | + 'severity' => version_compare(PHP_VERSION, $requiredPhpVersion, '>=') ? 0 : 2 |
|
| 178 | 178 | ]; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -210,8 +210,8 @@ discard block |
||
| 210 | 210 | $result = $callback($extension); |
| 211 | 211 | |
| 212 | 212 | $ret[] = array_merge($test, [ |
| 213 | - 'result' => $result? __('OK'): __('Missing'), |
|
| 214 | - 'severity' => $result? 0: $test['severity'] |
|
| 213 | + 'result' => $result ? __('OK') : __('Missing'), |
|
| 214 | + 'severity' => $result ? 0 : $test['severity'] |
|
| 215 | 215 | ]); |
| 216 | 216 | } |
| 217 | 217 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $this->loadMigrationsFrom(ModuleManager::collect('migrations')); |
| 30 | 30 | |
| 31 | 31 | // Publish epesi configuration files |
| 32 | - $this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config'); |
|
| 32 | + $this->publishes([__DIR__ . '/../../config' => config_path()], 'epesi.config'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -20,25 +20,25 @@ |
||
| 20 | 20 | ModuleInstallCommand::class |
| 21 | 21 | ]; |
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Booting the package. |
|
| 25 | - */ |
|
| 26 | - public function boot() |
|
| 27 | - { |
|
| 28 | - $this->app->register(\JoeDixon\Translation\TranslationServiceProvider::class); |
|
| 23 | + /** |
|
| 24 | + * Booting the package. |
|
| 25 | + */ |
|
| 26 | + public function boot() |
|
| 27 | + { |
|
| 28 | + $this->app->register(\JoeDixon\Translation\TranslationServiceProvider::class); |
|
| 29 | 29 | |
| 30 | - // Register migrations from installed modules |
|
| 31 | - $this->loadMigrationsFrom(ModuleManager::collect('migrations')); |
|
| 30 | + // Register migrations from installed modules |
|
| 31 | + $this->loadMigrationsFrom(ModuleManager::collect('migrations')); |
|
| 32 | 32 | |
| 33 | - // Publish epesi configuration files |
|
| 34 | - $this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config'); |
|
| 35 | - } |
|
| 33 | + // Publish epesi configuration files |
|
| 34 | + $this->publishes([__DIR__.'/../../config' => config_path()], 'epesi.config'); |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Register the provider. |
|
| 39 | - */ |
|
| 40 | - public function register() |
|
| 41 | - { |
|
| 42 | - $this->commands($this->commands); |
|
| 43 | - } |
|
| 37 | + /** |
|
| 38 | + * Register the provider. |
|
| 39 | + */ |
|
| 40 | + public function register() |
|
| 41 | + { |
|
| 42 | + $this->commands($this->commands); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -6,48 +6,48 @@ |
||
| 6 | 6 | |
| 7 | 7 | class SetEnvCommand extends Command |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * The name and signature of the console command. |
|
| 11 | - * |
|
| 12 | - * @var string |
|
| 13 | - */ |
|
| 14 | - protected $signature = 'epesi:env {name : Env variable(s) to set} {value? : Env variable value}'; |
|
| 9 | + /** |
|
| 10 | + * The name and signature of the console command. |
|
| 11 | + * |
|
| 12 | + * @var string |
|
| 13 | + */ |
|
| 14 | + protected $signature = 'epesi:env {name : Env variable(s) to set} {value? : Env variable value}'; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * The console command description. |
|
| 18 | - * |
|
| 19 | - * @var string |
|
| 20 | - */ |
|
| 21 | - protected $description = 'Update ENV variable'; |
|
| 16 | + /** |
|
| 17 | + * The console command description. |
|
| 18 | + * |
|
| 19 | + * @var string |
|
| 20 | + */ |
|
| 21 | + protected $description = 'Update ENV variable'; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Execute the console command. |
|
| 25 | - */ |
|
| 26 | - public function handle() |
|
| 27 | - { |
|
| 28 | - $this->setEnv($this->argument('name'), $this->argument('value')); |
|
| 29 | - } |
|
| 23 | + /** |
|
| 24 | + * Execute the console command. |
|
| 25 | + */ |
|
| 26 | + public function handle() |
|
| 27 | + { |
|
| 28 | + $this->setEnv($this->argument('name'), $this->argument('value')); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - private static function setEnv($name, $value = null) |
|
| 32 | - { |
|
| 33 | - $env = $name; |
|
| 34 | - if (is_string($name) && !isset($value)) { |
|
| 35 | - $env = [ |
|
| 36 | - $name => $value |
|
| 37 | - ]; |
|
| 38 | - } |
|
| 31 | + private static function setEnv($name, $value = null) |
|
| 32 | + { |
|
| 33 | + $env = $name; |
|
| 34 | + if (is_string($name) && !isset($value)) { |
|
| 35 | + $env = [ |
|
| 36 | + $name => $value |
|
| 37 | + ]; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - foreach ($env as $key => $value) { |
|
| 41 | - $oldSetting = $key . '=' . env($key); |
|
| 42 | - $newSetting = $key . '=' . $value; |
|
| 40 | + foreach ($env as $key => $value) { |
|
| 41 | + $oldSetting = $key . '=' . env($key); |
|
| 42 | + $newSetting = $key . '=' . $value; |
|
| 43 | 43 | |
| 44 | - putenv($newSetting); |
|
| 44 | + putenv($newSetting); |
|
| 45 | 45 | |
| 46 | - file_put_contents(app()->environmentFilePath(), str_replace( |
|
| 47 | - $oldSetting, |
|
| 48 | - $newSetting, |
|
| 49 | - file_get_contents(app()->environmentFilePath()) |
|
| 50 | - )); |
|
| 51 | - } |
|
| 52 | - } |
|
| 46 | + file_put_contents(app()->environmentFilePath(), str_replace( |
|
| 47 | + $oldSetting, |
|
| 48 | + $newSetting, |
|
| 49 | + file_get_contents(app()->environmentFilePath()) |
|
| 50 | + )); |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | 53 | } |
@@ -6,25 +6,25 @@ |
||
| 6 | 6 | |
| 7 | 7 | class NoCacheHeaders |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Add cache related HTTP headers. |
|
| 11 | - * |
|
| 12 | - * @param \Illuminate\Http\Request $request |
|
| 13 | - * @param \Closure $next |
|
| 14 | - * @param string|array $options |
|
| 15 | - * @return \Symfony\Component\HttpFoundation\Response |
|
| 16 | - * |
|
| 17 | - * @throws \InvalidArgumentException |
|
| 18 | - */ |
|
| 19 | - public function handle($request, Closure $next, $options = []) |
|
| 20 | - { |
|
| 21 | - $response = $next($request); |
|
| 9 | + /** |
|
| 10 | + * Add cache related HTTP headers. |
|
| 11 | + * |
|
| 12 | + * @param \Illuminate\Http\Request $request |
|
| 13 | + * @param \Closure $next |
|
| 14 | + * @param string|array $options |
|
| 15 | + * @return \Symfony\Component\HttpFoundation\Response |
|
| 16 | + * |
|
| 17 | + * @throws \InvalidArgumentException |
|
| 18 | + */ |
|
| 19 | + public function handle($request, Closure $next, $options = []) |
|
| 20 | + { |
|
| 21 | + $response = $next($request); |
|
| 22 | 22 | |
| 23 | - $response->headers->addCacheControlDirective('no-cache', true); |
|
| 24 | - $response->headers->addCacheControlDirective('max-age', 0); |
|
| 25 | - $response->headers->addCacheControlDirective('must-revalidate', true); |
|
| 26 | - $response->headers->addCacheControlDirective('no-store', true); |
|
| 23 | + $response->headers->addCacheControlDirective('no-cache', true); |
|
| 24 | + $response->headers->addCacheControlDirective('max-age', 0); |
|
| 25 | + $response->headers->addCacheControlDirective('must-revalidate', true); |
|
| 26 | + $response->headers->addCacheControlDirective('no-store', true); |
|
| 27 | 27 | |
| 28 | - return $response; |
|
| 29 | - } |
|
| 28 | + return $response; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -8,33 +8,33 @@ |
||
| 8 | 8 | |
| 9 | 9 | class User extends Authenticatable |
| 10 | 10 | { |
| 11 | - use Notifiable; |
|
| 12 | - use HasRoles; |
|
| 11 | + use Notifiable; |
|
| 12 | + use HasRoles; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * The attributes that are mass assignable. |
|
| 16 | - * |
|
| 17 | - * @var array |
|
| 18 | - */ |
|
| 19 | - protected $fillable = [ |
|
| 20 | - 'name', 'email', 'password', |
|
| 21 | - ]; |
|
| 14 | + /** |
|
| 15 | + * The attributes that are mass assignable. |
|
| 16 | + * |
|
| 17 | + * @var array |
|
| 18 | + */ |
|
| 19 | + protected $fillable = [ |
|
| 20 | + 'name', 'email', 'password', |
|
| 21 | + ]; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * The attributes that should be hidden for arrays. |
|
| 25 | - * |
|
| 26 | - * @var array |
|
| 27 | - */ |
|
| 28 | - protected $hidden = [ |
|
| 29 | - 'password', 'remember_token', |
|
| 30 | - ]; |
|
| 23 | + /** |
|
| 24 | + * The attributes that should be hidden for arrays. |
|
| 25 | + * |
|
| 26 | + * @var array |
|
| 27 | + */ |
|
| 28 | + protected $hidden = [ |
|
| 29 | + 'password', 'remember_token', |
|
| 30 | + ]; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * The attributes that should be cast to native types. |
|
| 34 | - * |
|
| 35 | - * @var array |
|
| 36 | - */ |
|
| 37 | - protected $casts = [ |
|
| 38 | - 'email_verified_at' => 'datetime', |
|
| 39 | - ]; |
|
| 32 | + /** |
|
| 33 | + * The attributes that should be cast to native types. |
|
| 34 | + * |
|
| 35 | + * @var array |
|
| 36 | + */ |
|
| 37 | + protected $casts = [ |
|
| 38 | + 'email_verified_at' => 'datetime', |
|
| 39 | + ]; |
|
| 40 | 40 | } |