Skip to content

Commit

Permalink
bug #465 [Maintenance] Downgrade rector to fix build (lchrusciel)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.10 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | yes
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | 
| Related tickets | continuation of #464
| License         | MIT


Commits
-------

01cefe3 [Maintenance] Downgrade rector to fix build
f070dcb [Maintenance] Remove redundant checks according to psalm
  • Loading branch information
Zales0123 authored Jul 8, 2022
2 parents f51b2d5 + f070dcb commit 4246d3a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"symplify/easy-coding-standard": "^10.2",
"twig/twig": "^2.12 || ^3.0",
"vimeo/psalm": "^4.22",
"rector/rector": "^0.13.6"
"rector/rector": "^0.12.20"
},
"suggest": {
"doctrine/orm": "^2.5",
Expand Down
2 changes: 0 additions & 2 deletions src/Bundle/Form/Type/ResourceTranslationsType.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
/** @var TranslatableInterface $translatable */
$translatable = $parentForm->getData();

Assert::nullOrIsInstanceOf($translatable, TranslatableInterface::class);

foreach ($translations as $localeCode => $translation) {
if (null === $translation) {
unset($translations[$localeCode]);
Expand Down
11 changes: 0 additions & 11 deletions src/Bundle/Validator/UniqueWithinCollectionConstraintValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public function validate(mixed $value, Constraint $constraint): void
$propertyAccessor = PropertyAccess::createPropertyAccessor();
$collectionOfEntitiesCodes = [];

Assert::isIterable($value);

foreach ($value as $key => $entity) {
/** @var int|string|null $checkingAttribute */
$checkingAttribute = $propertyAccessor->getValue($entity, $constraint->attributePath);
Expand All @@ -39,15 +37,6 @@ public function validate(mixed $value, Constraint $constraint): void
continue;
}

if (!is_string($checkingAttribute) && !is_int($checkingAttribute)) {
throw new \InvalidArgumentException(
\sprintf(
'Expected a string or integer. Got: %s',
\is_object($checkingAttribute) ? \get_class($checkingAttribute) : \gettype($checkingAttribute),
),
);
}

if (!array_key_exists($checkingAttribute, $collectionOfEntitiesCodes)) {
$collectionOfEntitiesCodes[$checkingAttribute] = $key;

Expand Down

0 comments on commit 4246d3a

Please sign in to comment.