@@ -19,11 +19,7 @@ public function __construct(OutputFormat $outputFormat)
19
19
$ this ->outputFormat = $ outputFormat ;
20
20
}
21
21
22
- /**
23
- * @param string $sName
24
- * @param string|null $sType
25
- */
26
- public function space ($ sName , $ sType = null ): string
22
+ public function space (string $ sName , ?string $ sType = null ): string
27
23
{
28
24
$ sSpaceString = $ this ->outputFormat ->get ("Space $ sName " );
29
25
// If $sSpaceString is an array, we have multiple values configured
@@ -78,9 +74,6 @@ public function spaceBeforeSelectorSeparator(): string
78
74
return $ this ->space ('BeforeSelectorSeparator ' );
79
75
}
80
76
81
- /**
82
- * @return string
83
- */
84
77
public function spaceAfterSelectorSeparator (): string
85
78
{
86
79
return $ this ->space ('AfterSelectorSeparator ' );
@@ -89,7 +82,7 @@ public function spaceAfterSelectorSeparator(): string
89
82
/**
90
83
* @param non-empty-string $sSeparator
91
84
*/
92
- public function spaceBeforeListArgumentSeparator ($ sSeparator ): string
85
+ public function spaceBeforeListArgumentSeparator (string $ sSeparator ): string
93
86
{
94
87
$ spaceForSeparator = $ this ->outputFormat ->getSpaceBeforeListArgumentSeparators ();
95
88
@@ -99,7 +92,7 @@ public function spaceBeforeListArgumentSeparator($sSeparator): string
99
92
/**
100
93
* @param non-empty-string $sSeparator
101
94
*/
102
- public function spaceAfterListArgumentSeparator ($ sSeparator ): string
95
+ public function spaceAfterListArgumentSeparator (string $ sSeparator ): string
103
96
{
104
97
$ spaceForSeparator = $ this ->outputFormat ->getSpaceAfterListArgumentSeparators ();
105
98
@@ -112,13 +105,9 @@ public function spaceBeforeOpeningBrace(): string
112
105
}
113
106
114
107
/**
115
- * Runs the given code, either swallowing or passing exceptions, depending on the `bIgnoreExceptions` setting.
116
- *
117
- * @param string $cCode the name of the function to call
118
- *
119
- * @return string|null
108
+ * Runs the given code, either swallowing or passing exceptions, depending on the `ignoreExceptions` setting.
120
109
*/
121
- public function safely ($ cCode )
110
+ public function safely (callable $ cCode ): ? string
122
111
{
123
112
if ($ this ->outputFormat ->get ('IgnoreExceptions ' )) {
124
113
// If output exceptions are ignored, run the code with exception guards
@@ -137,9 +126,8 @@ public function safely($cCode)
137
126
* Clone of the `implode` function, but calls `render` with the current output format instead of `__toString()`.
138
127
*
139
128
* @param array<array-key, Renderable|string> $aValues
140
- * @param bool $bIncreaseLevel
141
129
*/
142
- public function implode (string $ sSeparator , array $ aValues , $ bIncreaseLevel = false ): string
130
+ public function implode (string $ sSeparator , array $ aValues , bool $ bIncreaseLevel = false ): string
143
131
{
144
132
$ result = '' ;
145
133
$ outputFormat = $ this ->outputFormat ;
@@ -162,12 +150,7 @@ public function implode(string $sSeparator, array $aValues, $bIncreaseLevel = fa
162
150
return $ result ;
163
151
}
164
152
165
- /**
166
- * @param string $sString
167
- *
168
- * @return string
169
- */
170
- public function removeLastSemicolon ($ sString )
153
+ public function removeLastSemicolon (string $ sString ): string
171
154
{
172
155
if ($ this ->outputFormat ->get ('SemicolonAfterLastRule ' )) {
173
156
return $ sString ;
@@ -199,17 +182,11 @@ public function comments(Commentable $oCommentable): string
199
182
return $ result ;
200
183
}
201
184
202
- /**
203
- * @param string $sSpaceString
204
- */
205
- private function prepareSpace ($ sSpaceString ): string
185
+ private function prepareSpace (string $ sSpaceString ): string
206
186
{
207
187
return \str_replace ("\n" , "\n" . $ this ->indent (), $ sSpaceString );
208
188
}
209
189
210
- /**
211
- * @return string
212
- */
213
190
private function indent (): string
214
191
{
215
192
return \str_repeat ($ this ->outputFormat ->sIndentation , $ this ->outputFormat ->getIndentationLevel ());
0 commit comments