@@ -72,20 +72,23 @@ protected function distribute(Split $cli): bool
7272 $ this ->remove ($ this ->output );
7373 $ cli ->chdir ($ this ->directory );
7474 @mkdir ($ this ->output , 0777 , true );
75- $ this ->output = @realpath ($ this ->output );
75+ /** @psalm-var truthy-string|false $output */
76+ $ output = @realpath ($ this ->output );
7677
77- if (!$ this -> output ) {
78+ if (!$ output ) {
7879 return $ cli ->error ('Unable to create output directory. ' );
7980 }
8081
81- if (!preg_match ('/^\* (.+)$/m ' , (string ) $ this ->git ('branch ' , [], '2>&1 ' ) ?: '' , $ branch )) {
82+ $ this ->output = $ output ;
83+
84+ if (!preg_match ('/^\* (.+)$/m ' , $ this ->git ('branch ' , [], '2>&1 ' ) ?: '' , $ branch )) {
8285 return $ cli ->error ('You must be on a branch in a git repository to run this command. ' );
8386 }
8487
8588 $ branch = $ branch [1 ];
8689
8790 if (substr ($ branch , 0 , 18 ) === '(HEAD detached at ' ) {
88- $ branch = trim (explode ("\n" , ( string ) $ this ->git ('describe --contains --all HEAD ' , [], '2>&1 ' ) ?: '' )[0 ]);
91+ $ branch = trim (explode ("\n" , $ this ->git ('describe --contains --all HEAD ' , [], '2>&1 ' ) ?: '' )[0 ]);
8992 }
9093
9194 foreach ($ this ->getPackages () as $ package ) {
@@ -103,7 +106,7 @@ protected function distributePackage(Split $cli, array $package, string $branch)
103106
104107 $ name = (string ) $ package ['name ' ];
105108
106- $ data = (array ) json_decode (file_get_contents (strtr ($ this ->api , ['%s ' => $ name ])), true );
109+ $ data = (array ) json_decode (( string ) file_get_contents (strtr ($ this ->api , ['%s ' => $ name ])), true );
107110 $ config = $ data ['packages ' ][$ name ] ?? [];
108111 $ config = $ config ['dev-master ' ] ?? next ($ config );
109112
0 commit comments