mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Fix path check
This commit is contained in:
parent
36ae2f3ea4
commit
54a41f6874
|
|
@ -165,6 +165,10 @@ class File extends FileAbstract implements FileInterface
|
|||
*/
|
||||
public static function created(string $path) : \DateTime
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
throw new PathException($path);
|
||||
}
|
||||
|
||||
return self::createFileTime($path, filemtime($path));
|
||||
}
|
||||
|
||||
|
|
@ -173,15 +177,15 @@ class File extends FileAbstract implements FileInterface
|
|||
*/
|
||||
public static function changed(string $path) : \DateTime
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
throw new PathException($path);
|
||||
}
|
||||
|
||||
return self::createFileTime($path, filectime($path));
|
||||
}
|
||||
|
||||
private static function createFileTime(string $path, int $time)
|
||||
{
|
||||
if (!file_exists($path)) {
|
||||
throw new PathException($path);
|
||||
}
|
||||
|
||||
$fileTime = new \DateTime();
|
||||
$fileTime->setTimestamp($time);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user