diff --git a/Business/Finance/Lorenzkurve.php b/Business/Finance/Lorenzkurve.php index 9968b3ee8..9e09e52db 100644 --- a/Business/Finance/Lorenzkurve.php +++ b/Business/Finance/Lorenzkurve.php @@ -40,7 +40,7 @@ final class Lorenzkurve $i = 1; $n = \count($data); - sort($data); + \sort($data); foreach ($data as $key => $value) { $sum1 += $i * $value; diff --git a/DataStorage/Cookie/CookieJar.php b/DataStorage/Cookie/CookieJar.php index 3b05d78a1..65b1be74a 100644 --- a/DataStorage/Cookie/CookieJar.php +++ b/DataStorage/Cookie/CookieJar.php @@ -130,7 +130,7 @@ final class CookieJar } if (!headers_sent()) { - setcookie($id, '', time() - 3600); + \setcookie($id, '', time() - 3600); return true; } @@ -177,7 +177,7 @@ final class CookieJar } foreach ($this->cookies as $key => $cookie) { - setcookie($key, $cookie['value'], $cookie['expiry'], $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly']); + \setcookie($key, $cookie['value'], $cookie['expiry'], $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httponly']); } } } diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index a3ad628c2..7b9e3cc7b 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -376,7 +376,7 @@ class DataMapperAbstract implements DataMapperInterface self::extend(__CLASS__); $objId = self::createModelArray($obj); - settype($objId, static::$columns[static::$primaryField]['type']); + \settype($objId, static::$columns[static::$primaryField]['type']); $obj[static::$columns[static::$primaryField]['internal']] = $objId; if ($relations === RelationType::ALL) { @@ -556,7 +556,7 @@ class DataMapperAbstract implements DataMapperInterface $refProp->setAccessible(true); } - settype($objId, static::$columns[static::$primaryField]['type']); + \settype($objId, static::$columns[static::$primaryField]['type']); $refProp->setValue($obj, $objId); if (!$isPublic) { @@ -1812,7 +1812,7 @@ class DataMapperAbstract implements DataMapperInterface if (\in_array(static::$columns[$column]['type'], ['string', 'int', 'float', 'bool'])) { // todo: what is this or condition for? seems to be wrong if obj null then it doesn't work anyways if ($value !== null || $refProp->getValue($obj) !== null) { - settype($value, static::$columns[$column]['type']); + \settype($value, static::$columns[$column]['type']); } if ($hasPath) { @@ -1871,7 +1871,7 @@ class DataMapperAbstract implements DataMapperInterface } if (\in_array(static::$columns[$column]['type'], ['string', 'int', 'float', 'bool'])) { - settype($value, static::$columns[$column]['type']); + \settype($value, static::$columns[$column]['type']); } elseif (static::$columns[$column]['type'] === 'DateTime') { $value = new \DateTime($value ?? ''); } elseif (static::$columns[$column]['type'] === 'Json') { diff --git a/DataStorage/Session/HttpSession.php b/DataStorage/Session/HttpSession.php index 443fb5e38..6230c4119 100644 --- a/DataStorage/Session/HttpSession.php +++ b/DataStorage/Session/HttpSession.php @@ -90,7 +90,7 @@ class HttpSession implements SessionInterface $this->inactivityInterval = $inactivityInterval; - if (session_status() !== PHP_SESSION_ACTIVE && !headers_sent()) { + if (\session_status() !== PHP_SESSION_ACTIVE && !\headers_sent()) { \session_set_cookie_params($liftetime, '/', '', false, true); \session_start(); } diff --git a/Localization/Localization.php b/Localization/Localization.php index 7dc372e46..0b1e01383 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -159,7 +159,7 @@ final class Localization foreach ($files as $file) { if (\stripos($file, $langCode) === 0) { $this->importLocale( - json_decode( + \json_decode( \file_get_contents(__DIR__ . '/../Localization/Defaults/Definitions/' . $file), true ) @@ -169,7 +169,7 @@ final class Localization } $this->importLocale( - json_decode( + \json_decode( \file_get_contents(__DIR__ . '/../Localization/Defaults/Definitions/en_US.json'), true ) diff --git a/Log/FileLogger.php b/Log/FileLogger.php index 149387ef1..12b52db0c 100644 --- a/Log/FileLogger.php +++ b/Log/FileLogger.php @@ -511,7 +511,7 @@ final class FileLogger implements LoggerInterface $logs[$id] = $line; $limit--; - ksort($logs); + \ksort($logs); $line = \fgetcsv($this->fp, 0, ';'); } diff --git a/Math/Geometry/ConvexHull/MonotoneChain.php b/Math/Geometry/ConvexHull/MonotoneChain.php index a0aad0def..757b316fb 100644 --- a/Math/Geometry/ConvexHull/MonotoneChain.php +++ b/Math/Geometry/ConvexHull/MonotoneChain.php @@ -47,7 +47,7 @@ final class MonotoneChain public static function createConvexHull(array $points) : array { if (($n = \count($points)) > 1) { - uasort($points, [self::class, 'sort']); + \uasort($points, [self::class, 'sort']); $k = 0; $result = []; @@ -70,9 +70,9 @@ final class MonotoneChain $result[$k++] = $points[$i]; } - ksort($result); + \ksort($result); - return array_slice($result, 0, $k - 1); + return \array_slice($result, 0, $k - 1); } return $points; @@ -104,7 +104,7 @@ final class MonotoneChain * * @since 1.0.0 */ - private static function sort(array $a, array $b) : float + private static function \sort(array $a, array $b) : float { return $a['x'] === $b['x'] ? $a['y'] - $b['y'] : $a['x'] - $b['x']; } diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index d18e86a35..33ac7ab8b 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -772,7 +772,7 @@ class Matrix implements \ArrayAccess, \Iterator /** * {@inheritdoc} */ - public function rewind() + public function \rewind() { $this->position = 0; } diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index b07f62a9f..85f496981 100644 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -199,7 +199,7 @@ final class Average $count = array_count_values($values); $best = \max($count); - return (float) (array_keys($count, $best)[0] ?? 0.0); + return (float) (\array_keys($count, $best)[0] ?? 0.0); } /** @@ -215,7 +215,7 @@ final class Average */ public static function median(array $values) : float { - sort($values); + \sort($values); $count = \count($values); $middleval = (int) floor(($count - 1) / 2); @@ -271,7 +271,7 @@ final class Average */ public static function harmonicMean(array $values, int $offset = 0) : float { - sort($values); + \sort($values); if ($offset > 0) { $values = array_slice($values, $offset, -$offset); @@ -334,7 +334,7 @@ final class Average */ public static function angleMean2(array $angles, int $offset = 0) : float { - sort($angles); + \sort($angles); if ($offset > 0) { $angles = array_slice($angles, $offset, -$offset); diff --git a/Math/Statistic/MeasureOfDispersion.php b/Math/Statistic/MeasureOfDispersion.php index 6f6fb71b1..ec2e86f17 100644 --- a/Math/Statistic/MeasureOfDispersion.php +++ b/Math/Statistic/MeasureOfDispersion.php @@ -51,7 +51,7 @@ final class MeasureOfDispersion */ public static function range(array $values) : float { - sort($values); + \sort($values); $end = \end($values); $start = \reset($values); diff --git a/Message/Console/Header.php b/Message/Console/Header.php index c9ca5e4a7..1b8882c71 100644 --- a/Message/Console/Header.php +++ b/Message/Console/Header.php @@ -146,7 +146,7 @@ final class Header extends HeaderAbstract */ public static function getAllHeaders() : array { - if (function_exists('getallheaders')) { + if (\function_exists('getallheaders')) { // @codeCoverageIgnoreStart return getallheaders(); // @codeCoverageIgnoreEnd @@ -241,7 +241,7 @@ final class Header extends HeaderAbstract foreach ($this->header as $name => $arr) { foreach ($arr as $ele => $value) { - header($name . ': ' . $value); + \header($name . ': ' . $value); } } } diff --git a/Message/Http/Header.php b/Message/Http/Header.php index 69ea4ae11..078836cec 100644 --- a/Message/Http/Header.php +++ b/Message/Http/Header.php @@ -234,11 +234,11 @@ final class Header extends HeaderAbstract foreach ($this->header as $name => $arr) { foreach ($arr as $ele => $value) { - header($name . ': ' . $value); + \header($name . ': ' . $value); } } - header("X-Powered-By: hidden"); + \header("X-Powered-By: hidden"); $this->lock(); } diff --git a/Message/Http/Rest.php b/Message/Http/Rest.php index 6cde97c18..b05b71bbc 100644 --- a/Message/Http/Rest.php +++ b/Message/Http/Rest.php @@ -42,12 +42,12 @@ final class Rest throw new \Exception(); } - curl_setopt($curl, CURLOPT_NOBODY, true); - curl_setopt($curl, CURLOPT_HEADER, false); + \curl_setopt($curl, CURLOPT_NOBODY, true); + \curl_setopt($curl, CURLOPT_HEADER, false); switch ($request->getMethod()) { case RequestMethod::GET: - curl_setopt($curl, CURLOPT_HTTPGET, true); + \curl_setopt($curl, CURLOPT_HTTPGET, true); break; case RequestMethod::PUT: \curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); diff --git a/Module/ModuleAbstract.php b/Module/ModuleAbstract.php index 018b4351e..6811c5817 100644 --- a/Module/ModuleAbstract.php +++ b/Module/ModuleAbstract.php @@ -118,7 +118,7 @@ abstract class ModuleAbstract public static function getLocalization(string $language, string $destination) : array { $lang = []; - if (file_exists($oldPath = __DIR__ . '/../../Modules/' . static::MODULE_NAME . '/Theme/' . $destination . '/Lang/' . $language . '.lang.php')) { + if (\file_exists($oldPath = __DIR__ . '/../../Modules/' . static::MODULE_NAME . '/Theme/' . $destination . '/Lang/' . $language . '.lang.php')) { /** @noinspection PhpIncludeInspection */ return include $oldPath; } diff --git a/Module/ModuleManager.php b/Module/ModuleManager.php index d5d9770f6..221fe98ba 100644 --- a/Module/ModuleManager.php +++ b/Module/ModuleManager.php @@ -249,7 +249,7 @@ final class ModuleManager public function getAllModules() : array { if (empty($this->all)) { - chdir($this->modulePath); + \chdir($this->modulePath); $files = \glob('*', GLOB_ONLYDIR); $c = \count($files); @@ -572,7 +572,7 @@ final class ModuleManager */ public function installProviding(string $from, string $for) : void { - if (file_exists($this->modulePath . '/' . $from . '/Admin/Install/' . $for . '.php')) { + if (\file_exists($this->modulePath . '/' . $from . '/Admin/Install/' . $for . '.php')) { $class = '\\Modules\\' . $from . '\\Admin\\Install\\' . $for; $class::install($this->modulePath, $this->app->dbPool); } diff --git a/Socket/CommandManager.php b/Socket/CommandManager.php index 430559372..b6b25e1ea 100644 --- a/Socket/CommandManager.php +++ b/Socket/CommandManager.php @@ -79,7 +79,7 @@ class CommandManager implements \Countable */ public function detach(string $cmd, $source) : void { - if (array_key_exists($cmd, $this->commands)) { + if (\array_key_exists($cmd, $this->commands)) { unset($this->commands[$cmd]); $this->count--; } @@ -98,7 +98,7 @@ class CommandManager implements \Countable */ public function trigger(string $cmd, $conn, $para) { - if (array_key_exists($cmd, $this->commands)) { + if (\array_key_exists($cmd, $this->commands)) { return $this->commands[$cmd][0]($conn, $para); } diff --git a/Socket/Server/Server.php b/Socket/Server/Server.php index 074bba80c..9c4b2759f 100644 --- a/Socket/Server/Server.php +++ b/Socket/Server/Server.php @@ -92,7 +92,7 @@ class Server extends SocketAbstract $connected = @fsockopen("www.google.com", 80); if ($connected) { - fclose($connected); + \fclose($connected); return true; } else { diff --git a/Stdlib/Queue/PriorityQueue.php b/Stdlib/Queue/PriorityQueue.php index 6967d7560..d90332223 100644 --- a/Stdlib/Queue/PriorityQueue.php +++ b/Stdlib/Queue/PriorityQueue.php @@ -65,7 +65,7 @@ class PriorityQueue implements \Countable, \Serializable { do { $key = \rand(); - } while (array_key_exists($key, $this->queue)); + } while (\array_key_exists($key, $this->queue)); if ($this->count === 0) { $this->queue[$key] = ['key' => $key, 'job' => $job, 'priority' => $priority]; @@ -80,7 +80,7 @@ class PriorityQueue implements \Countable, \Serializable } $original = []; - array_splice($original, $pos, 0, [$key => ['key' => $key, 'job' => $job, 'priority' => $priority]]); + \array_splice($original, $pos, 0, [$key => ['key' => $key, 'job' => $job, 'priority' => $priority]]); } return $key; diff --git a/System/File/Ftp/Directory.php b/System/File/Ftp/Directory.php index da94fc44f..5e2bc453e 100644 --- a/System/File/Ftp/Directory.php +++ b/System/File/Ftp/Directory.php @@ -272,7 +272,7 @@ class Directory extends FileAbstract implements DirectoryInterface /** * {@inheritdoc} */ - public function rewind() + public function \rewind() { \reset($this->nodes); } diff --git a/System/File/Ftp/File.php b/System/File/Ftp/File.php index 5f56dbf12..fb2f9bf32 100644 --- a/System/File/Ftp/File.php +++ b/System/File/Ftp/File.php @@ -179,7 +179,7 @@ class File extends FileAbstract implements FileInterface $con = self::ftpConnect($http); $exists = self::ftpExists($con, $http->getPath()); - fclose($con); + \fclose($con); return $exists; } diff --git a/System/File/Local/Directory.php b/System/File/Local/Directory.php index e110099c7..d92719f67 100644 --- a/System/File/Local/Directory.php +++ b/System/File/Local/Directory.php @@ -60,7 +60,7 @@ final class Directory extends FileAbstract implements DirectoryInterface $this->filter = \ltrim($filter, '\\/'); parent::__construct($path); - if (file_exists($this->path)) { + if (\file_exists($this->path)) { $this->index(); } } @@ -449,7 +449,7 @@ final class Directory extends FileAbstract implements DirectoryInterface /** * {@inheritdoc} */ - public function rewind() + public function \rewind() { \reset($this->nodes); } diff --git a/System/File/Local/File.php b/System/File/Local/File.php index 2a12967b0..7fe8da7e2 100644 --- a/System/File/Local/File.php +++ b/System/File/Local/File.php @@ -283,10 +283,10 @@ final class File extends FileAbstract implements FileInterface } if ($overwrite && \file_exists($to)) { - unlink($to); + \unlink($to); } - copy($from, $to); + \copy($from, $to); return true; } @@ -317,7 +317,7 @@ final class File extends FileAbstract implements FileInterface return false; } - unlink($path); + \unlink($path); return true; } diff --git a/System/SystemUtils.php b/System/SystemUtils.php index d834aa852..486a7f801 100644 --- a/System/SystemUtils.php +++ b/System/SystemUtils.php @@ -48,11 +48,11 @@ final class SystemUtils if (\stristr(PHP_OS, 'WIN')) { $memArr = []; - exec('wmic memorychip get capacity', $memArr); + \exec('wmic memorychip get capacity', $memArr); $mem = \array_sum($memArr) / 1024; } elseif (\stristr(PHP_OS, 'LINUX')) { - $fh = \fopen('/proc/meminfo', 'r'); + $fh = \fopen('/proc/meminfo', 'r'); if ($fh === false) { return $mem; @@ -113,7 +113,7 @@ final class SystemUtils if (\stristr(PHP_OS, 'WIN') !== false) { $cpuUsage = null; - exec('wmic cpu get LoadPercentage', $cpuUsage); + \exec('wmic cpu get LoadPercentage', $cpuUsage); $cpuUsage = $cpuUsage[1]; } elseif (\stristr(PHP_OS, 'LINUX') !== false) { $cpuUsage = \sys_getloadavg()[0] * 100; diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index b3e10d7eb..b0356dcfb 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -285,7 +285,7 @@ final class ArrayUtils /** @noinspection PhpMethodParametersCountMismatchInspection */ \fputcsv($outstream, $data, $delimiter, $enclosure, $escape); - rewind($outstream); + \rewind($outstream); $csv = \fgets($outstream); \fclose($outstream); diff --git a/Utils/Converter/Numeric.php b/Utils/Converter/Numeric.php index b36f3ca85..d95210ef4 100644 --- a/Utils/Converter/Numeric.php +++ b/Utils/Converter/Numeric.php @@ -82,9 +82,9 @@ class Numeric for ($i = 1; $i <= $numberLen; ++$i) { $newOutput = \bcadd( $newOutput, - bcmul( + \bcmul( (string) \array_search($number[$i - 1], $fromBase), - bcpow((string) $fromLen, (string) ($numberLen - $i)) + \bcpow((string) $fromLen, (string) ($numberLen - $i)) ) ); } diff --git a/Utils/Encoding/Huffman/Dictionary.php b/Utils/Encoding/Huffman/Dictionary.php index 969178866..09aa2ff5e 100644 --- a/Utils/Encoding/Huffman/Dictionary.php +++ b/Utils/Encoding/Huffman/Dictionary.php @@ -83,13 +83,13 @@ final class Dictionary $source = \str_replace($source[0], '', $source); } - sort($count); + \sort($count); while (\count($count) > 1) { $row1 = array_shift($count); $row2 = array_shift($count); $count[] = [$row1[0] + $row2[0], [$row1, $row2]]; - sort($count); + \sort($count); } $this->fill(\is_array($count[0][1]) ? $count[0][1] : $count); diff --git a/Utils/IO/Zip/TarGz.php b/Utils/IO/Zip/TarGz.php index 46d610b6e..831d00b7b 100644 --- a/Utils/IO/Zip/TarGz.php +++ b/Utils/IO/Zip/TarGz.php @@ -36,7 +36,7 @@ class TarGz implements ArchiveInterface } $pack = Gz::pack($destination . '.tmp', $destination, $overwrite); - unlink($destination . '.tmp'); + \unlink($destination . '.tmp'); return $pack; } @@ -51,7 +51,7 @@ class TarGz implements ArchiveInterface } $unpacked = Tar::unpack($destination . '.tmp', $destination); - unlink($destination . '.tmp'); + \unlink($destination . '.tmp'); return $unpacked; } diff --git a/Utils/JobQueue/JobQueue.php b/Utils/JobQueue/JobQueue.php index 5eeee98dd..7f274d418 100644 --- a/Utils/JobQueue/JobQueue.php +++ b/Utils/JobQueue/JobQueue.php @@ -80,22 +80,22 @@ class JobQueue $this->run = false; } - sleep(1); + \sleep(1); } - sleep(1); + \sleep(1); return -1; } private function runAsDeamon() { - ob_end_clean(); - fclose(STDIN); - fclose(STDOUT); - fclose(STDERR); + \ob_end_clean(); + \fclose(STDIN); + \fclose(STDOUT); + \fclose(STDERR); - register_shutdown_function(function() { posix_kill(posix_getpid(), SIGHUP); }); + \register_shutdown_function(function() { \posix_kill(\posix_getpid(), SIGHUP); }); } public function setRunning(bool $run = true) : void diff --git a/Utils/RnG/ArrayRandomize.php b/Utils/RnG/ArrayRandomize.php index 237626371..c866000e1 100644 --- a/Utils/RnG/ArrayRandomize.php +++ b/Utils/RnG/ArrayRandomize.php @@ -38,9 +38,9 @@ class ArrayRandomize $shuffled = []; while (!empty($arr)) { - $rnd = (int) array_rand($arr); + $rnd = (int) \array_rand($arr); $shuffled[] = $arr[$rnd] ?? null; - array_splice($arr, $rnd, 1); + \array_splice($arr, $rnd, 1); } return $shuffled; @@ -60,7 +60,7 @@ class ArrayRandomize $shuffled = []; for ($i = \count($arr) - 1; $i > 0; $i--) { - $rnd = mt_rand(0, $i); + $rnd = \mt_rand(0, $i); $shuffled[$i] = $arr[$rnd]; $shuffled[$rnd] = $arr[$i]; } diff --git a/Utils/StringUtils.php b/Utils/StringUtils.php index 79f12901c..24e0a3d85 100644 --- a/Utils/StringUtils.php +++ b/Utils/StringUtils.php @@ -83,7 +83,7 @@ final class StringUtils public static function mb_contains(string $haystack, array $needles) : bool { foreach ($needles as $needle) { - if (mb_strpos($haystack, $needle) !== false) { + if (\mb_strpos($haystack, $needle) !== false) { return true; } } @@ -173,7 +173,7 @@ final class StringUtils } foreach ($needles as $needle) { - if ($needle === '' || mb_strrpos($haystack, $needle, -mb_strlen($haystack)) !== false) { + if ($needle === '' || \mb_strrpos($haystack, $needle, -\mb_strlen($haystack)) !== false) { return true; } } @@ -205,7 +205,7 @@ final class StringUtils } foreach ($needles as $needle) { - if ($needle === '' || (($temp = mb_strlen($haystack) - mb_strlen($needle)) >= 0 && mb_strpos($haystack, $needle, $temp) !== false)) { + if ($needle === '' || (($temp = \mb_strlen($haystack) - \mb_strlen($needle)) >= 0 && mb_strpos($haystack, $needle, $temp) !== false)) { return true; } } @@ -224,9 +224,9 @@ final class StringUtils */ public static function mb_ucfirst(string $string) : string { - $strlen = mb_strlen($string); - $firstChar = mb_substr($string, 0, 1); - $then = mb_substr($string, 1, $strlen - 1); + $strlen = \mb_strlen($string); + $firstChar = \mb_substr($string, 0, 1); + $then = \mb_substr($string, 1, $strlen - 1); return mb_strtoupper($firstChar) . $then; } @@ -242,9 +242,9 @@ final class StringUtils */ public static function mb_lcfirst(string $string) : string { - $strlen = mb_strlen($string); - $firstChar = mb_substr($string, 0, 1); - $then = mb_substr($string, 1, $strlen - 1); + $strlen = \mb_strlen($string); + $firstChar = \mb_substr($string, 0, 1); + $then = \mb_substr($string, 1, $strlen - 1); return mb_strtolower($firstChar) . $then; } @@ -264,9 +264,9 @@ final class StringUtils if ($charlist === ' ') { return \trim($string); } else { - $charlist = \str_replace('/', '\/', preg_quote($charlist)); + $charlist = \str_replace('/', '\/', \preg_quote($charlist)); - return preg_replace('/(^[' . $charlist . ']+)|([ ' . $charlist . ']+$)/us', '', $string); + return \preg_replace('/(^[' . $charlist . ']+)|([ ' . $charlist . ']+$)/us', '', $string); } } @@ -285,9 +285,9 @@ final class StringUtils if ($charlist === ' ') { return \rtrim($string); } else { - $charlist = \str_replace('/', '\/', preg_quote($charlist)); + $charlist = \str_replace('/', '\/', \preg_quote($charlist)); - return preg_replace('/([' . $charlist . ']+$)/us', '', $string); + return \preg_replace('/([' . $charlist . ']+$)/us', '', $string); } } @@ -306,9 +306,9 @@ final class StringUtils if ($charlist === ' ') { return \ltrim($string); } else { - $charlist = \str_replace('/', '\/', preg_quote($charlist)); + $charlist = \str_replace('/', '\/', \preg_quote($charlist)); - return preg_replace('/(^[' . $charlist . ']+)/us', '', $string); + return \preg_replace('/(^[' . $charlist . ']+)/us', '', $string); } } @@ -353,7 +353,7 @@ final class StringUtils public static function getEntropy(string $value) : float { $entroy = 0.0; - $size = mb_strlen($value); + $size = \mb_strlen($value); $countChars = self::mb_count_chars($value); foreach ($countChars as $v) { @@ -375,13 +375,13 @@ final class StringUtils */ public static function mb_count_chars(string $input) : array { - $l = mb_strlen($input, 'UTF-8'); + $l = \mb_strlen($input, 'UTF-8'); $unique = []; for ($i = 0; $i < $l; ++$i) { - $char = mb_substr($input, $i, 1, 'UTF-8'); + $char = \mb_substr($input, $i, 1, 'UTF-8'); - if (!array_key_exists($char, $unique)) { + if (!\array_key_exists($char, $unique)) { $unique[$char] = 0; } diff --git a/Utils/TaskSchedule/Cron.php b/Utils/TaskSchedule/Cron.php index d2d53050e..303df1d09 100644 --- a/Utils/TaskSchedule/Cron.php +++ b/Utils/TaskSchedule/Cron.php @@ -33,7 +33,7 @@ class Cron extends SchedulerAbstract $this->run('-l > ' . __DIR__ . '/tmpcron.tmp'); \file_put_contents(__DIR__ . '/tmpcron.tmp', $task->__toString() . "\n", FILE_APPEND); $this->run(__DIR__ . '/tmpcron.tmp'); - unlink(__DIR__ . '/tmpcron.tmp'); + \unlink(__DIR__ . '/tmpcron.tmp'); } /** @@ -63,7 +63,7 @@ class Cron extends SchedulerAbstract } $this->run(__DIR__ . '/tmpcron.tmp'); - unlink(__DIR__ . '/tmpcron.tmp'); + \unlink(__DIR__ . '/tmpcron.tmp'); } /** @@ -101,7 +101,7 @@ class Cron extends SchedulerAbstract } $this->run(__DIR__ . '/tmpcron.tmp'); - unlink(__DIR__ . '/tmpcron.tmp'); + \unlink(__DIR__ . '/tmpcron.tmp'); } /** @@ -137,7 +137,7 @@ class Cron extends SchedulerAbstract } $this->run(__DIR__ . '/tmpcron.tmp'); - unlink(__DIR__ . '/tmpcron.tmp'); + \unlink(__DIR__ . '/tmpcron.tmp'); return $jobs; } @@ -169,7 +169,7 @@ class Cron extends SchedulerAbstract } $this->run(__DIR__ . '/tmpcron.tmp'); - unlink(__DIR__ . '/tmpcron.tmp'); + \unlink(__DIR__ . '/tmpcron.tmp'); return $jobs; } diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index 4bec21240..99fc1ea57 100644 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -184,7 +184,7 @@ abstract class ViewAbstract implements \Serializable $this->views[$id] = $view; if ($order !== 0) { - uasort($this->views, ['\phpOMS\Views\View', 'viewSort']); + \uasort($this->views, ['\phpOMS\Views\View', 'viewSort']); } return true; @@ -250,7 +250,7 @@ abstract class ViewAbstract implements \Serializable } try { - ob_start(); + \ob_start(); /** @noinspection PhpIncludeInspection */ $includeData = include $path; $ob = (string) ob_get_clean(); diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 186173f1e..e3363355c 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -2,9 +2,9 @@ ini_set('memory_limit', '2048M'); -if (file_exists('vendor/autoload.php')) { +if (\file_exists('vendor/autoload.php')) { include_once 'vendor/autoload.php'; -} elseif (file_exists('../../vendor/autoload.php')) { +} elseif (\file_exists('../../vendor/autoload.php')) { include_once '../../vendor/autoload.php'; } diff --git a/tests/DataStorage/Cache/Connection/FileCacheTest.php b/tests/DataStorage/Cache/Connection/FileCacheTest.php index 80d5d4a3b..756b859c1 100644 --- a/tests/DataStorage/Cache/Connection/FileCacheTest.php +++ b/tests/DataStorage/Cache/Connection/FileCacheTest.php @@ -19,8 +19,8 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase { public function testDefault() { - if (file_exists(__DIR__ . '/Cache')) { - rmdir(__DIR__ . '/Cache'); + if (\file_exists(__DIR__ . '/Cache')) { + \rmdir(__DIR__ . '/Cache'); } $cache = new FileCache(__DIR__ . '/Cache'); @@ -30,15 +30,15 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase self::assertEquals(50, $cache->getThreshold()); self::assertEquals(null, $cache->get('test')); - if (file_exists(__DIR__ . '/Cache')) { - rmdir(__DIR__ . '/Cache'); + if (\file_exists(__DIR__ . '/Cache')) { + \rmdir(__DIR__ . '/Cache'); } } public function testGetSet() { - if (file_exists(__DIR__ . '/Cache')) { - rmdir(__DIR__ . '/Cache'); + if (\file_exists(__DIR__ . '/Cache')) { + \rmdir(__DIR__ . '/Cache'); } $cache = new FileCache(__DIR__ . '/Cache'); @@ -70,8 +70,8 @@ class FileCacheTest extends \PHPUnit\Framework\TestCase $cache->flushAll(); self::assertEquals(null, $cache->get('key5')); - if (file_exists(__DIR__ . '/Cache')) { - rmdir(__DIR__ . '/Cache'); + if (\file_exists(__DIR__ . '/Cache')) { + \rmdir(__DIR__ . '/Cache'); } } } diff --git a/tests/Log/FileLoggerTest.php b/tests/Log/FileLoggerTest.php index ed275d4a4..9e5011a3d 100644 --- a/tests/Log/FileLoggerTest.php +++ b/tests/Log/FileLoggerTest.php @@ -27,15 +27,15 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertObjectHasAttribute('fp', $log); self::assertObjectHasAttribute('path', $log); - if (file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { - unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); + if (\file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { + \unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); } } public function testDefault() { - if (file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { - unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); + if (\file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { + \unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); } $log = FileLogger::getInstance(__DIR__); @@ -44,15 +44,15 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $log->get()); self::assertEquals([], $log->getByLine()); - if (file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { - unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); + if (\file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { + \unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); } } public function testGetSet() { - if (file_exists(__DIR__ . '/test.log')) { - unlink(__DIR__ . '/test.log'); + if (\file_exists(__DIR__ . '/test.log')) { + \unlink(__DIR__ . '/test.log'); } $log = new FileLogger(__DIR__ . '/test.log', false); @@ -124,7 +124,7 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals([6, 7, 8, 9, 10], array_keys($log->get(5, 1))); self::assertEquals('alert', $log->getByLine(2)['level']); - ob_start(); + \ob_start(); $log->console(FileLogger::MSG_FULL, true, [ 'message' => 'msg', 'line' => 11, @@ -134,18 +134,18 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $log->countLogs()['info'] ?? 0); self::assertTrue(\stripos($ob, 'msg;') !== false); - ob_start(); + \ob_start(); $log->console('test', true); $ob = ob_get_clean(); self::assertEquals(\date('[Y-m-d H:i:s] ') . "test\r\n", $ob); - unlink(__DIR__ . '/test.log'); + \unlink(__DIR__ . '/test.log'); - if (file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { - unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); + if (\file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { + \unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); } - ob_clean(); + \ob_clean(); } /** @@ -170,12 +170,12 @@ class FileLoggerTest extends \PHPUnit\Framework\TestCase public static function tearDownAfterClass() { - if (file_exists(__DIR__ . '/test.log')) { - unlink(__DIR__ . '/test.log'); + if (\file_exists(__DIR__ . '/test.log')) { + \unlink(__DIR__ . '/test.log'); } - if (file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { - unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); + if (\file_exists(__DIR__ . '/' . date('Y-m-d') . '.log')) { + \unlink(__DIR__ . '/' . date('Y-m-d') . '.log'); } } } diff --git a/tests/System/File/Ftp/DirectoryTest.php b/tests/System/File/Ftp/DirectoryTest.php index 6a412a562..ca1a5e5a8 100644 --- a/tests/System/File/Ftp/DirectoryTest.php +++ b/tests/System/File/Ftp/DirectoryTest.php @@ -63,13 +63,13 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase $dirTestPath = self::BASE . '/dirtest'; self::assertTrue(Directory::copy($dirTestPath, self::BASE . '/newdirtest')); - self::assertTrue(file_exists(self::BASE . '/newdirtest/sub/path/test3.txt')); + self::assertTrue(\file_exists(self::BASE . '/newdirtest/sub/path/test3.txt')); self::assertTrue(Directory::delete($dirTestPath)); self::assertFalse(Directory::exists($dirTestPath)); self::assertTrue(Directory::move(self::BASE . '/newdirtest', $dirTestPath)); - self::assertTrue(file_exists($dirTestPath . '/sub/path/test3.txt')); + self::assertTrue(\file_exists($dirTestPath . '/sub/path/test3.txt')); self::assertEquals(4, Directory::count($dirTestPath)); self::assertEquals(1, Directory::count($dirTestPath, false)); diff --git a/tests/System/File/Ftp/FileTest.php b/tests/System/File/Ftp/FileTest.php index f6c097060..e4997d5ea 100644 --- a/tests/System/File/Ftp/FileTest.php +++ b/tests/System/File/Ftp/FileTest.php @@ -76,15 +76,15 @@ class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(File::exists($newPath2)); self::assertFalse(File::delete($newPath2)); - unlink($newPath); - rmdir(self::BASE . '/sub/path/'); - rmdir(self::BASE . '/sub/'); + \unlink($newPath); + \rmdir(self::BASE . '/sub/path/'); + \rmdir(self::BASE . '/sub/'); self::assertTrue(File::create($testFile)); self::assertFalse(File::create($testFile)); self::assertEquals('', File::get($testFile)); - unlink($testFile); + \unlink($testFile); } /** diff --git a/tests/System/File/Ftp/FtpStorageTest.php b/tests/System/File/Ftp/FtpStorageTest.php index 266198657..c151cf7b8 100644 --- a/tests/System/File/Ftp/FtpStorageTest.php +++ b/tests/System/File/Ftp/FtpStorageTest.php @@ -76,15 +76,15 @@ class FtpStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(FtpStorage::exists($newPath2)); self::assertFalse(FtpStorage::delete($newPath2)); - unlink($newPath); - rmdir(self::BASE . '/sub/path/'); - rmdir(self::BASE . '/sub/'); + \unlink($newPath); + \rmdir(self::BASE . '/sub/path/'); + \rmdir(self::BASE . '/sub/'); self::assertTrue(FtpStorage::create($testFile)); self::assertFalse(FtpStorage::create($testFile)); self::assertEquals('', FtpStorage::get($testFile)); - unlink($testFile); + \unlink($testFile); } public function testDirectory() @@ -127,13 +127,13 @@ class FtpStorageTest extends \PHPUnit\Framework\TestCase $dirTestPath = self::BASE . '/dirtest'; self::assertTrue(FtpStorage::copy($dirTestPath, self::BASE . '/newdirtest')); - self::assertTrue(file_exists(self::BASE . '/newdirtest/sub/path/test3.txt')); + self::assertTrue(\file_exists(self::BASE . '/newdirtest/sub/path/test3.txt')); self::assertTrue(FtpStorage::delete($dirTestPath)); self::assertFalse(FtpStorage::exists($dirTestPath)); self::assertTrue(FtpStorage::move(self::BASE . '/newdirtest', $dirTestPath)); - self::assertTrue(file_exists($dirTestPath . '/sub/path/test3.txt')); + self::assertTrue(\file_exists($dirTestPath . '/sub/path/test3.txt')); self::assertEquals(4, FtpStorage::count($dirTestPath)); self::assertEquals(1, FtpStorage::count($dirTestPath, false)); diff --git a/tests/System/File/Local/DirectoryTest.php b/tests/System/File/Local/DirectoryTest.php index 4ef0c7676..0c7ea20c2 100644 --- a/tests/System/File/Local/DirectoryTest.php +++ b/tests/System/File/Local/DirectoryTest.php @@ -52,13 +52,13 @@ class DirectoryTest extends \PHPUnit\Framework\TestCase $dirTestPath = __DIR__ . '/dirtest'; self::assertTrue(Directory::copy($dirTestPath, __DIR__ . '/newdirtest')); - self::assertTrue(file_exists(__DIR__ . '/newdirtest/sub/path/test3.txt')); + self::assertTrue(\file_exists(__DIR__ . '/newdirtest/sub/path/test3.txt')); self::assertTrue(Directory::delete($dirTestPath)); self::assertFalse(Directory::exists($dirTestPath)); self::assertTrue(Directory::move(__DIR__ . '/newdirtest', $dirTestPath)); - self::assertTrue(file_exists($dirTestPath . '/sub/path/test3.txt')); + self::assertTrue(\file_exists($dirTestPath . '/sub/path/test3.txt')); self::assertEquals(4, Directory::count($dirTestPath)); self::assertEquals(1, Directory::count($dirTestPath, false)); diff --git a/tests/System/File/Local/FileTest.php b/tests/System/File/Local/FileTest.php index 3f19b827f..4dcbe7e01 100644 --- a/tests/System/File/Local/FileTest.php +++ b/tests/System/File/Local/FileTest.php @@ -69,15 +69,15 @@ class FileTest extends \PHPUnit\Framework\TestCase self::assertFalse(File::exists($newPath2)); self::assertFalse(File::delete($newPath2)); - unlink($newPath); - rmdir(__DIR__ . '/sub/path/'); - rmdir(__DIR__ . '/sub/'); + \unlink($newPath); + \rmdir(__DIR__ . '/sub/path/'); + \rmdir(__DIR__ . '/sub/'); self::assertTrue(File::create($testFile)); self::assertFalse(File::create($testFile)); self::assertEquals('', File::get($testFile)); - unlink($testFile); + \unlink($testFile); } /** diff --git a/tests/System/File/Local/LocalStorageTest.php b/tests/System/File/Local/LocalStorageTest.php index 6d8e33cee..743e066d8 100644 --- a/tests/System/File/Local/LocalStorageTest.php +++ b/tests/System/File/Local/LocalStorageTest.php @@ -69,15 +69,15 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase self::assertFalse(LocalStorage::exists($newPath2)); self::assertFalse(LocalStorage::delete($newPath2)); - unlink($newPath); - rmdir(__DIR__ . '/sub/path/'); - rmdir(__DIR__ . '/sub/'); + \unlink($newPath); + \rmdir(__DIR__ . '/sub/path/'); + \rmdir(__DIR__ . '/sub/'); self::assertTrue(LocalStorage::create($testFile)); self::assertFalse(LocalStorage::create($testFile)); self::assertEquals('', LocalStorage::get($testFile)); - unlink($testFile); + \unlink($testFile); } public function testDirectory() @@ -112,13 +112,13 @@ class LocalStorageTest extends \PHPUnit\Framework\TestCase { $dirTestPath = __DIR__ . '/dirtest'; self::assertTrue(LocalStorage::copy($dirTestPath, __DIR__ . '/newdirtest')); - self::assertTrue(file_exists(__DIR__ . '/newdirtest/sub/path/test3.txt')); + self::assertTrue(\file_exists(__DIR__ . '/newdirtest/sub/path/test3.txt')); self::assertTrue(LocalStorage::delete($dirTestPath)); self::assertFalse(LocalStorage::exists($dirTestPath)); self::assertTrue(LocalStorage::move(__DIR__ . '/newdirtest', $dirTestPath)); - self::assertTrue(file_exists($dirTestPath . '/sub/path/test3.txt')); + self::assertTrue(\file_exists($dirTestPath . '/sub/path/test3.txt')); self::assertEquals(4, LocalStorage::count($dirTestPath)); self::assertEquals(1, LocalStorage::count($dirTestPath, false)); diff --git a/tests/UnhandledHandlerTest.php b/tests/UnhandledHandlerTest.php index cf7797ee1..267c2748d 100644 --- a/tests/UnhandledHandlerTest.php +++ b/tests/UnhandledHandlerTest.php @@ -19,11 +19,11 @@ class UnhandledHandlerTest extends \PHPUnit\Framework\TestCase { public function testErrorHandling() { - set_exception_handler(['\phpOMS\UnhandledHandler', 'exceptionHandler']); - set_error_handler(['\phpOMS\UnhandledHandler', 'errorHandler']); - register_shutdown_function(['\phpOMS\UnhandledHandler', 'shutdownHandler']); + \set_exception_handler(['\phpOMS\UnhandledHandler', 'exceptionHandler']); + \set_error_handler(['\phpOMS\UnhandledHandler', 'errorHandler']); + \register_shutdown_function(['\phpOMS\UnhandledHandler', 'shutdownHandler']); - trigger_error('', E_USER_ERROR); + \trigger_error('', E_USER_ERROR); UnhandledHandler::shutdownHandler(); diff --git a/tests/Utils/Barcode/C128aTest.php b/tests/Utils/Barcode/C128aTest.php index 179bbcc48..087308328 100644 --- a/tests/Utils/Barcode/C128aTest.php +++ b/tests/Utils/Barcode/C128aTest.php @@ -20,13 +20,13 @@ class C128aTest extends \PHPUnit\Framework\TestCase public function testImage() { $path = __DIR__ . '/c128a.png'; - if (file_exists($path)) { - unlink($path); + if (\file_exists($path)) { + \unlink($path); } $img = new C128a('ABCDEFG0123()+-', 200, 50); $img->saveToPngFile($path); - self::assertTrue(file_exists($path)); + self::assertTrue(\file_exists($path)); } } diff --git a/tests/Utils/Barcode/C128bTest.php b/tests/Utils/Barcode/C128bTest.php index 73a710828..a20772d16 100644 --- a/tests/Utils/Barcode/C128bTest.php +++ b/tests/Utils/Barcode/C128bTest.php @@ -20,13 +20,13 @@ class C128bTest extends \PHPUnit\Framework\TestCase public function testImage() { $path = __DIR__ . '/c128b.png'; - if (file_exists($path)) { - unlink($path); + if (\file_exists($path)) { + \unlink($path); } $img = new C128b('ABcdeFG0123+-!@?', 200, 50); $img->saveToPngFile($path); - self::assertTrue(file_exists($path)); + self::assertTrue(\file_exists($path)); } } diff --git a/tests/Utils/Barcode/C128cTest.php b/tests/Utils/Barcode/C128cTest.php index e1b831597..762e9173f 100644 --- a/tests/Utils/Barcode/C128cTest.php +++ b/tests/Utils/Barcode/C128cTest.php @@ -20,13 +20,13 @@ class C128cTest extends \PHPUnit\Framework\TestCase public function testImage() { $path = __DIR__ . '/c128c.png'; - if (file_exists($path)) { - unlink($path); + if (\file_exists($path)) { + \unlink($path); } $img = new C128c('412163', 200, 50); $img->saveToPngFile($path); - self::assertTrue(file_exists($path)); + self::assertTrue(\file_exists($path)); } } diff --git a/tests/Utils/Barcode/C25Test.php b/tests/Utils/Barcode/C25Test.php index b6f639775..74f9d780e 100644 --- a/tests/Utils/Barcode/C25Test.php +++ b/tests/Utils/Barcode/C25Test.php @@ -20,13 +20,13 @@ class C25Test extends \PHPUnit\Framework\TestCase public function testImage() { $path = __DIR__ . '/c25.png'; - if (file_exists($path)) { - unlink($path); + if (\file_exists($path)) { + \unlink($path); } $img = new C25('1234567890', 150, 50); $img->saveToPngFile($path); - self::assertTrue(file_exists($path)); + self::assertTrue(\file_exists($path)); } } diff --git a/tests/Utils/Barcode/C39Test.php b/tests/Utils/Barcode/C39Test.php index 888d70eb4..fffeeacb9 100644 --- a/tests/Utils/Barcode/C39Test.php +++ b/tests/Utils/Barcode/C39Test.php @@ -20,13 +20,13 @@ class C39Test extends \PHPUnit\Framework\TestCase public function testImage() { $path = __DIR__ . '/c39.png'; - if (file_exists($path)) { - unlink($path); + if (\file_exists($path)) { + \unlink($path); } $img = new C39('ABCDEFG0123+-', 150, 50); $img->saveToPngFile($path); - self::assertTrue(file_exists($path)); + self::assertTrue(\file_exists($path)); } } diff --git a/tests/Utils/Barcode/CodebarTest.php b/tests/Utils/Barcode/CodebarTest.php index e02ff5528..57213d258 100644 --- a/tests/Utils/Barcode/CodebarTest.php +++ b/tests/Utils/Barcode/CodebarTest.php @@ -20,13 +20,13 @@ class CodebarTest extends \PHPUnit\Framework\TestCase public function testImage() { $path = __DIR__ . '/codebar.png'; - if (file_exists($path)) { - unlink($path); + if (\file_exists($path)) { + \unlink($path); } $img = new Codebar('412163', 200, 50); $img->saveToPngFile($path); - self::assertTrue(file_exists($path)); + self::assertTrue(\file_exists($path)); } } diff --git a/tests/Utils/Encoding/Huffman/HuffmanTest.php b/tests/Utils/Encoding/Huffman/HuffmanTest.php index 02ddbe160..6e828c521 100644 --- a/tests/Utils/Encoding/Huffman/HuffmanTest.php +++ b/tests/Utils/Encoding/Huffman/HuffmanTest.php @@ -23,7 +23,7 @@ class HuffmanTest extends \PHPUnit\Framework\TestCase $huff = new Huffman(); self::assertEquals( - hex2bin('a42f5debafd35bee6a940f78f38638fb3f4d6fd13cc672cf01d61bb1ce59e03cdbe89e8e56b5d63aa61387d1ba10'), + \hex2bin('a42f5debafd35bee6a940f78f38638fb3f4d6fd13cc672cf01d61bb1ce59e03cdbe89e8e56b5d63aa61387d1ba10'), $huff->encode('This is a test message in order to test the encoding and decoding of the Huffman algorithm.') ); @@ -34,7 +34,7 @@ class HuffmanTest extends \PHPUnit\Framework\TestCase self::assertEquals( 'This is a test message in order to test the encoding and decoding of the Huffman algorithm.', - $man->decode(hex2bin('a42f5debafd35bee6a940f78f38638fb3f4d6fd13cc672cf01d61bb1ce59e03cdbe89e8e56b5d63aa61387d1ba10')) + $man->decode(\hex2bin('a42f5debafd35bee6a940f78f38638fb3f4d6fd13cc672cf01d61bb1ce59e03cdbe89e8e56b5d63aa61387d1ba10')) ); self::assertEquals('', $man->decode('')); diff --git a/tests/Utils/IO/Zip/ZipTest.php b/tests/Utils/IO/Zip/ZipTest.php index 90e2b4a87..d7389e19d 100644 --- a/tests/Utils/IO/Zip/ZipTest.php +++ b/tests/Utils/IO/Zip/ZipTest.php @@ -28,7 +28,7 @@ class ZipTest extends \PHPUnit\Framework\TestCase __DIR__ . '/test.zip' )); - self::assertTrue(file_exists(__DIR__ . '/test.zip')); + self::assertTrue(\file_exists(__DIR__ . '/test.zip')); self::assertFalse(Zip::pack( [ @@ -45,31 +45,31 @@ class ZipTest extends \PHPUnit\Framework\TestCase $d = \file_get_contents(__DIR__ . '/test/test d.txt'); $e = \file_get_contents(__DIR__ . '/test/sub/test e.txt'); - unlink(__DIR__ . '/test a.txt'); - unlink(__DIR__ . '/test b.md'); - unlink(__DIR__ . '/test/test c.txt'); - unlink(__DIR__ . '/test/test d.txt'); - unlink(__DIR__ . '/test/sub/test e.txt'); - rmdir(__DIR__ . '/test/sub'); - rmdir(__DIR__ . '/test'); + \unlink(__DIR__ . '/test a.txt'); + \unlink(__DIR__ . '/test b.md'); + \unlink(__DIR__ . '/test/test c.txt'); + \unlink(__DIR__ . '/test/test d.txt'); + \unlink(__DIR__ . '/test/sub/test e.txt'); + \rmdir(__DIR__ . '/test/sub'); + \rmdir(__DIR__ . '/test'); - self::assertFalse(file_exists(__DIR__ . '/test a.txt')); - self::assertFalse(file_exists(__DIR__ . '/test b.md')); - self::assertFalse(file_exists(__DIR__ . '/test/test c.txt')); - self::assertFalse(file_exists(__DIR__ . '/test/test d.txt')); - self::assertFalse(file_exists(__DIR__ . '/test/sub/test e.txt')); - self::assertFalse(file_exists(__DIR__ . '/test/sub')); - self::assertFalse(file_exists(__DIR__ . '/test')); + self::assertFalse(\file_exists(__DIR__ . '/test a.txt')); + self::assertFalse(\file_exists(__DIR__ . '/test b.md')); + self::assertFalse(\file_exists(__DIR__ . '/test/test c.txt')); + self::assertFalse(\file_exists(__DIR__ . '/test/test d.txt')); + self::assertFalse(\file_exists(__DIR__ . '/test/sub/test e.txt')); + self::assertFalse(\file_exists(__DIR__ . '/test/sub')); + self::assertFalse(\file_exists(__DIR__ . '/test')); self::assertTrue(Zip::unpack(__DIR__ . '/test.zip', __DIR__)); - self::assertTrue(file_exists(__DIR__ . '/test a.txt')); - self::assertTrue(file_exists(__DIR__ . '/test b.md')); - self::assertTrue(file_exists(__DIR__ . '/test/test c.txt')); - self::assertTrue(file_exists(__DIR__ . '/test/test d.txt')); - self::assertTrue(file_exists(__DIR__ . '/test/sub/test e.txt')); - self::assertTrue(file_exists(__DIR__ . '/test/sub')); - self::assertTrue(file_exists(__DIR__ . '/test')); + self::assertTrue(\file_exists(__DIR__ . '/test a.txt')); + self::assertTrue(\file_exists(__DIR__ . '/test b.md')); + self::assertTrue(\file_exists(__DIR__ . '/test/test c.txt')); + self::assertTrue(\file_exists(__DIR__ . '/test/test d.txt')); + self::assertTrue(\file_exists(__DIR__ . '/test/sub/test e.txt')); + self::assertTrue(\file_exists(__DIR__ . '/test/sub')); + self::assertTrue(\file_exists(__DIR__ . '/test')); self::assertEquals($a, \file_get_contents(__DIR__ . '/test a.txt')); self::assertEquals($b, \file_get_contents(__DIR__ . '/test b.md')); @@ -77,8 +77,8 @@ class ZipTest extends \PHPUnit\Framework\TestCase self::assertEquals($d, \file_get_contents(__DIR__ . '/test/test d.txt')); self::assertEquals($e, \file_get_contents(__DIR__ . '/test/sub/test e.txt')); - unlink(__DIR__ . '/test.zip'); - self::assertFalse(file_exists(__DIR__ . '/test.zip')); + \unlink(__DIR__ . '/test.zip'); + self::assertFalse(\file_exists(__DIR__ . '/test.zip')); self::assertFalse(Zip::unpack(__DIR__ . '/test.zip', __DIR__)); } }