@@ -47,30 +47,27 @@ short example containing most features described below::
47
47
*/
48
48
class FooBar
49
49
{
50
- const SOME_CONST = 42;
50
+ public const SOME_CONST = 42;
51
51
52
52
/**
53
53
* @var string
54
54
*/
55
55
private $fooBar;
56
-
57
56
private $qux;
58
57
59
58
/**
60
- * @param string $dummy Some argument description
59
+ * @param $dummy some argument description
61
60
*/
62
- public function __construct($dummy, Qux $qux)
61
+ public function __construct(string $dummy, Qux $qux)
63
62
{
64
63
$this->fooBar = $this->transformText($dummy);
65
64
$this->qux = $qux;
66
65
}
67
66
68
67
/**
69
- * @return string
70
- *
71
68
* @deprecated
72
69
*/
73
- public function someDeprecatedMethod()
70
+ public function someDeprecatedMethod(): string
74
71
{
75
72
trigger_deprecation('symfony/package-name', '5.1', 'The %s() method is deprecated, use Acme\Baz::someMethod() instead.', __METHOD__);
76
73
@@ -80,14 +77,11 @@ short example containing most features described below::
80
77
/**
81
78
* Transforms the input given as the first argument.
82
79
*
83
- * @param bool|string $dummy Some argument description
84
- * @param array $options An options collection to be used within the transformation
80
+ * @param $options an options collection to be used within the transformation
85
81
*
86
- * @return string|null The transformed input
87
- *
88
- * @throws \RuntimeException When an invalid option is provided
82
+ * @throws \RuntimeException when an invalid option is provided
89
83
*/
90
- private function transformText($dummy, array $options = [])
84
+ private function transformText(bool|string $dummy, array $options = []): ?string
91
85
{
92
86
$defaultOptions = [
93
87
'some_default' => 'values',
@@ -100,16 +94,13 @@ short example containing most features described below::
100
94
}
101
95
}
102
96
103
- $mergedOptions = array_merge(
104
- $defaultOptions,
105
- $options
106
- );
97
+ $mergedOptions = array_merge($defaultOptions, $options);
107
98
108
99
if (true === $dummy) {
109
100
return 'something';
110
101
}
111
102
112
- if (is_string($dummy)) {
103
+ if (\ is_string($dummy)) {
113
104
if ('values' === $mergedOptions['some_default']) {
114
105
return substr($dummy, 0, 5);
115
106
}
@@ -122,11 +113,8 @@ short example containing most features described below::
122
113
123
114
/**
124
115
* Performs some basic operations for a given value.
125
- *
126
- * @param mixed $value Some value to operate against
127
- * @param bool $theSwitch Some switch to control the method's flow
128
116
*/
129
- private function performOperations($value = null, $theSwitch = false)
117
+ private function performOperations(mixed $value = null, bool $theSwitch = false)
130
118
{
131
119
if (!$theSwitch) {
132
120
return;
0 commit comments