Nelmio\Alice\Throwable\Exception\LogicExceptionFactory::createForCannotDenormalizerForChainableFixtureBuilderDenormalizer PHP Method

createForCannotDenormalizerForChainableFixtureBuilderDenormalizer() public static method

public static createForCannotDenormalizerForChainableFixtureBuilderDenormalizer ( string $method ) : LogicException
$method string
return LogicException
    public static function createForCannotDenormalizerForChainableFixtureBuilderDenormalizer(string $method) : \LogicException
    {
        return new \LogicException(sprintf('As a chainable denormalizer, "%s" should be called only if "::canDenormalize() returns true. Got ' . 'false instead.', $method));
    }

Usage Example

 /**
  * @param string $name
  *
  * @return RangeName
  *
  * @example
  *  'user{1..10}' => new RangeName('user', 1, 10)
  */
 private function buildRange(string $name) : RangeName
 {
     $matches = [];
     if (false === $this->canDenormalize($name, $matches)) {
         throw LogicExceptionFactory::createForCannotDenormalizerForChainableFixtureBuilderDenormalizer(__METHOD__);
     }
     $reference = str_replace(sprintf('{%s}', $matches['range']), $this->token, $name);
     return new RangeName($reference, (int) $matches['from'], (int) $matches['to']);
 }
All Usage Examples Of Nelmio\Alice\Throwable\Exception\LogicExceptionFactory::createForCannotDenormalizerForChainableFixtureBuilderDenormalizer