PHPUnit_Util_InvalidArgumentHelper::factory PHP Метод

factory() публичный статический Метод

public static factory ( integer $argument, string $type, mixed $value = NULL )
$argument integer
$type string
$value mixed
    public static function factory($argument, $type, $value = NULL)
    {
        $stack = debug_backtrace(FALSE);
        return new InvalidArgumentException(sprintf('Argument #%d%sof %s::%s() must be a %s', $argument, $value !== NULL ? ' (' . $value . ')' : ' ', $stack[1]['class'], $stack[1]['function'], $type));
    }

Usage Example

 /**
  * Creates and returns an ExtendsOrImplements constraint.
  *
  * @param string[] $parentsAndInterfaces
  *
  * @return ExtendsOrImplements
  * @throws \PHPUnit_Framework_Exception
  */
 public static function extendsOrImplements($parentsAndInterfaces)
 {
     if (!is_array($parentsAndInterfaces)) {
         throw \PHPUnit_Util_InvalidArgumentHelper::factory(1, 'array or ArrayAccess');
     }
     return new ExtendsOrImplements($parentsAndInterfaces);
 }
All Usage Examples Of PHPUnit_Util_InvalidArgumentHelper::factory
PHPUnit_Util_InvalidArgumentHelper