Use more standardized phpcs

This commit is contained in:
Dane Everitt 2021-01-23 12:33:34 -08:00
parent a043071e3c
commit c449ca5155
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
493 changed files with 1116 additions and 3903 deletions

View file

@ -16,14 +16,12 @@ trait EnvironmentWriterTrait
/**
* Update the .env file for the application using the passed in values.
*
* @param array $values
*
* @throws \Pterodactyl\Exceptions\PterodactylException
*/
public function writeToEnvironment(array $values = [])
{
$path = base_path('.env');
if (! file_exists($path)) {
if (!file_exists($path)) {
throw new PterodactylException('Cannot locate .env file, was this software installed correctly?');
}
@ -33,7 +31,7 @@ trait EnvironmentWriterTrait
// If the key value is not sorrounded by quotation marks, and contains anything that could reasonably
// cause environment parsing issues, wrap it in quotes before writing it. This also adds slashes to the
// value to ensure quotes within it don't cause us issues.
if (! preg_match('/^\"(.*)\"$/', $value) && preg_match('/([^\w.\-+\/])+/', $value)) {
if (!preg_match('/^\"(.*)\"$/', $value) && preg_match('/([^\w.\-+\/])+/', $value)) {
$value = sprintf('"%s"', addslashes($value));
}