private function getCallerReference(FixtureInterface $scope, string $method) : array
{
if (false === strpos($method, '::')) {
return [new StaticReference($scope->getClassName()), $method];
}
$explodedMethod = explode('::', $method);
if (2 < count($explodedMethod)) {
throw InvalidArgumentExceptionFactory::createForInvalidConstructorMethod($method);
}
list($caller, $method) = $explodedMethod;
if (0 === strpos($caller, '@')) {
return [new InstantiatedReference(substr($caller, 1)), $method];
}
return [new StaticReference($caller), $method];
}