![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/rector/rector/vendor/rector/extension-installer/src/ |
<?php declare (strict_types=1); namespace Rector\RectorInstaller; use UnexpectedValueException; final class LocalFilesystem implements \Rector\RectorInstaller\Filesystem { public function isFile(string $pathToFile) : bool { return \is_file($pathToFile); } public function hashFile(string $pathToFile) : string { $fileHash = \md5_file($pathToFile); if ($fileHash === \false) { throw new UnexpectedValueException(\sprintf('Could not hash file %s', $pathToFile)); } return $fileHash; } public function writeFile(string $pathToFile, string $contents) : void { $bytes = \file_put_contents($pathToFile, $contents); if ($bytes === \false) { throw new UnexpectedValueException(\sprintf('Could not write contents to file %s', $pathToFile)); } } public function hashEquals(string $hash, string $content) : bool { return $hash === \md5($content); } }