PhpSpec\Loader\Transformer\TypeHintIndex::addInvalid PHP Méthode

addInvalid() public méthode

public addInvalid ( string $class, string $method, string $argument, Exception $exception )
$class string
$method string
$argument string
$exception Exception
    public function addInvalid($class, $method, $argument, \Exception $exception);

Usage Example

 /**
  * @param array $tokens
  * @param integer $index
  * @param array $token
  */
 private function extractTypehints(&$tokens, $index, $token)
 {
     $typehint = '';
     for ($i = $index - 1; in_array($tokens[$i][0], $this->typehintTokens); $i--) {
         $typehint = $tokens[$i][1] . $typehint;
         unset($tokens[$i]);
     }
     if ($typehint = trim($typehint)) {
         $class = $this->namespaceResolver->resolve($this->currentClass);
         try {
             $typehintFcqn = $this->namespaceResolver->resolve($typehint);
             $this->typeHintIndex->add($class, trim($this->currentFunction), $token[1], $typehintFcqn);
         } catch (DisallowedScalarTypehintException $e) {
             $this->typeHintIndex->addInvalid($class, trim($this->currentFunction), $token[1], $e);
         }
     }
 }
All Usage Examples Of PhpSpec\Loader\Transformer\TypeHintIndex::addInvalid