2020-11-20 17:06:56 +01:00
< ? php
/*
* This file is part of the NelmioApiDocBundle package .
*
* ( c ) Nelmio
*
* For the full copyright and license information , please view the LICENSE
* file that was distributed with this source code .
*/
namespace Nelmio\ApiDocBundle\Exception ;
class UndocumentedArrayItemsException extends \LogicException
{
private $class ;
private $path ;
2020-11-20 17:10:21 +01:00
public function __construct ( string $class = null , string $path = '' )
2020-11-20 17:06:56 +01:00
{
$this -> class = $class ;
$this -> path = $path ;
$propertyName = '' ;
if ( null !== $class ) {
$propertyName = $class . '::' ;
}
$propertyName .= $path ;
2021-11-03 23:55:56 +01:00
parent :: __construct ( sprintf ( 'Property "%s" is an array, but its items type isn\'t specified. You can specify that by using the type `string[]` for instance or `@OA\Property(type="array", @OA\Items(type="string"))`.' , $propertyName ));
2020-11-20 17:06:56 +01:00
}
public function getClass ()
{
return $this -> class ;
}
public function getPath ()
{
return $this -> path ;
}
}