Nelmio\Alice\Throwable\Exception\Generator\ObjectGenerator\ObjectGeneratorNotFoundExceptionFactory::createUnexpectedCall PHP Метод

createUnexpectedCall() публичный статический Метод

public static createUnexpectedCall ( string $method ) : ObjectGeneratorNotFoundException
$method string
Результат ObjectGeneratorNotFoundException
    public static function createUnexpectedCall(string $method) : ObjectGeneratorNotFoundException
    {
        return new ObjectGeneratorNotFoundException(sprintf('Expected method "%s" to be called only if it has a generator.', $method));
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  *
  * @param FixtureReferenceValue $value
  *
  * @throws UnresolvableValueException
  */
 public function resolve(ValueInterface $value, FixtureInterface $fixture, ResolvedFixtureSet $fixtureSet, array $scope, GenerationContext $context) : ResolvedValueWithFixtureSet
 {
     if (null === $this->generator) {
         throw ObjectGeneratorNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
     }
     $referredFixtureId = $value->getValue();
     if ($referredFixtureId instanceof ValueInterface) {
         throw UnresolvableValueExceptionFactory::create($value);
     }
     $referredFixture = $this->getReferredFixture($referredFixtureId, $fixtureSet);
     return $this->resolveReferredFixture($referredFixture, $referredFixtureId, $fixtureSet, $context);
 }
ObjectGeneratorNotFoundExceptionFactory