@@ -77,7 +77,7 @@ protected function run($callable)
7777 }, function (Exception $ e ) {
7878 $ this ->addProblem ('UNKNOWN ' , $ e ->getMessage ());
7979 $ this ->showOptionalTrace ($ e );
80- })->always (function () {
80+ })->finally (function () {
8181 $ this ->shutdown ();
8282 });
8383 } else {
@@ -104,10 +104,10 @@ protected function stripNonUtf8Characters($string)
104104 }
105105
106106 /**
107- * @param null $state
108- * @return mixed
107+ * @param int|string| null $state
108+ * @return string
109109 */
110- protected function getStateName ($ state = null )
110+ protected function getStateName (int | string | null $ state = null ): string
111111 {
112112 if ($ state === null ) {
113113 return $ this ->stateNameMap [$ this ->state ];
@@ -121,7 +121,7 @@ protected function getStateName($state = null)
121121 * @param string $message
122122 * @return $this
123123 */
124- protected function addProblem ($ state , $ message )
124+ protected function addProblem (int | string $ state , string $ message ): static
125125 {
126126 $ this ->raiseState ($ state );
127127 $ stateName = $ this ->getStateName ($ state );
@@ -169,7 +169,7 @@ protected function prependMessage($message)
169169 * @param int|string $state
170170 * @return $this
171171 */
172- protected function raiseState ($ state )
172+ protected function raiseState (int | string $ state ): static
173173 {
174174 $ state = $ this ->wantNumericState ($ state );
175175 if ($ this ->sortingStateMap [$ state ] > $ this ->sortingStateMap [$ this ->state ]) {
@@ -188,10 +188,10 @@ protected function getState()
188188 }
189189
190190 /**
191- * @param $state
191+ * @param int|string $state
192192 * @return int
193193 */
194- protected function wantNumericState ($ state )
194+ protected function wantNumericState (int | string $ state ): int
195195 {
196196 if (is_int ($ state ) || ctype_digit ($ state )) {
197197 if (array_key_exists ($ state , $ this ->stateNameMap )) {
0 commit comments