From a210709d3aec8b0093e6e0893376c6f10898a2fc Mon Sep 17 00:00:00 2001 From: Matronator <5470780+matronator@users.noreply.github.com> Date: Thu, 20 Apr 2023 23:42:01 +0200 Subject: [PATCH] remove mixed types --- src/Mtrgen/Cli/BaseGeneratorCommand.php | 6 +++--- src/Mtrgen/Cli/PublishTemplateCommand.php | 4 ++-- src/Mtrgen/Registry/Connection.php | 2 +- src/Mtrgen/Registry/Profile.php | 2 +- src/Mtrgen/Store/Storage.php | 2 +- src/Mtrgen/Template/Generator.php | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Mtrgen/Cli/BaseGeneratorCommand.php b/src/Mtrgen/Cli/BaseGeneratorCommand.php index 64da56e..9105730 100644 --- a/src/Mtrgen/Cli/BaseGeneratorCommand.php +++ b/src/Mtrgen/Cli/BaseGeneratorCommand.php @@ -42,7 +42,7 @@ public function execute(InputInterface $inputInterface, OutputInterface $outputI $this->io = new SymfonyStyle($this->input, $this->output); } - protected function askName(mixed $helper): ?string + protected function askName($helper): ?string { $templates = $this->storage->listAll(); $choices = []; @@ -64,7 +64,7 @@ protected function askName(mixed $helper): ?string return null; } - protected function askPath(mixed $helper): string + protected function askPath($helper): string { $this->io->newLine(); $pathQuestion = new Question('Enter the path to your template file: '); @@ -106,7 +106,7 @@ protected function getTemplate(string $path): ?string return $file->fread($file->getSize()); } - protected function askArguments(mixed $helper, ?string $path = null, ?string $identifier = null, mixed $template = null, ?string $contents = null): array + protected function askArguments($helper, ?string $path = null, ?string $identifier = null, $template = null, ?string $contents = null): array { if ($identifier) { if (!$template) $template = $this->connection->getTemplate($identifier); diff --git a/src/Mtrgen/Cli/PublishTemplateCommand.php b/src/Mtrgen/Cli/PublishTemplateCommand.php index 8f22d74..0ae769f 100644 --- a/src/Mtrgen/Cli/PublishTemplateCommand.php +++ b/src/Mtrgen/Cli/PublishTemplateCommand.php @@ -78,12 +78,12 @@ public function execute(InputInterface $input, OutputInterface $output): int } /** - * @param mixed $response + * @param $response * @param OutputInterface $output * @param string $name * @return integer */ - private function checkResponse(mixed $response, OutputInterface $output, string $message): int + private function checkResponse($response, OutputInterface $output, string $message): int { if (is_string($response)) { $this->io->text($response); diff --git a/src/Mtrgen/Registry/Connection.php b/src/Mtrgen/Registry/Connection.php index f0b5878..5b45e98 100644 --- a/src/Mtrgen/Registry/Connection.php +++ b/src/Mtrgen/Registry/Connection.php @@ -136,7 +136,7 @@ public function getTemplateFromBundle(string $identifier, string $templateName): ]; } - public function postTemplate(string $path, ?OutputInterface $io = null): mixed + public function postTemplate(string $path, ?OutputInterface $io = null) { $profile = new Profile; if (!$profile->authenticate()) diff --git a/src/Mtrgen/Registry/Profile.php b/src/Mtrgen/Registry/Profile.php index 9be8873..343535b 100644 --- a/src/Mtrgen/Registry/Profile.php +++ b/src/Mtrgen/Registry/Profile.php @@ -30,7 +30,7 @@ public function createProfile() return $this->saveProfile($profile); } - public function saveProfile(object $profile): mixed + public function saveProfile(object $profile) { return file_put_contents(Path::safe($this->profile), json_encode($profile)); } diff --git a/src/Mtrgen/Store/Storage.php b/src/Mtrgen/Store/Storage.php index df329c2..e69c9c8 100644 --- a/src/Mtrgen/Store/Storage.php +++ b/src/Mtrgen/Store/Storage.php @@ -110,7 +110,7 @@ public static function getBasename(string $path): string return basename($filename); } - public function download(string $identifier, string $filename, string $content): mixed + public function download(string $identifier, string $filename, string $content) { $this->saveEntry($identifier, $filename); return file_put_contents(Path::canonicalize($this->templateDir . DIRECTORY_SEPARATOR . $filename), $content); diff --git a/src/Mtrgen/Template/Generator.php b/src/Mtrgen/Template/Generator.php index f2a45e9..b463d53 100644 --- a/src/Mtrgen/Template/Generator.php +++ b/src/Mtrgen/Template/Generator.php @@ -83,7 +83,7 @@ public static function generate(object $body, array $args): PhpFile * @param array $args * @param PhpFile|PhpNamespace|null $parent */ - private static function class(object $object, array $args, mixed &$parent = null): ClassType + private static function class(object $object, array $args, &$parent = null): ClassType { $class = !$parent ? new ClassType(Parser::parseString($object->name, $args)) : $parent->addClass(Parser::parseString($object->name, $args)); @@ -96,7 +96,7 @@ private static function class(object $object, array $args, mixed &$parent = null * @param array $args * @param PhpFile|PhpNamespace|null $parent */ - private static function interface(object $object, array $args, mixed &$parent = null): ClassType + private static function interface(object $object, array $args, &$parent = null): ClassType { $interface = !$parent ? ClassType::interface(Parser::parseString($object->name, $args)) : $parent->addInterface(Parser::parseString($object->name, $args)); @@ -109,7 +109,7 @@ private static function interface(object $object, array $args, mixed &$parent = * @param array $args * @param PhpFile|PhpNamespace|null $parent */ - private static function trait(object $object, array $args, mixed &$parent = null): ClassType + private static function trait(object $object, array $args, &$parent = null): ClassType { $trait = !$parent ? ClassType::trait(Parser::parseString($object->name, $args)) : $parent->addTrait(Parser::parseString($object->name, $args)); @@ -320,7 +320,7 @@ private static function autoImportTypes(PhpFile &$file): PhpFile return $file; } - public static function is(mixed &$subject): bool + public static function is(&$subject): bool { return is_array($subject) ? isset($subject) && count($subject) > 0 : isset($subject); }