mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
✅ Make unit tests working
This commit is contained in:
@@ -60,7 +60,7 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
|
||||
public function __construct(?DocBlockFactoryInterface $docBlockFactory = null, ?array $mutatorPrefixes = null, ?array $accessorPrefixes = null, ?array $arrayMutatorPrefixes = null)
|
||||
{
|
||||
if (!class_exists(DocBlockFactory::class)) {
|
||||
throw new \LogicException(sprintf('Unable to use the "%s" class as the "phpdocumentor/reflection-docblock" package is not installed. Try running composer require "phpdocumentor/reflection-docblock".', __CLASS__));
|
||||
throw new \LogicException(\sprintf('Unable to use the "%s" class as the "phpdocumentor/reflection-docblock" package is not installed. Try running composer require "phpdocumentor/reflection-docblock".', __CLASS__));
|
||||
}
|
||||
|
||||
$this->docBlockFactory = $docBlockFactory ?: DocBlockFactory::createInstance();
|
||||
@@ -73,7 +73,7 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
|
||||
|
||||
public function getShortDescription(string $class, string $property, array $context = []): ?string
|
||||
{
|
||||
/** @var $docBlock DocBlock */
|
||||
/** @var DocBlock $docBlock */
|
||||
[$docBlock] = $this->getDocBlock($class, $property);
|
||||
if (!$docBlock) {
|
||||
return null;
|
||||
@@ -100,7 +100,7 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
|
||||
|
||||
public function getLongDescription(string $class, string $property, array $context = []): ?string
|
||||
{
|
||||
/** @var $docBlock DocBlock */
|
||||
/** @var DocBlock $docBlock */
|
||||
[$docBlock] = $this->getDocBlock($class, $property);
|
||||
if (!$docBlock) {
|
||||
return null;
|
||||
@@ -113,7 +113,7 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
|
||||
|
||||
public function getTypes(string $class, string $property, array $context = []): ?array
|
||||
{
|
||||
/** @var $docBlock DocBlock */
|
||||
/** @var DocBlock $docBlock */
|
||||
[$docBlock, $source, $prefix] = $this->getDocBlock($class, $property);
|
||||
if (!$docBlock) {
|
||||
return null;
|
||||
@@ -221,7 +221,7 @@ class PhpDocExtractor implements PropertyDescriptionExtractorInterface, Property
|
||||
*/
|
||||
private function getDocBlock(string $class, string $property): array
|
||||
{
|
||||
$propertyHash = sprintf('%s::%s', $class, $property);
|
||||
$propertyHash = \sprintf('%s::%s', $class, $property);
|
||||
|
||||
if (isset($this->docBlocks[$propertyHash])) {
|
||||
return $this->docBlocks[$propertyHash];
|
||||
|
||||
Reference in New Issue
Block a user