From 1b26544a646ace99f089479e3b59c6ca8a0f2fe1 Mon Sep 17 00:00:00 2001 From: Fabian Grutschus Date: Fri, 10 Feb 2023 11:42:05 +0100 Subject: [PATCH] Fixed two type errors --- src/Cli/Console/Application.php | 12 ++++-------- src/Generator/RecursiveParentExceptionResolver.php | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Cli/Console/Application.php b/src/Cli/Console/Application.php index d0109e2..aaf8320 100644 --- a/src/Cli/Console/Application.php +++ b/src/Cli/Console/Application.php @@ -16,7 +16,7 @@ final class Application extends ConsoleApplication /** * Home directory. */ - protected string $home; + protected ?string $home = null; /** * {@inheritDoc} @@ -49,10 +49,8 @@ public function getDefinition(): InputDefinition /** * Get path to home directory. - * - * @return string */ - public function getHome() + public function getHome(): string { if (null === $this->home) { $this->home = getenv('HOME'); @@ -63,11 +61,9 @@ public function getHome() /** * Set path to home directory. - * - * @param string $home */ - public function setHome($home) + public function setHome(string $home): void { - $this->home = (string) $home; + $this->home = $home; } } diff --git a/src/Generator/RecursiveParentExceptionResolver.php b/src/Generator/RecursiveParentExceptionResolver.php index 57003eb..cec75ea 100644 --- a/src/Generator/RecursiveParentExceptionResolver.php +++ b/src/Generator/RecursiveParentExceptionResolver.php @@ -41,7 +41,7 @@ private function registerDefaultListeners(): void /** * Returns an array containing arrays with parent exception folder and its namespace */ - public function resolveExceptionDirs(string $path): array + public function resolveExceptionDirs(string $path): ?array { $exceptionDirArray = null; $eventDispatcher = $this->eventDispatcher;