@@ -19,11 +19,7 @@ public function __construct(OutputFormat $outputFormat)
1919 $ this ->outputFormat = $ outputFormat ;
2020 }
2121
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
2723 {
2824 $ sSpaceString = $ this ->outputFormat ->get ("Space $ sName " );
2925 // If $sSpaceString is an array, we have multiple values configured
@@ -78,9 +74,6 @@ public function spaceBeforeSelectorSeparator(): string
7874 return $ this ->space ('BeforeSelectorSeparator ' );
7975 }
8076
81- /**
82- * @return string
83- */
8477 public function spaceAfterSelectorSeparator (): string
8578 {
8679 return $ this ->space ('AfterSelectorSeparator ' );
@@ -89,7 +82,7 @@ public function spaceAfterSelectorSeparator(): string
8982 /**
9083 * @param non-empty-string $sSeparator
9184 */
92- public function spaceBeforeListArgumentSeparator ($ sSeparator ): string
85+ public function spaceBeforeListArgumentSeparator (string $ sSeparator ): string
9386 {
9487 $ spaceForSeparator = $ this ->outputFormat ->getSpaceBeforeListArgumentSeparators ();
9588
@@ -99,7 +92,7 @@ public function spaceBeforeListArgumentSeparator($sSeparator): string
9992 /**
10093 * @param non-empty-string $sSeparator
10194 */
102- public function spaceAfterListArgumentSeparator ($ sSeparator ): string
95+ public function spaceAfterListArgumentSeparator (string $ sSeparator ): string
10396 {
10497 $ spaceForSeparator = $ this ->outputFormat ->getSpaceAfterListArgumentSeparators ();
10598
@@ -112,13 +105,9 @@ public function spaceBeforeOpeningBrace(): string
112105 }
113106
114107 /**
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.
120109 */
121- public function safely ($ cCode )
110+ public function safely (callable $ cCode ): ? string
122111 {
123112 if ($ this ->outputFormat ->get ('IgnoreExceptions ' )) {
124113 // If output exceptions are ignored, run the code with exception guards
@@ -137,9 +126,8 @@ public function safely($cCode)
137126 * Clone of the `implode` function, but calls `render` with the current output format instead of `__toString()`.
138127 *
139128 * @param array<array-key, Renderable|string> $aValues
140- * @param bool $bIncreaseLevel
141129 */
142- public function implode (string $ sSeparator , array $ aValues , $ bIncreaseLevel = false ): string
130+ public function implode (string $ sSeparator , array $ aValues , bool $ bIncreaseLevel = false ): string
143131 {
144132 $ result = '' ;
145133 $ outputFormat = $ this ->outputFormat ;
@@ -162,12 +150,7 @@ public function implode(string $sSeparator, array $aValues, $bIncreaseLevel = fa
162150 return $ result ;
163151 }
164152
165- /**
166- * @param string $sString
167- *
168- * @return string
169- */
170- public function removeLastSemicolon ($ sString )
153+ public function removeLastSemicolon (string $ sString ): string
171154 {
172155 if ($ this ->outputFormat ->get ('SemicolonAfterLastRule ' )) {
173156 return $ sString ;
@@ -199,17 +182,11 @@ public function comments(Commentable $oCommentable): string
199182 return $ result ;
200183 }
201184
202- /**
203- * @param string $sSpaceString
204- */
205- private function prepareSpace ($ sSpaceString ): string
185+ private function prepareSpace (string $ sSpaceString ): string
206186 {
207187 return \str_replace ("\n" , "\n" . $ this ->indent (), $ sSpaceString );
208188 }
209189
210- /**
211- * @return string
212- */
213190 private function indent (): string
214191 {
215192 return \str_repeat ($ this ->outputFormat ->sIndentation , $ this ->outputFormat ->getIndentationLevel ());
0 commit comments