Nelmio\Alice\Definition\Value\FixtureMatchReferenceValue::createWildcardReference PHP Method

createWildcardReference() public static method

public static createWildcardReference ( string $reference ) : self
$reference string e.g. 'user'
return self reference with the pattern to match "@user*"
    public static function createWildcardReference(string $reference) : self
    {
        return new self(sprintf('/^%s.*/', $reference));
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Parses expressions such as '$username'.
  *
  * {@inheritdoc}
  *
  * @throws ParseException
  */
 public function parse(Token $token)
 {
     $value = $token->getValue();
     $fixtureId = substr($value, 1, strlen($value) - 2);
     if (false === $fixtureId) {
         throw ExpressionLanguageExceptionFactory::createForUnparsableToken($token);
     }
     return FixtureMatchReferenceValue::createWildcardReference($fixtureId);
 }
All Usage Examples Of Nelmio\Alice\Definition\Value\FixtureMatchReferenceValue::createWildcardReference