Skip to content

Commit

Permalink
Fix PhpStan error
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam committed Oct 24, 2018
1 parent 071c066 commit 46734bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DataApi/DataApiObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ public function offsetSet($offset, $value): void

if ($value !== null && is_string($value)) {
$reflectionMethod = new ReflectionMethod($this, $setterName);
$parameterType = $reflectionMethod->getParameters()[0]->getType()->getName();
$parameterType = $reflectionMethod->getParameters()[0]->getType();

switch ($parameterType) {
assert($parameterType !== null);

switch ($parameterType->getName()) {
case 'int':
$value = intval($value);

Expand Down

0 comments on commit 46734bf

Please sign in to comment.