tokenize() public method

public tokenize ( string $value ) : string
$value string
return string
Example #1
0
 /**
  * {@inheritdoc}
  *
  * @throws MalformedFunctionException
  */
 public function lex(string $value) : array
 {
     if (false === $this->functionTokenizer->isTokenized($value)) {
         $value = $this->functionTokenizer->tokenize($value);
     }
     return $this->decoratedLexer->lex($value);
 }
Example #2
0
 /**
  * @dataProvider provideValues
  */
 public function testTokenizeValues($value, $expected)
 {
     try {
         $actual = $this->tokenizer->tokenize($value);
         if (null === $expected) {
             $this->fail('Expected exception to be thrown.');
         }
         $this->assertEquals($expected, $actual);
     } catch (MalformedFunctionException $exception) {
         if (null !== $expected) {
             throw $exception;
         }
     }
 }