Skip to content

Commit

Permalink
Update DoctrineKeyValueStyleRule.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Mar 20, 2023
1 parent 22babc5 commit 0bee888
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Rules/DoctrineKeyValueStyleRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ public function processNode(Node $callLike, Scope $scope): array
continue;
}

$acceptedType = $this->getColumnAcceptsType($argColumn->getType());
$acceptingType = $this->getColumnAcceptingType($argColumn->getType());
$valueType = $argArray->getValueTypes()[$keyIndex];

if (! $acceptedType->isSuperTypeOf($valueType)->yes()) {
$errors[] = 'Column "' . $table->getName() . '.' . $argColumnName . '" expects value type ' . $acceptedType->describe(VerbosityLevel::precise()) . ', got type ' . $valueType->describe(VerbosityLevel::precise());
if (! $acceptingType->isSuperTypeOf($valueType)->yes()) {
$errors[] = 'Column "' . $table->getName() . '.' . $argColumnName . '" expects value type ' . $acceptingType->describe(VerbosityLevel::precise()) . ', got type ' . $valueType->describe(VerbosityLevel::precise());
}
}
}
Expand All @@ -194,7 +194,7 @@ public function processNode(Node $callLike, Scope $scope): array
* Converts the column type into the most general type that the column
* will accept.
*/
private function getColumnAcceptsType(Type $columnType): Type
private function getColumnAcceptingType(Type $columnType): Type
{
$checkIntegerRanges = QueryReflection::getRuntimeConfiguration()->isParameterTypeValidationStrict();
if (false === $checkIntegerRanges) {
Expand Down

0 comments on commit 0bee888

Please sign in to comment.