Skip to content

Commit

Permalink
remove mixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
matronator committed Apr 20, 2023
1 parent 6ec8190 commit a210709
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Mtrgen/Cli/BaseGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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('<comment><options=bold>Enter the path to your template file</>:</comment> ');
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Mtrgen/Cli/PublishTemplateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Mtrgen/Registry/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/Mtrgen/Registry/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mtrgen/Store/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/Mtrgen/Template/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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));

Expand All @@ -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));

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a210709

Please sign in to comment.