Skip to content

Commit 6a623a4

Browse files
committed
🚸 code review
1 parent 93cfc74 commit 6a623a4

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

src/DocBlock/Tags/Factory/MethodParameterFactory.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@
1717
use function str_repeat;
1818
use function strlen;
1919

20-
class MethodParameterFactory
20+
/**
21+
* @internal This class is not part of the BC promise of this library.
22+
*/
23+
final class MethodParameterFactory
2124
{
2225
/**
2326
* Formats the given default value to a string-able mixin
27+
*
28+
* @param mixed $defaultValue
29+
* @return string
2430
*/
2531
public function format($defaultValue): string
2632
{
@@ -30,32 +36,36 @@ public function format($defaultValue): string
3036
return '';
3137
}
3238

33-
protected function formatDouble(float $defaultValue): string
39+
private function formatDouble(float $defaultValue): string
3440
{
3541
return var_export($defaultValue, true);
3642
}
3743

38-
protected function formatNull($defaultValue): string
44+
/**
45+
* @param mixed $defaultValue
46+
* @return string
47+
*/
48+
private function formatNull($defaultValue): string
3949
{
4050
return 'null';
4151
}
4252

43-
protected function formatInteger(int $defaultValue): string
53+
private function formatInteger(int $defaultValue): string
4454
{
4555
return var_export($defaultValue, true);
4656
}
4757

48-
protected function formatString(string $defaultValue): string
58+
private function formatString(string $defaultValue): string
4959
{
5060
return var_export($defaultValue, true);
5161
}
5262

53-
protected function formatBoolean(bool $defaultValue): string
63+
private function formatBoolean(bool $defaultValue): string
5464
{
5565
return var_export($defaultValue, true);
5666
}
5767

58-
protected function formatArray(array $defaultValue): string
68+
private function formatArray(array $defaultValue): string
5969
{
6070
$formatedValue = '[';
6171

@@ -74,7 +84,7 @@ protected function formatArray(array $defaultValue): string
7484
return $formatedValue;
7585
}
7686

77-
protected function formatObject(object $defaultValue): string
87+
private function formatObject(object $defaultValue): string
7888
{
7989
return 'new '. get_class($defaultValue). '()';
8090
}

src/DocBlock/Tags/MethodParameter.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@ final class MethodParameter
2525

2626
private string $name;
2727

28-
private mixed $defaultValue;
28+
/**
29+
* @var mixed
30+
*/
31+
private $defaultValue;
2932

3033
private const NO_DEFAULT_VALUE = '__NO_VALUE__';
3134

35+
/**
36+
* @param mixed $defaultValue
37+
*/
3238
public function __construct(
3339
string $name,
3440
Type $type,

0 commit comments

Comments
 (0)