From 3acc6f1cb48347189625d96c1b925e0294f75a8c Mon Sep 17 00:00:00 2001 From: Joanhey Date: Fri, 21 Oct 2022 01:53:39 +0200 Subject: [PATCH] Use PHP_EOL --- src/Adapterman.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Adapterman.php b/src/Adapterman.php index 07ba95c..e804439 100644 --- a/src/Adapterman.php +++ b/src/Adapterman.php @@ -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); } /** @@ -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); } } @@ -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()); } } } @@ -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; } }