Apply Laravel coding style

Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions.

You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root.

For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
This commit is contained in:
Shift
2023-01-06 11:53:02 +00:00
parent af15afd97d
commit 21910f2106
235 changed files with 14381 additions and 14773 deletions

View File

@@ -54,10 +54,10 @@ class SecureFaveoAPPKey extends Command
{
$username = $this->ask('Enter admin account username');
$password = $this->secret('Enter admin account password');
if (!$username || !$password) {
if (! $username || ! $password) {
throw new Exception('Username and password are required.', 1);
}
if (!Hash::check($password, User::where('user_name', $username)->value('password'))) {
if (! Hash::check($password, User::where('user_name', $username)->value('password'))) {
throw new Exception('We do not recognize you, make sure the username or password you provided are correct.', 1);
}
@@ -85,15 +85,14 @@ class SecureFaveoAPPKey extends Command
* This method also updates the LDAP passwords after new key generation
* so that the LDAP plugin does not stop working after update
*
* @param string $file
* @param string $datacontent
*
* @param string $file
* @param string $datacontent
* @return voif
*/
private function updateAppKey(string $file, string $datacontent): void
{
$this->fetchAndStoreEmailPassword();
if (!$this->doesEnvVaribaleExists($datacontent, 'APP_KEY')) {
if (! $this->doesEnvVaribaleExists($datacontent, 'APP_KEY')) {
$datacontent = $datacontent."\r\nAPP_KEY=base64:h3KjrHeVxyE+j6c8whTAs2YI+7goylGZ/e2vElgXT6I=";
File::put($file, $datacontent);
}
@@ -112,14 +111,13 @@ class SecureFaveoAPPKey extends Command
/**
* Function checks if given $key exist in $envContent string.
*
* @param string $envContent
* @param string $key
*
* @param string $envContent
* @param string $key
* @return bool true if given key exist otherwise false
*/
private function doesEnvVaribaleExists(string $envContent, string $key): bool
{
return !(strpos($envContent, $key) === false);
return ! (strpos($envContent, $key) === false);
}
/**
@@ -149,11 +147,10 @@ class SecureFaveoAPPKey extends Command
/**
* Extract the encryption key from the given configuration.
*
* @param array $config
* @param array $config
* @return string
*
* @throws \RuntimeException
*
* @return string
*/
private function key()
{