Skip to content

Commit

Permalink
Allowed null values in set-methods
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwesdijk committed Apr 16, 2021
1 parent 98a0fa4 commit 8f71617
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Resolvers/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public function __get(string $property): ?string
* Set the value of the requested property by the called property name
*
* @param string $property
* @param string $value
* @param string|null $value
*
* @return string|null
*/
public function __set(string $property, string $value): ?string
public function __set(string $property, ?string $value): ?string
{
return $this->updateOrCreateValue($property, $value)->{HasEntityAttributeValues::$value};
}
Expand Down Expand Up @@ -136,11 +136,11 @@ private function getAttribute(string $group, string $property): EntityAttribute

/**
* @param string $property
* @param string $value
* @param string|null $value
*
* @return EntityAttributeValue
*/
private function updateOrCreateValue(string $property, string $value): EntityAttributeValue
private function updateOrCreateValue(string $property, ?string $value): EntityAttributeValue
{
if ($eav = $this->getEntityAttributeValue($property)) {
$eav->{HasEntityAttributeValues::$value} = $value;
Expand Down

0 comments on commit 8f71617

Please sign in to comment.