Exemplo n.º 1
0
 public function __construct($parameterName, $index, $expectedType, \Exception $previous = null)
 {
     $this->parameterName = $parameterName;
     $this->index = $index;
     $this->expectedType = $expectedType;
     parent::__construct(\sprintf('Missing argument for parameter \'%s\' at index %d. Expected \'%s\'.', $parameterName, $index, $expectedType), $previous);
 }
 public function __construct($index, $value, \Exception $previous = null, \Typhoon\TypeInspector $typeInspector = null)
 {
     if (null === $typeInspector) {
         $typeInspector = new \Typhoon\TypeInspector();
     }
     $this->index = $index;
     $this->value = $value;
     $this->typeInspector = $typeInspector;
     $this->unexpectedType = $typeInspector->type($this->value);
     parent::__construct(\sprintf('Unexpected argument of type \'%s\' at index %d.', $this->unexpectedType, $index), $previous);
 }
 public function __construct($parameterName, $index, $value, $expectedType, \Exception $previous = null, \Eloquent\Typhoon\TypeCheck\TypeInspector $typeInspector = null)
 {
     if (null === $typeInspector) {
         $typeInspector = new \Eloquent\Typhoon\TypeCheck\TypeInspector();
     }
     $this->parameterName = $parameterName;
     $this->index = $index;
     $this->value = $value;
     $this->expectedType = $expectedType;
     $this->typeInspector = $typeInspector;
     $this->unexpectedType = $typeInspector->type($this->value);
     parent::__construct(\sprintf('Unexpected argument of type \'%s\' for parameter \'%s\' at index %d. Expected \'%s\'.', $this->unexpectedType, $parameterName, $index, $expectedType), $previous);
 }