Skip to content

Commit

Permalink
Use PHP_EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
joanhey committed Oct 20, 2022
1 parent fec3580 commit 3acc6f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Adapterman.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public static function init(): void
require __DIR__ . '/AdapterFunctions.php';

} catch (Exception $e) {
fwrite(STDOUT, self::NAME . " Error:\n\n");
fwrite(STDOUT, $e->getMessage());
fwrite(STDERR, self::NAME . ' Error:' . PHP_EOL);
fwrite(STDERR, $e->getMessage());
exit;
}

fwrite(STDOUT, self::NAME . " OK\n\n");
fwrite(STDOUT, self::NAME . ' OK' . PHP_EOL);
}

/**
Expand All @@ -39,7 +39,7 @@ public static function init(): void
private static function checkVersion(): void
{
if (\PHP_MAJOR_VERSION < 8) {
throw new Exception("* PHP version must be 8 or higher.\n* Actual PHP version: " . \PHP_VERSION . "\n\n ");
throw new Exception("* PHP version must be 8 or higher." . PHP_EOL . "* Actual PHP version: " . \PHP_VERSION . PHP_EOL);
}
}

Expand All @@ -54,7 +54,7 @@ private static function checkFunctionsDisabled(): void

foreach (self::FUNCTIONS as $function) {
if (\function_exists($function)) {
throw new Exception("Functions not disabled in php.ini.\n" . self::showConfiguration());
throw new Exception("Functions not disabled in php.ini." . PHP_EOL . self::showConfiguration());
}
}
}
Expand All @@ -64,7 +64,7 @@ private static function showConfiguration(): string
$inipath = \php_ini_loaded_file();
$methods = \implode(',', self::FUNCTIONS);

return "Add in file: $inipath \n\ndisable_functions=$methods \n\n ";
return "Add in file: $inipath" . PHP_EOL . "disable_functions=$methods" . PHP_EOL;
}
}

Expand Down

0 comments on commit 3acc6f1

Please sign in to comment.