These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Spiral Framework. |
||
4 | * |
||
5 | * @license MIT |
||
6 | * @author Valentin V (Vvval) |
||
7 | */ |
||
8 | declare(strict_types=1); |
||
9 | |||
10 | namespace Cycle\ORM\Promise; |
||
11 | |||
12 | use PhpParser\Comment\Doc; |
||
13 | |||
14 | final class PHPDoc |
||
15 | { |
||
16 | /** |
||
17 | * @return Doc |
||
18 | */ |
||
19 | View Code Duplication | public static function writeInheritdoc(): Doc |
|
0 ignored issues
–
show
|
|||
20 | { |
||
21 | $lines = [ |
||
22 | '/**', |
||
23 | ' * {@inheritdoc}', |
||
24 | ' */' |
||
25 | ]; |
||
26 | |||
27 | return self::makeComment(join("\n", $lines)); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param string $type |
||
32 | * @return Doc |
||
33 | */ |
||
34 | View Code Duplication | public static function writeProperty(string $type): Doc |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
|
|||
35 | { |
||
36 | $lines = [ |
||
37 | '/**', |
||
38 | ' * @internal', |
||
39 | " * @var $type", |
||
40 | ' */' |
||
41 | ]; |
||
42 | |||
43 | return self::makeComment(join("\n", $lines)); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param string $comment |
||
48 | * @return Doc |
||
49 | */ |
||
50 | private static function makeComment(string $comment): Doc |
||
51 | { |
||
52 | return new Doc($comment); |
||
53 | } |
||
54 | } |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.