コード例 #1
0
 public function test()
 {
     $config = new ArgumentConfig('name', false, true);
     $this->assertSame('name', $config->getName());
     $this->assertFalse($config->isRequired());
     $this->assertTrue($config->isRepeatable());
 }
コード例 #2
0
 /**
  * @param ReflectionParameter $reflectionParameter
  */
 public function __construct($reflectionParameter)
 {
     if (method_exists($reflectionParameter, 'isVariadic') && $reflectionParameter->isVariadic()) {
         $isRepeatable = true;
         $isRequired = false;
     } else {
         $isRepeatable = false;
         $isRequired = !$reflectionParameter->isOptional();
     }
     parent::__construct(null, $isRequired, $isRepeatable);
     $this->parameterName = $reflectionParameter->getName();
 }