-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bug/score-calculation #5
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request, @asdrenxhafa ! Unfortunately, there seems to be an issue running the Actions on your branch, sorry about that. In Additionally, PHPStan reports the following errors:
Can you please make the necessary changes? |
In the Valantic\DataQualityBundle\Validation\DataObject\Attributes\AbstractAttribute class wich is called from the
showAction() method from ScoreController:87 calls the validate() function ->
{ $this->violations = $this->getValidator()->validate($this->value(), $this->getConstraints(), $this->groups); }
catch (\Throwable $e)
{ $this->eventDispatcher->dispatch(new ConstraintFailureEvent($e, $this->obj->getId(), $this->attribute, $this->violations)); }
}
$this->getValidator()>validate($this>value(), $this->getConstraints(), $this->groups);,
this method returns a object ConstraintViolationList but expects an array,
so when trying to assign the protected array $violations = []; it will throw this error:
"Cannot assign Symfony\Component\Validator\ConstraintViolationList to property Valantic\DataQualityBundle\Validation\DataObject\Attributes\AbstractAttribute::$violations of type array"
So the fix here is to change the
protected array $violations = [];
to this:
protected ConstraintViolationList $violations;