Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #130

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"yiisoft/active-record": "dev-master",
"yiisoft/aliases": "^3.0",
"yiisoft/arrays": "^2.1|^3.0",
"yiisoft/csrf": "^2.1.1",
"yiisoft/data-response": "^2.0",
"yiisoft/db": "*",
"yiisoft/friendly-exception": "^1.1",
Expand All @@ -48,7 +49,7 @@
"yiisoft/json": "^1.0",
"yiisoft/router": "^3.0",
"yiisoft/strings": "^2.1",
"yiisoft/validator": "^1.0",
"yiisoft/validator": "^2.0",
"yiisoft/yii-console": "^2.0",
"yiisoft/yii-middleware": "^1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

return $this->responseFactory->createResponse([
'generators' => array_map(
$this->serializeGenerator(...),

Check failure on line 42 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

PossiblyInvalidArgument

src/Controller/DefaultController.php:42:17: PossiblyInvalidArgument: Parameter 1 of closure passed to function array_map expects class-string<Yiisoft\Yii\Gii\GeneratorCommandInterface>, but possibly different type class-string<Yiisoft\Yii\Gii\GeneratorInterface> provided (see https://psalm.dev/092)

Check failure on line 42 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

PossiblyInvalidArgument

src/Controller/DefaultController.php:42:17: PossiblyInvalidArgument: Parameter 1 of closure passed to function array_map expects class-string<Yiisoft\Yii\Gii\GeneratorCommandInterface>, but possibly different type class-string<Yiisoft\Yii\Gii\GeneratorInterface> provided (see https://psalm.dev/092)

Check failure on line 42 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

PossiblyInvalidArgument

src/Controller/DefaultController.php:42:17: PossiblyInvalidArgument: Parameter 1 of closure passed to function array_map expects class-string<Yiisoft\Yii\Gii\GeneratorCommandInterface>, but possibly different type class-string<Yiisoft\Yii\Gii\GeneratorInterface> provided (see https://psalm.dev/092)
array_values(
array_map(
fn (GeneratorInterface|GeneratorProxy $generator) => $generator instanceof GeneratorProxy
Expand All @@ -57,7 +57,7 @@
$generator = $request->getGenerator();

return $this->responseFactory->createResponse(
$this->serializeGenerator($generator::class)

Check failure on line 60 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidArgument

src/Controller/DefaultController.php:60:39: InvalidArgument: Argument 1 of Yiisoft\Yii\Gii\Controller\DefaultController::serializeGenerator expects class-string<Yiisoft\Yii\Gii\GeneratorCommandInterface>, but class-string<Yiisoft\Yii\Gii\GeneratorInterface> provided (see https://psalm.dev/004)

Check failure on line 60 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

InvalidArgument

src/Controller/DefaultController.php:60:39: InvalidArgument: Argument 1 of Yiisoft\Yii\Gii\Controller\DefaultController::serializeGenerator expects class-string<Yiisoft\Yii\Gii\GeneratorCommandInterface>, but class-string<Yiisoft\Yii\Gii\GeneratorInterface> provided (see https://psalm.dev/004)

Check failure on line 60 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidArgument

src/Controller/DefaultController.php:60:39: InvalidArgument: Argument 1 of Yiisoft\Yii\Gii\Controller\DefaultController::serializeGenerator expects class-string<Yiisoft\Yii\Gii\GeneratorCommandInterface>, but class-string<Yiisoft\Yii\Gii\GeneratorInterface> provided (see https://psalm.dev/004)
);
}

Expand Down Expand Up @@ -103,7 +103,7 @@
if ($generatedFile->getId() === $file) {
$content = $generatedFile->preview();
return $this->responseFactory->createResponse(
['content' => $content ?: 'Preview is not available for this file type.']

Check failure on line 106 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

RiskyTruthyFalsyComparison

src/Controller/DefaultController.php:106:35: RiskyTruthyFalsyComparison: Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)

Check failure on line 106 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

RiskyTruthyFalsyComparison

src/Controller/DefaultController.php:106:35: RiskyTruthyFalsyComparison: Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)

Check failure on line 106 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

RiskyTruthyFalsyComparison

src/Controller/DefaultController.php:106:35: RiskyTruthyFalsyComparison: Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
);
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@
private function createErrorResponse(InvalidGeneratorCommandException $e): DataResponse
{
return $this->responseFactory->createResponse(
['errors' => $e->getResult()->getErrorMessagesIndexedByAttribute()],
['errors' => $e->getResult()->getErrorMessagesIndexedByProperty()],
Status::UNPROCESSABLE_ENTITY
);
}
Expand All @@ -166,16 +166,16 @@
*/
private function serializeGenerator(string $generatorClass): array
{
$commandClass = $generatorClass::getCommandClass();

Check failure on line 169 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedMethod

src/Controller/DefaultController.php:169:25: UndefinedMethod: Method Yiisoft\Yii\Gii\GeneratorCommandInterface::getcommandclass does not exist (see https://psalm.dev/022)

Check failure on line 169 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedMethod

src/Controller/DefaultController.php:169:25: UndefinedMethod: Method Yiisoft\Yii\Gii\GeneratorCommandInterface::getcommandclass does not exist (see https://psalm.dev/022)

Check failure on line 169 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedMethod

src/Controller/DefaultController.php:169:25: UndefinedMethod: Method Yiisoft\Yii\Gii\GeneratorCommandInterface::getcommandclass does not exist (see https://psalm.dev/022)

$dataset = new AttributesRulesProvider($commandClass);
$rules = $dataset->getRules();
$dumpedRules = (new RulesDumper())->asArray($rules);
$attributes = $commandClass::getAttributes();

Check failure on line 174 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:174:23: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

Check failure on line 174 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:174:23: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

Check failure on line 174 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:174:23: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)
$hints = $commandClass::getHints();

Check failure on line 175 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:175:18: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

Check failure on line 175 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:175:18: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

Check failure on line 175 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:175:18: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)
$labels = $commandClass::getAttributeLabels();

Check failure on line 176 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:176:19: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

Check failure on line 176 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:176:19: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

Check failure on line 176 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

InvalidStringClass

src/Controller/DefaultController.php:176:19: InvalidStringClass: String cannot be used as a class (see https://psalm.dev/160)

$reflection = new ReflectionClass($commandClass);

Check failure on line 178 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

ArgumentTypeCoercion

src/Controller/DefaultController.php:178:43: ArgumentTypeCoercion: Argument 1 of ReflectionClass::__construct expects class-string|object|trait-string, but parent type object|string provided (see https://psalm.dev/193)

Check failure on line 178 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

ArgumentTypeCoercion

src/Controller/DefaultController.php:178:43: ArgumentTypeCoercion: Argument 1 of ReflectionClass::__construct expects class-string|object|trait-string, but parent type object|string provided (see https://psalm.dev/193)

Check failure on line 178 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

ArgumentTypeCoercion

src/Controller/DefaultController.php:178:43: ArgumentTypeCoercion: Argument 1 of ReflectionClass::__construct expects class-string|object|trait-string, but parent type object|string provided (see https://psalm.dev/193)
$constructorParameters = $reflection->getConstructor()?->getParameters() ?? [];

$attributesResult = [];
Expand All @@ -193,7 +193,7 @@
}

return [
'id' => $generatorClass::getId(),

Check failure on line 196 in src/Controller/DefaultController.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedMethod

src/Controller/DefaultController.php:196:21: UndefinedMethod: Method Yiisoft\Yii\Gii\GeneratorCommandInterface::getid does not exist (see https://psalm.dev/022)
'name' => $generatorClass::getName(),
'description' => $generatorClass::getDescription(),
'commandClass' => $commandClass,
Expand Down
5 changes: 0 additions & 5 deletions src/Validator/ClassExistsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class ClassExistsRule implements RuleInterface
{
public function getName(): string
{
return 'gii_class_exists';
}

public function getHandler(): string|RuleHandlerInterface
{
return ClassExistsHandler::class;
Expand Down
5 changes: 0 additions & 5 deletions src/Validator/NewClassRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class NewClassRule implements RuleInterface
{
public function getName(): string
{
return 'gii_new_class';
}

public function getHandler(): string|RuleHandlerInterface
{
return NewClassHandler::class;
Expand Down
5 changes: 0 additions & 5 deletions src/Validator/ReservedKeywordRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class ReservedKeywordRule implements RuleInterface
{
public function getName(): string
{
return 'gii_reserved_keyword';
}

public function getHandler(): string|RuleHandlerInterface
{
return ReservedKeywordHandler::class;
Expand Down
5 changes: 0 additions & 5 deletions src/Validator/TableExistsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class TableExistsRule implements RuleInterface
{
public function getName(): string
{
return 'gii_table_exists';
}

public function getHandler(): string|RuleHandlerInterface
{
return TableExistsHandler::class;
Expand Down
5 changes: 0 additions & 5 deletions src/Validator/TemplateRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class TemplateRule implements RuleInterface
{
public function getName(): string
{
return 'gii_template_rule';
}

public function getHandler(): string|RuleHandlerInterface
{
return TemplateRuleHandler::class;
Expand Down
Loading