-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathPhpDoc.wrong.php.inc
55 lines (50 loc) · 1.75 KB
/
PhpDoc.wrong.php.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php declare(strict_types=1);
namespace Lmc\CodingStandard\Integration\Fixtures;
class PhpDoc
{
// PhpdocToPropertyTypeFixer, PropertyTypeHintSniff
/** @var int */
private $integerValue = 3;
private $undefinedTypeValue = 3;
/** @var mixed */
private $undeclaredMixedType;
/** @var \DateTimeImmutable */
private $nonScalarType;
/**
* Very well documented method.
* It tests PhpdocAlignFixer, NoSuperfluousPhpdocTagsFixer, PhpdocTrimConsecutiveBlankLineSeparationFixer
* and possibly other Phpdoc rules.
*
*
*
* @param string $first
* @throws \Exception
* @param int|float $second Second parameter does have a comment, unlike the first one.
* @param string|null $third Third parameter is optional and has a default value and multilne comment. Lorem
* ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec purus nec nunc ultricies ultricies.
* Nullam nec purus nec nunc ultricies ultricies. Nullam nec purus nec nunc ultricies ultricies.
* @return mixed There is also information about return type.
*/
public function veryWellDocumented(string $first, int|float $second, ?string $third = '3rd'): mixed
{
return $first . $third;
}
/**
* @param int $value
* @param mixed $mixedType
* @return bool
*/
public function methodWithTypesInTypeHints($value, $mixedType)
{
return $value > 3 ? true : false;
}
/**
* @param int $intParam
* @param string $stringParam This phpdoc should be preserved, because it contains some comment for $stringParam.
* @return void
*/
public function methodWithMeaningfulParamComment(int $intParam, string $stringParam): void
{
// Do nothing.
}
}