mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?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;
|
|
|
|
public function __construct(string $class = null, string $path = '')
|
|
{
|
|
$this->class = $class;
|
|
$this->path = $path;
|
|
|
|
$propertyName = '';
|
|
if (null !== $class) {
|
|
$propertyName = $class.'::';
|
|
}
|
|
$propertyName .= $path;
|
|
|
|
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 `@SWG\Property(type="array", @SWG\Items(type="string"))`.', $propertyName));
|
|
}
|
|
|
|
public function getClass()
|
|
{
|
|
return $this->class;
|
|
}
|
|
|
|
public function getPath()
|
|
{
|
|
return $this->path;
|
|
}
|
|
}
|