diff --git a/src/AbstractDirectory.php b/src/AbstractDirectory.php index 37fb09d..c7704ed 100644 --- a/src/AbstractDirectory.php +++ b/src/AbstractDirectory.php @@ -13,10 +13,10 @@ abstract class AbstractDirectory extends NestedObject protected const ALREADY_EXISTS_MESSAGE = 'A directory or file named "%s" already exists.'; /**@var AbstractDirectory[] */ - protected $directories = []; + protected array $directories = []; /**@var AbstractFile[] */ - protected $files = []; + protected array $files = []; /** * @return AbstractDirectory[] @@ -85,8 +85,10 @@ protected function isOneOfTheParents(?AbstractDirectory $parent = null, Abstract /** * @param AbstractDirectory $directory + * @return void + * @throws TreeException */ - public function removeDirectory(AbstractDirectory $directory) + public function removeDirectory(AbstractDirectory $directory): void { $name = $directory->getLocalName(); if (!array_key_exists($name, $this->directories)) { @@ -99,6 +101,7 @@ public function removeDirectory(AbstractDirectory $directory) /** * @param string $name * @return AbstractDirectory + * @throws NotFoundException */ public function getDirectoryBy(string $name): AbstractDirectory { @@ -108,6 +111,10 @@ public function getDirectoryBy(string $name): AbstractDirectory return $this->directories[$name]; } + /** + * @return void + * @throws TreeException + */ public function removeFromParent(): void { if (empty($this->parent)) { @@ -141,7 +148,11 @@ public function getFiles(): array return $this->files; } - + /** + * @param string $name + * @return AbstractFile + * @throws NotFoundException + */ public function getFileBy(string $name): AbstractFile { if (!array_key_exists($name, $this->files)) { @@ -152,6 +163,8 @@ public function getFileBy(string $name): AbstractFile /** * @param AbstractFile $file + * @return void + * @throws AlreadyExistException */ public function addFile(AbstractFile $file): void { @@ -169,8 +182,10 @@ public function addFile(AbstractFile $file): void /** * @param AbstractFile $file + * @return void + * @throws TreeException */ - public function removeFile(AbstractFile $file) + public function removeFile(AbstractFile $file): void { $name = $file->getLocalName(); if (!array_key_exists($name, $this->files)) { @@ -182,6 +197,7 @@ public function removeFile(AbstractFile $file) /** * @param string|null $name + * @throws TreeException */ public function setLocalName(?string $name = null): void { @@ -201,6 +217,7 @@ public function setLocalName(?string $name = null): void /** * @param string $oldName + * @return void * @throws TreeException */ public function updateDirectoryName(string $oldName): void @@ -225,6 +242,7 @@ public function updateDirectoryName(string $oldName): void /** * @param string $oldName + * @return void * @throws TreeException */ public function updateFileName(string $oldName): void diff --git a/src/AbstractFile.php b/src/AbstractFile.php index edb2214..ea3db2c 100644 --- a/src/AbstractFile.php +++ b/src/AbstractFile.php @@ -7,8 +7,9 @@ abstract class AbstractFile extends NestedObject { + /** - * + * @return void */ public function removeFromParent(): void { @@ -45,12 +46,12 @@ public function isChild(): bool } /** - * + * @return void */ abstract public function write(): void; /** - * + * @return void */ public function delete(): void { @@ -59,7 +60,7 @@ public function delete(): void } /** - * + * @return void */ abstract protected function removeSelf(): void; @@ -75,7 +76,7 @@ public function getExtension(): string * @param string $name * @return false|string */ - private function getExtensionImpl(string $name) + private function getExtensionImpl(string $name): false|string { $n = strrpos($name, "."); return ($n === false) ? "" : substr($name, $n + 1); @@ -88,4 +89,5 @@ public function getSourceExtension(): string { return $this->getExtensionImpl((string)$this->pathObject->getLast()); } + } \ No newline at end of file diff --git a/src/AbstractFilesystemFunctionality.php b/src/AbstractFilesystemFunctionality.php index 14285fc..96bd6bf 100644 --- a/src/AbstractFilesystemFunctionality.php +++ b/src/AbstractFilesystemFunctionality.php @@ -8,6 +8,7 @@ abstract class AbstractFilesystemFunctionality extends AbstractFunctionality { + /** * @param SupportedFunctionalities $component * @param string $methodName @@ -25,4 +26,5 @@ protected function revokeMethod(SupportedFunctionalities $component, string $met { FileFunctionalitiesContext::getFunctionalitySupport($component)->uninstallMethod($methodName); } + } \ No newline at end of file diff --git a/src/AbstractFilesystemObject.php b/src/AbstractFilesystemObject.php index 4e71e72..f4f32d8 100644 --- a/src/AbstractFilesystemObject.php +++ b/src/AbstractFilesystemObject.php @@ -12,7 +12,7 @@ abstract class AbstractFilesystemObject implements SupportedFunctionalities /** * @param Functionality $functionality */ - protected function addFunctionality(Functionality $functionality) + protected function addFunctionality(Functionality $functionality): void { $functionality->install($this); } @@ -20,7 +20,7 @@ protected function addFunctionality(Functionality $functionality) /** * @param Functionality $functionality */ - protected function removeFunctionality(Functionality $functionality) + protected function removeFunctionality(Functionality $functionality): void { $functionality->uninstall($this); } @@ -30,13 +30,13 @@ protected function removeFunctionality(Functionality $functionality) * @param $args * @return mixed */ - public function __call($method, $args) + public function __call($method, $args): mixed { return FileFunctionalitiesContext::getFunctionalitySupport($this)->fireCallMethodEvent($this, $method, $args); } /** - * + * @return void */ public function revokeAllSupports(): void { @@ -53,15 +53,16 @@ public function equals(AbstractFilesystemObject $filesystemObject): bool } /** - * @param $data + * @param mixed $data + * @return void */ - abstract protected function setData($data): void; + abstract protected function setData(mixed $data): void; /** - * @param $data - * @return AbstractFilesystemObject + * @param mixed $data + * @return $this */ - public function cloneWithData($data): AbstractFilesystemObject + public function cloneWithData(mixed $data): AbstractFilesystemObject { $support = FileFunctionalitiesContext::getFunctionalitySupport($this); $copyStorage = $support->copyStorage(); diff --git a/src/DefaultFilesystem.php b/src/DefaultFilesystem.php index d88ff1e..9b3bc60 100644 --- a/src/DefaultFilesystem.php +++ b/src/DefaultFilesystem.php @@ -8,6 +8,7 @@ class DefaultFilesystem implements FileSystem { + /** * @param string $path * @return string @@ -138,4 +139,5 @@ public function yamlParseFile($filename, $pos = 0, &$ndocs = null, array $callba } return $result; } + } \ No newline at end of file diff --git a/src/Directory.php b/src/Directory.php index 1d67736..d490053 100644 --- a/src/Directory.php +++ b/src/Directory.php @@ -11,8 +11,7 @@ class Directory extends AbstractDirectory { - /** @var bool */ - protected $synchronized = false; + protected bool $synchronized = false; /** * @param string $name @@ -152,7 +151,7 @@ public function getSourcePath(): string } /** - * + * @return void */ public function delete(): void { @@ -163,6 +162,9 @@ public function delete(): void $this->removeAllDirectories(); } + /** + * @return void + */ protected function removeAllDirectories(): void { if (!empty($this->parent)) { @@ -178,7 +180,7 @@ protected function removeAllDirectories(): void /** * @param string $path */ - public function move(string $path) + public function move(string $path): void { $deletePaths = $this->getPathsAllDirectories(); $this->moveAll($path); @@ -220,6 +222,9 @@ protected function moveAll(string $path): void } } + /** + * @return void + */ protected function deleteAllFiles(): void { /** @var File $file */ @@ -288,7 +293,10 @@ protected function getFilesPaths(): array return $result; } - protected function initBindWithFilesystem() + /** + * @return void + */ + protected function initBindWithFilesystem(): void { FileFunctionalitiesContext::getFunctionalitySupport($this) ->fireCallMethodEvent($this, 'assertInitBind', [ @@ -314,7 +322,7 @@ protected function setBindedFlag(bool $value): void } /** - * + * @return void */ public function revokeAllSupports(): void { @@ -325,4 +333,5 @@ public function revokeAllSupports(): void $this->pathObject = null; $this->synchronized = false; } + } \ No newline at end of file diff --git a/src/File.php b/src/File.php index 7d8d4a3..887aa68 100644 --- a/src/File.php +++ b/src/File.php @@ -9,19 +9,16 @@ class File extends AbstractFile { + const WRITE = 'WRITE'; const COPY = 'COPY'; const MOVE = 'MOVE'; const WRITE_TO = 'WRITE_TO'; - /** @var mixed */ - protected $content; - - /** @var bool */ - protected $synchronized = false; - + protected mixed $content = null; + protected bool $synchronized = false; /** @var FileBeforeWriteListener[] */ - protected $listeners = []; + protected array $listeners = []; /** * @param string $name @@ -112,7 +109,7 @@ public function copy(string $path): void /** * @param string $path */ - public function move(string $path) + public function move(string $path): void { $resultPath = $path . $this->getLocalPath($this->pathObject->getSeparator()); if (!$this->isBinded()) { @@ -133,7 +130,10 @@ public function move(string $path) $this->setBindedFlag(true); } - protected function initBindWithFilesystem() + /** + * @return void + */ + protected function initBindWithFilesystem(): void { FileFunctionalitiesContext::getFunctionalitySupport($this) ->fireCallMethodEvent($this, 'assertInitBind', [ @@ -152,6 +152,7 @@ public function isBinded(): bool /** * @param bool $value + * @return void */ protected function setBindedFlag(bool $value): void { @@ -175,9 +176,10 @@ public function getPath(): Path } /** - * @param $content + * @param mixed $content + * @return void */ - public function setContent($content): void + public function setContent(mixed $content): void { $this->content = $content; } @@ -185,7 +187,7 @@ public function setContent($content): void /** * @return mixed */ - public function getContent() + public function getContent(): mixed { return $this->content; } @@ -216,7 +218,7 @@ public function writeTo(string $directoryPath): void } /** - * + * @return void */ public function read(): void { @@ -252,7 +254,7 @@ protected function removeSelf(): void /** * @param string $keyOperation */ - public function fireBeforeWriteEvent(string $keyOperation) + public function fireBeforeWriteEvent(string $keyOperation): void { foreach ($this->listeners as $listener) { $listener->beforeWrite($this, $keyOperation); @@ -291,7 +293,7 @@ public function getFileBeforeWriteListener(): array } /** - * + * @return void */ public function clearFileBeforeWriteListener(): void { @@ -310,4 +312,5 @@ public function revokeAllSupports(): void $this->parent = null; $this->pathObject = null; } + } \ No newline at end of file diff --git a/src/FileFunctionalities.php b/src/FileFunctionalities.php index f2b8721..68dfa10 100644 --- a/src/FileFunctionalities.php +++ b/src/FileFunctionalities.php @@ -10,8 +10,8 @@ class FileFunctionalities extends FunctionalitySupport { - /** @var \Vinograd\IO\Filesystem */ - protected $filesystem; + + protected Filesystem $filesystem; /** * @param Filesystem $filesystem @@ -22,7 +22,7 @@ public function __construct(Filesystem $filesystem) } /** - * @return \Vinograd\IO\Filesystem + * @return Filesystem */ public function getFilesystem(): Filesystem { @@ -30,7 +30,8 @@ public function getFilesystem(): Filesystem } /** - * @param \Vinograd\IO\Filesystem $filesystem + * @param Filesystem $filesystem + * @return void */ public function setFilesystem(Filesystem $filesystem): void { @@ -42,8 +43,9 @@ public function setFilesystem(Filesystem $filesystem): void * @param string $methodName * @param $arguments * @return mixed + * @throws BadMethodCallException */ - public function fireCallMethodEvent($source, string $methodName, $arguments) + public function fireCallMethodEvent($source, string $methodName, $arguments): mixed { if (!isset($this->storage[$methodName])) { throw new BadMethodCallException('Calling unknown method ' . get_class($source) . '::' . $methodName . '(...))'); @@ -53,4 +55,5 @@ public function fireCallMethodEvent($source, string $methodName, $arguments) $support = $this->storage[$methodName]; return $support->methodCalled($evt, $this->filesystem); } + } \ No newline at end of file diff --git a/src/FileFunctionalitiesContext.php b/src/FileFunctionalitiesContext.php index a37dd32..8ad8bcc 100644 --- a/src/FileFunctionalitiesContext.php +++ b/src/FileFunctionalitiesContext.php @@ -13,26 +13,18 @@ class FileFunctionalitiesContext extends ContextFunctionalitySupport { - /** @var FunctionalitySupport|null */ - protected static $globalDirectorySupport = null; - - /** @var FunctionalitySupport|null */ - protected static $globalFileSupport = null; - - /** @var Filesystem|null */ - protected static $filesystem = null; - - /** @var ProxyFilesystem|null */ - protected static $filesystemForGroups = null; - - /** @var ProxyFilesystem|null */ - protected static $filesystemForGlobal = null; + protected static FunctionalitySupport|null $globalDirectorySupport = null; + protected static FunctionalitySupport|null $globalFileSupport = null; + protected static Filesystem|null $filesystem = null; + protected static ProxyFilesystem|null $filesystemForGroups = null; + protected static ProxyFilesystem|null $filesystemForGlobal = null; /** * @param Functionality $support * @param string $methodName + * @return void */ - public static function registerGlobalFunctionalityForDirectories(Functionality $support, string $methodName) + public static function registerGlobalFunctionalityForDirectories(Functionality $support, string $methodName): void { if (self::$globalDirectorySupport === null) { self::$globalDirectorySupport = static::createGlobalFunctionalitySupport(); @@ -42,8 +34,9 @@ public static function registerGlobalFunctionalityForDirectories(Functionality $ /** * @param string $methodName + * @return void */ - public static function unregisterGlobalFunctionalityForDirectories(string $methodName) + public static function unregisterGlobalFunctionalityForDirectories(string $methodName): void { if (self::$globalDirectorySupport === null) { throw new LogicException($methodName . '(...))' . ' - method has not been registered.'); @@ -69,7 +62,7 @@ public static function hasGlobalFunctionalityForDirectories(string $methodName): * @param array $arguments * @return mixed */ - public static function fireGlobalDirectoryMethod($source, string $methodName, array $arguments) + public static function fireGlobalDirectoryMethod($source, string $methodName, array $arguments): mixed { if (self::$globalDirectorySupport === null) { throw new BadMethodCallException('Calling unknown method ' . get_class($source) . '::' . $methodName . '(...))'); @@ -80,8 +73,9 @@ public static function fireGlobalDirectoryMethod($source, string $methodName, ar /** * @param Functionality $support * @param string $methodName + * @return void */ - public static function registerGlobalFunctionalityForFiles(Functionality $support, string $methodName) + public static function registerGlobalFunctionalityForFiles(Functionality $support, string $methodName): void { if (self::$globalFileSupport === null) { self::$globalFileSupport = static::createGlobalFunctionalitySupport(); @@ -91,8 +85,9 @@ public static function registerGlobalFunctionalityForFiles(Functionality $suppor /** * @param string $methodName + * @return void */ - public static function unregisterGlobalFunctionalityForFiles(string $methodName) + public static function unregisterGlobalFunctionalityForFiles(string $methodName): void { if (self::$globalFileSupport === null) { throw new LogicException($methodName . '(...))' . ' - method has not been registered.'); @@ -118,7 +113,7 @@ public static function hasGlobalFunctionalityForFiles(string $methodName): bool * @param array $arguments * @return mixed */ - public static function fireGlobalFileMethod($source, string $methodName, array $arguments) + public static function fireGlobalFileMethod($source, string $methodName, array $arguments): mixed { if (static::$globalFileSupport === null) { throw new BadMethodCallException('Calling unknown method ' . get_class($source) . '::' . $methodName . '(...))'); @@ -185,14 +180,18 @@ protected static function getFilesystemForGroups(): ProxyFilesystem /** * @param Filesystem $filesystem + * @return void */ - public static function setFilesystem(Filesystem $filesystem) + public static function setFilesystem(Filesystem $filesystem): void { static::getFilesystemForGlobal()->setFilesystem($filesystem); static::getFilesystemForGroups()->setFilesystem($filesystem); static::$filesystem = $filesystem; } + /** + * @return void + */ public static function reset(): void { static::$functionalitySupports = null; @@ -203,4 +202,5 @@ public static function reset(): void static::$filesystemForGroups = null; static::$filesystemForGlobal = null; } + } \ No newline at end of file diff --git a/src/FilesystemObject.php b/src/FilesystemObject.php index c221b38..71dd993 100644 --- a/src/FilesystemObject.php +++ b/src/FilesystemObject.php @@ -7,8 +7,8 @@ class FilesystemObject extends AbstractFilesystemObject { - /**@var Path */ - protected $pathObject; + + protected Path|null $pathObject = null; public function __construct(string $path) { @@ -17,7 +17,7 @@ public function __construct(string $path) } /** - * + * @return void */ protected function initFunctionalities(): void { @@ -25,26 +25,26 @@ protected function initFunctionalities(): void } /** - * @return Path + * @return Path|null */ - public function getPath(): Path + public function getPath(): ?Path { return $this->pathObject; } /** * @param Path $path + * @return void */ - protected function setPath(Path $path) + protected function setPath(Path $path): void { $this->pathObject = $path; } /** - * - * @param $data + * @inheritDoc */ - protected function setData($data): void + protected function setData(mixed $data): void { try { $this->setPath(new Path($data)); @@ -54,4 +54,5 @@ protected function setData($data): void ); } } + } \ No newline at end of file diff --git a/src/Functionality/DirectoryFunctionality.php b/src/Functionality/DirectoryFunctionality.php index ddc21ad..5e92108 100644 --- a/src/Functionality/DirectoryFunctionality.php +++ b/src/Functionality/DirectoryFunctionality.php @@ -13,8 +13,8 @@ class DirectoryFunctionality extends AbstractFilesystemFunctionality { - /** @var DirectoryFunctionality|null */ - private static $self = null; + + private static DirectoryFunctionality|null $self = null; /** * @inheritDoc @@ -55,7 +55,7 @@ protected function checkArguments($method, $arguments): bool return true; } } - //delete + if (count($arguments) !== 1) { return false; } @@ -66,8 +66,10 @@ protected function checkArguments($method, $arguments): bool * @param Directory $directory * @param Filesystem $filesystem * @param string $path + * @return void + * @throws NotFoundException */ - public function assertInitBind(Directory $directory, Filesystem $filesystem, string $path) + public function assertInitBind(Directory $directory, Filesystem $filesystem, string $path): void { try { $filesystem->getAbsolutePath($path); @@ -80,6 +82,7 @@ public function assertInitBind(Directory $directory, Filesystem $filesystem, str * @param Directory $directory * @param Filesystem $filesystem * @param string $path + * @return void * @throws IOException */ public function sync(Directory $directory, Filesystem $filesystem, string $path): void @@ -93,6 +96,8 @@ public function sync(Directory $directory, Filesystem $filesystem, string $path) * @param Directory $directory * @param Filesystem $filesystem * @param string $path + * @return void + * @throws IOException */ protected function createDirectory(Directory $directory, Filesystem $filesystem, string $path): void { @@ -103,6 +108,8 @@ protected function createDirectory(Directory $directory, Filesystem $filesystem, * @param Directory $directory * @param Filesystem $filesystem * @param string $path + * @return void + * @throws IOException */ public function copy(Directory $directory, Filesystem $filesystem, string $path): void { @@ -114,9 +121,11 @@ public function copy(Directory $directory, Filesystem $filesystem, string $path) /** * @param Directory $directory * @param Filesystem $filesystem - * @param string[] $deletePaths + * @param array $deletePaths + * @return void + * @throws IOException */ - public function delete(Directory $directory, Filesystem $filesystem, array $deletePaths) + public function delete(Directory $directory, Filesystem $filesystem, array $deletePaths): void { arsort($deletePaths); foreach ($deletePaths as $path) { diff --git a/src/Functionality/FileFunctionality.php b/src/Functionality/FileFunctionality.php index 8910a19..4aad6a5 100644 --- a/src/Functionality/FileFunctionality.php +++ b/src/Functionality/FileFunctionality.php @@ -6,17 +6,17 @@ use Vinograd\IO\Exception\IOException; use Vinograd\IO\Exception\NotFoundException; use Vinograd\IO\Filesystem; -use Compass\Exception\InvalidPathException; use Vinograd\SimpleFiles\AbstractFile; use Vinograd\SimpleFiles\AbstractFilesystemFunctionality; use Vinograd\SimpleFiles\File; use Vinograd\Support\SupportedFunctionalities; use Vinograd\Support\Functionality; +use Compass\Exception\InvalidPathException; class FileFunctionality extends AbstractFilesystemFunctionality { - private static $self = null; + private static Functionality|null $self = null; /** * @inheritDoc @@ -34,6 +34,7 @@ protected function installMethods(SupportedFunctionalities $component): void /** * @param SupportedFunctionalities $component + * @return void */ protected function uninstallMethods(SupportedFunctionalities $component): void { @@ -63,7 +64,6 @@ protected function checkArguments($method, $arguments): bool return true; } } - //remove return empty($arguments); } @@ -71,8 +71,10 @@ protected function checkArguments($method, $arguments): bool * @param File $file * @param Filesystem $filesystem * @param string $path + * @return void + * @throws NotFoundException */ - public function assertInitBind(File $file, Filesystem $filesystem, string $path) + public function assertInitBind(File $file, Filesystem $filesystem, string $path): void { try { $filesystem->getAbsolutePath($path); @@ -85,6 +87,7 @@ public function assertInitBind(File $file, Filesystem $filesystem, string $path) * @param File $file * @param Filesystem $filesystem * @param string $path + * @return void * @throws IOException */ public function sync(File $file, Filesystem $filesystem, string $path): void @@ -98,6 +101,7 @@ public function sync(File $file, Filesystem $filesystem, string $path): void * @param File $file * @param Filesystem $filesystem * @param string $path + * @return void * @throws IOException */ public function copy(File $file, Filesystem $filesystem, string $path): void @@ -109,9 +113,10 @@ public function copy(File $file, Filesystem $filesystem, string $path): void * @param File $file * @param Filesystem $filesystem * @param string $path + * @return void * @throws IOException */ - public function move(File $file, Filesystem $filesystem, string $path) + public function move(File $file, Filesystem $filesystem, string $path): void { $this->copyOrMove($file, $filesystem, $path, File::MOVE); } @@ -121,9 +126,10 @@ public function move(File $file, Filesystem $filesystem, string $path) * @param Filesystem $filesystem * @param string $path * @param string $keyOperation + * @return void * @throws IOException */ - protected function copyOrMove(File $file, Filesystem $filesystem, string $path, string $keyOperation) + protected function copyOrMove(File $file, Filesystem $filesystem, string $path, string $keyOperation): void { $this->read($file, $filesystem, $file->getSourcePath()); $file->fireBeforeWriteEvent($keyOperation); @@ -134,6 +140,7 @@ protected function copyOrMove(File $file, Filesystem $filesystem, string $path, * @param File $file * @param Filesystem $filesystem * @param string $path + * @return void */ protected function createFile(File $file, Filesystem $filesystem, string $path): void { @@ -144,8 +151,10 @@ protected function createFile(File $file, Filesystem $filesystem, string $path): * @param File $file * @param Filesystem $filesystem * @param string $path + * @return void + * @throws NotFoundException */ - public function read(File $file, Filesystem $filesystem, string $path) + public function read(File $file, Filesystem $filesystem, string $path): void { if ($filesystem->exists($path)) { $file->setContent($filesystem->fileGetContents($path)); @@ -158,8 +167,10 @@ public function read(File $file, Filesystem $filesystem, string $path) * @param AbstractFile $file * @param Filesystem $filesystem * @param string $writePath + * @return void + * @throws InvalidPathException */ - public function write(AbstractFile $file, Filesystem $filesystem, string $writePath) + public function write(AbstractFile $file, Filesystem $filesystem, string $writePath): void { $dir = dirname($writePath); if (!$filesystem->isDirectory($dir)) { @@ -171,6 +182,8 @@ public function write(AbstractFile $file, Filesystem $filesystem, string $writeP /** * @param AbstractFile $file * @param Filesystem $filesystem + * @return void + * @throws NotFoundException */ public function remove(AbstractFile $file, Filesystem $filesystem) { diff --git a/src/GetExtensionTrait.php b/src/GetExtensionTrait.php index 2210fbb..9bae9ad 100644 --- a/src/GetExtensionTrait.php +++ b/src/GetExtensionTrait.php @@ -5,6 +5,7 @@ trait GetExtensionTrait { + /** * @return string */ @@ -14,4 +15,5 @@ public function getExtension(): string $n = strrpos($name, "."); return ($n === false) ? "" : substr($name, $n + 1); } + } \ No newline at end of file diff --git a/src/NestedObject.php b/src/NestedObject.php index ffb8d97..186d41f 100644 --- a/src/NestedObject.php +++ b/src/NestedObject.php @@ -5,11 +5,9 @@ class NestedObject extends FilesystemObject { - /**@var NestedObject */ - protected $parent; - /** @var null|string */ - protected $localName = null; + protected NestedObject|null $parent = null; + protected null|string $localName = null; /** * @param NestedObject|null $parent diff --git a/src/ProxyFilesystem.php b/src/ProxyFilesystem.php index 8c1f498..0e4e350 100644 --- a/src/ProxyFilesystem.php +++ b/src/ProxyFilesystem.php @@ -9,8 +9,8 @@ class ProxyFilesystem implements Filesystem { - /** @var Filesystem */ - protected $filesystem; + + protected Filesystem $filesystem; /** * @param Filesystem $filesystem @@ -157,4 +157,5 @@ public function __call($method, $args) } throw new BadMethodCallException('Calling unknown method ' . get_class($this->filesystem) . '::' . $method . '(...))'); } + } \ No newline at end of file