Skip to content

Commit

Permalink
Update vimeo/psalm requirement from ^4.23 to ^5.6 (#240)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
  • Loading branch information
dependabot[bot] and vjik committed Feb 5, 2023
1 parent 7c1eac2 commit 3fdfbfa
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -34,7 +34,7 @@
"rector/rector": "^0.15.7",
"roave/infection-static-analysis-plugin": "^1.18",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.23",
"vimeo/psalm": "^4.30|^5.6",
"yiisoft/test-support": " ^3.0"
},
"autoload": {
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
1 change: 1 addition & 0 deletions src/FormModel.php
Expand Up @@ -350,6 +350,7 @@ private function getNestedAttribute(string $attribute): array
return [$attribute, null];
}

/** @psalm-suppress PossiblyUndefinedArrayOffset Condition above guarantee that attribute contains dot */
[$attribute, $nested] = explode('.', $attribute, 2);

/** @var string */
Expand Down
2 changes: 1 addition & 1 deletion tests/Field/CheckboxListTest.php
Expand Up @@ -343,7 +343,7 @@ public function testInvalidValue(): void
$field = CheckboxList::widget()->formAttribute(new CheckboxListForm(), 'age');

$this->expectException(InvalidArgumentException::class);
$this->expectErrorMessage('"CheckboxList" field requires iterable or null value.');
$this->expectExceptionMessage('"CheckboxList" field requires iterable or null value.');
$field->render();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Field/CheckboxTest.php
Expand Up @@ -485,7 +485,7 @@ public function testInvalidValue(): void
$field = Checkbox::widget()->formAttribute(new CheckboxForm(), 'object');

$this->expectException(InvalidArgumentException::class);
$this->expectErrorMessage('Checkbox widget requires a string, numeric, bool, Stringable or null value.');
$this->expectExceptionMessage('Checkbox widget requires a string, numeric, bool, Stringable or null value.');
$field->render();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Field/EmailTest.php
Expand Up @@ -245,7 +245,7 @@ public function testInvalidValue(): void
$field = Email::widget()->formAttribute(new EmailForm(), 'age');

$this->expectException(InvalidArgumentException::class);
$this->expectErrorMessage('Email field requires a string or null value.');
$this->expectExceptionMessage('Email field requires a string or null value.');
$field->render();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Field/HiddenTest.php
Expand Up @@ -34,7 +34,7 @@ public function testInvalidValue(): void
$field = Hidden::widget()->formAttribute(new HiddenForm(), 'flag');

$this->expectException(InvalidArgumentException::class);
$this->expectErrorMessage('Hidden widget requires a string, numeric or null value.');
$this->expectExceptionMessage('Hidden widget requires a string, numeric or null value.');
$field->render();
}
}
4 changes: 2 additions & 2 deletions tests/Support/Form/ErrorForm.php
Expand Up @@ -5,8 +5,8 @@
namespace Yiisoft\Form\Tests\Support\Form;

use Yiisoft\Form\FormModel;
use Yiisoft\Validator\Rule\Integer;
use Yiisoft\Validator\Rule\Length;
use Yiisoft\Validator\Rule\Number;
use Yiisoft\Validator\Rule\Required;

final class ErrorForm extends FormModel
Expand All @@ -26,7 +26,7 @@ public function getRules(): array
{
return [
'name' => [new Required(), new Length(min: 4)],
'age' => [new Number(integerOnly: true, min: 18)],
'age' => [new Integer(min: 18)],
];
}
}

0 comments on commit 3fdfbfa

Please sign in to comment.