Code Duplication    Length = 6-7 lines in 7 locations

src/Builder/PhpDomainBuilder.php 7 locations

@@ 330-335 (lines=6) @@
327
    protected function addDocblockTag($tagName, DocBlock $docBlock) {
328
        $tags = $docBlock->getTagsByName($tagName);
329
        switch ($tagName) {
330
            case 'return':
331
                if (count($tags) === 0) continue;
332
                /** @var Return_ $return */
333
                $return = $tags[0];
334
                $this->addMultiline(':Returns: ' . $return->getType() . ' ' . RstBuilder::escape($return->getDescription()), true);
335
                break;
336
            case 'var':
337
                if (count($tags) === 0) continue;
338
                /** @var DocBlock\Tags\Var_ $return */
@@ 336-341 (lines=6) @@
333
                $return = $tags[0];
334
                $this->addMultiline(':Returns: ' . $return->getType() . ' ' . RstBuilder::escape($return->getDescription()), true);
335
                break;
336
            case 'var':
337
                if (count($tags) === 0) continue;
338
                /** @var DocBlock\Tags\Var_ $return */
339
                $return = $tags[0];
340
                $this->addMultiline(':Type: ' . self::typesToRst($return->getType()) . ' ' . RstBuilder::escape($return->getDescription()), true);
341
                break;
342
            case 'throws':
343
                if (count($tags) === 0) continue;
344
                /** @var Throws $tag */
@@ 342-348 (lines=7) @@
339
                $return = $tags[0];
340
                $this->addMultiline(':Type: ' . self::typesToRst($return->getType()) . ' ' . RstBuilder::escape($return->getDescription()), true);
341
                break;
342
            case 'throws':
343
                if (count($tags) === 0) continue;
344
                /** @var Throws $tag */
345
                foreach ($tags as $tag) {
346
                    $this->addMultiline(':Throws: ' . $tag->getType() . ' ' . RstBuilder::escape($tag->getDescription()), true);
347
                }
348
                break;
349
            case 'since':
350
                if (count($tags) === 0) continue;
351
                /** @var Since $return */
@@ 349-354 (lines=6) @@
346
                    $this->addMultiline(':Throws: ' . $tag->getType() . ' ' . RstBuilder::escape($tag->getDescription()), true);
347
                }
348
                break;
349
            case 'since':
350
                if (count($tags) === 0) continue;
351
                /** @var Since $return */
352
                $return = $tags[0];
353
                $this->addMultiline(':Since: ' . $return->getVersion() . ' ' . RstBuilder::escape($return->getDescription()), true);
354
                break;
355
            case 'deprecated':
356
                if (count($tags) === 0) continue;
357
                /** @var Deprecated $return */
@@ 355-360 (lines=6) @@
352
                $return = $tags[0];
353
                $this->addMultiline(':Since: ' . $return->getVersion() . ' ' . RstBuilder::escape($return->getDescription()), true);
354
                break;
355
            case 'deprecated':
356
                if (count($tags) === 0) continue;
357
                /** @var Deprecated $return */
358
                $return = $tags[0];
359
                $this->addMultiline(':Deprecated: ' . $return->getVersion() . ' ' . RstBuilder::escape($return->getDescription()), true);
360
                break;
361
            case 'see':
362
                if (count($tags) === 0) continue;
363
                /** @var See $return */
@@ 361-366 (lines=6) @@
358
                $return = $tags[0];
359
                $this->addMultiline(':Deprecated: ' . $return->getVersion() . ' ' . RstBuilder::escape($return->getDescription()), true);
360
                break;
361
            case 'see':
362
                if (count($tags) === 0) continue;
363
                /** @var See $return */
364
                $return = $tags[0];
365
                $this->addMultiline(':See: ' . $return->getReference() . ' ' . RstBuilder::escape($return->getDescription()), true);
366
                break;
367
            case 'license':
368
                if (count($tags) === 0) continue;
369
                /** @var DocBlock\Tags\BaseTag $return */
@@ 367-372 (lines=6) @@
364
                $return = $tags[0];
365
                $this->addMultiline(':See: ' . $return->getReference() . ' ' . RstBuilder::escape($return->getDescription()), true);
366
                break;
367
            case 'license':
368
                if (count($tags) === 0) continue;
369
                /** @var DocBlock\Tags\BaseTag $return */
370
                $return = $tags[0];
371
                $this->addMultiline(':License: ' . RstBuilder::escape($return->getDescription()), true);
372
                break;
373
            case 'param':
374
                // param handling is done by subclasses since it is more that docbook parsing
375
                break;