for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Consolidation\AnnotatedCommand\Parser\Internal;
/**
* Hold some state. Collect tags.
*/
class TagFactory
{
/** @var DocblockTag|null Current tag */
protected $current;
/** @var DocblockTag[] All tag */
protected $tags;
* DocblockTag constructor
public function __construct()
$this->current = null;
$this->tags = [];
}
public function parseLine($line)
if (DocblockTag::isTag($line)) {
return $this->createTag($line);
if (empty($line)) {
return $this->storeCurrentTag();
return $this->accumulateContent($line);
public function getTags()
$this->storeCurrentTag();
return $this->tags;
protected function createTag($line)
DocblockTag::splitTagAndContent($line, $matches);
$this->current = new DocblockTag($matches['tag'], $matches['description']);
return true;
protected function storeCurrentTag()
if (!$this->current) {
return false;
$this->tags[] = $this->current;
$this->current = false;
false
object<Consolidation\Ann...ernal\DocblockTag>|null
$current
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
protected function accumulateContent($line)
$this->current->appendContent($line);
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..