2121
2222final class BackwardCompatibleCommandListenerTest extends TestCase
2323{
24- private const MORE_THAN_2_WHITESPACES_AND_NEW_LINES = '/\s{2,}| \\n/ ' ;
24+ private const string MORE_THAN_2_WHITESPACES_AND_NEW_LINES = '/\s{2,}| \\n/ ' ;
2525
26- private const EXAMPLE_NAME = 'ibexa:command ' ;
27- private const EXAMPLE_DEPRECATED_ALIASES = [
26+ private const string EXAMPLE_NAME = 'ibexa:command ' ;
27+ private const array EXAMPLE_DEPRECATED_ALIASES = [
2828 'ezplatform:command ' ,
2929 'ezplatform-ee:command ' ,
3030 'ezstudio:command ' ,
3131 'ezpublish-platform:command ' ,
3232 'ezpublish:command ' ,
3333 ];
3434
35- /** @var BackwardCompatibleCommandListener */
36- private $ listener ;
35+ private BackwardCompatibleCommandListener $ listener ;
3736
3837 protected function setUp (): void
3938 {
@@ -100,7 +99,7 @@ private function assertOutputNotContainsDeprecationWarning(BufferedOutput $outpu
10099
101100 private function assertOutputContainsDeprecationWarning (BufferedOutput $ output ): void
102101 {
103- $ outputString = trim (preg_replace (self ::MORE_THAN_2_WHITESPACES_AND_NEW_LINES , ' ' , $ output ->fetch ()));
102+ $ outputString = trim (preg_replace (self ::MORE_THAN_2_WHITESPACES_AND_NEW_LINES , ' ' , $ output ->fetch ()) ?? '' );
104103
105104 self ::assertEquals (
106105 '[WARNING] Command alias "ezplatform:command" is deprecated since 3.3 and will be removed in in 4.0. Use "ibexa:command" instead. ' ,
@@ -109,16 +108,19 @@ private function assertOutputContainsDeprecationWarning(BufferedOutput $output):
109108 }
110109
111110 /**
112- * @return BackwardCompatibleCommand|Command
111+ * @param string[] $aliases
113112 */
114113 private function createBackwardCompatibleCommand (
115114 string $ name ,
116115 array $ aliases = []
117116 ): Command {
118117 return new class ($ name , $ aliases ) extends Command implements BackwardCompatibleCommand {
119118 /** @var string[] */
120- private $ deprecatedAliases ;
119+ private array $ deprecatedAliases ;
121120
121+ /**
122+ * @param string[] $deprecatedAliases
123+ */
122124 public function __construct (
123125 string $ name ,
124126 array $ deprecatedAliases
0 commit comments