mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-08 04:10:51 +00:00
add getStringValue() to value resolver (#1130)
This commit is contained in:
parent
f6afff9f24
commit
29b79786e2
|
@ -49,6 +49,16 @@ final class ValueResolver
|
|||
return $this->getValue($expr) === $value;
|
||||
}
|
||||
|
||||
public function getStringValue(Expr $expr): string
|
||||
{
|
||||
$resolvedValue = $this->getValue($expr);
|
||||
if (! is_string($resolvedValue)) {
|
||||
throw new ShouldNotHappenException();
|
||||
}
|
||||
|
||||
return $resolvedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|null
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user