Skip to content

Commit

Permalink
Removed deprecated ReflectionType::__toString() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
awd-studio committed May 16, 2020
1 parent fd37ac0 commit 47b6904
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/ServiceBuses/Reflection/ParameterReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@ final class ParameterReflector
*/
public $parameter;

/**
* @var \ReflectionType|null
*/
public $type = null;

public function __construct(\ReflectionParameter $parameter)
{
$this->parameter = $parameter;
if ($this->parameter->hasType()) {
$this->type = $this->parameter->getType();
}
}

public function name(): ?string
{
if ($this->canBeProcessed()) {
return (string) $this->type;
$paramType = $this->parameter->getType();

return $paramType instanceof \ReflectionNamedType ? $paramType->getName() : null;
}

return null;
Expand Down

0 comments on commit 47b6904

Please sign in to comment.