private function getPhpDocArrayType(ArrayType $type)
 {
     if ($type->getTypeOf() === null) {
         return 'array';
     }
     $typeOf = $type->getTypeOf();
     if ($typeOf instanceof ArrayType) {
         return $this->getPhpDocArrayType($typeOf) . '[]';
     }
     return $typeOf->getPhpTypeName() . '[]';
 }
Beispiel #2
0
 /**
  * DataValueInterface constructor.
  *
  * @param array              $values
  * @param DataTypeInterface $typeOf
  *
  * @throws \InvalidArgumentException
  */
 public function __construct(array $values, DataTypeInterface $typeOf = null)
 {
     foreach ($values as $value) {
         if (false === $value instanceof DataValueInterface) {
             throw new \InvalidArgumentException('Only DataValueInterface is allowed');
         }
     }
     $this->values = $values;
     parent::__construct($typeOf);
 }