@@ -849,7 +849,6 @@ public function makeScreenshot($name = null)
849
849
*
850
850
* @throws \RuntimeException
851
851
* @return string
852
- * @SuppressWarnings(PHPMD.UnusedPrivateMethod)
853
852
*/
854
853
private function shellExecMagentoCLI ($ magentoBinary , $ command , $ timeout , $ arguments ): string
855
854
{
@@ -870,10 +869,8 @@ private function shellExecMagentoCLI($magentoBinary, $command, $timeout, $argume
870
869
if (empty ($ output )) {
871
870
$ output = "CLI did not return output. " ;
872
871
}
873
-
874
872
} catch (ProcessTimedOutException $ exception ) {
875
873
$ output = "CLI command timed out, no output available. " ;
876
-
877
874
}
878
875
879
876
if ($ this ->checkForFilePath ($ output )) {
@@ -933,21 +930,25 @@ private function curlExecMagentoCLI($command, $timeout, $arguments): string
933
930
934
931
/**
935
932
* Checks magento list of CLI commands for given $command. Does not check command parameters, just base command.
933
+ *
936
934
* @param string $magentoBinary
937
935
* @param string $command
938
- * @return bool
936
+ *
937
+ * @return boolean
939
938
*/
940
939
private function validateCommand ($ magentoBinary , $ command )
941
940
{
942
941
exec ($ magentoBinary . ' list ' , $ commandList );
943
942
// Trim list of commands after first whitespace
944
- $ commandList = array_map (array ( $ this , 'trimAfterWhitespace ' ) , $ commandList );
943
+ $ commandList = array_map ([ $ this , 'trimAfterWhitespace ' ] , $ commandList );
945
944
return in_array ($ this ->trimAfterWhitespace ($ command ), $ commandList );
946
945
}
947
946
948
947
/**
949
948
* Returns given string trimmed of everything after the first found whitespace.
949
+ *
950
950
* @param string $string
951
+ *
951
952
* @return string
952
953
*/
953
954
private function trimAfterWhitespace ($ string )
@@ -957,13 +958,13 @@ private function trimAfterWhitespace($string)
957
958
958
959
/**
959
960
* Detects file path in string.
961
+ *
960
962
* @param string $string
963
+ *
961
964
* @return boolean
962
965
*/
963
966
private function checkForFilePath ($ string )
964
967
{
965
968
return preg_match ('/\/[\S]+\// ' , $ string );
966
969
}
967
-
968
- }
969
-
970
+ }
0 commit comments