Completed
Push — master ( d342b9...3a6611 )
by Kamil
03:10
created
example/sftp_async_write.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@
 block discarded – undo
37 37
     $file->write();
38 38
     $file->on('drain', function(SSH2ResourceInterface $file) use(&$lines, &$linesPointer) {
39 39
         echo "# PART OF THE DATA HAS BEEN WRITTEN\n";
40
-        if ($linesPointer < count($lines)) {
40
+        if ($linesPointer < count($lines))
41
+        {
41 42
             $file->write($lines[$linesPointer++]);
42 43
         }
43 44
     });
Please login to merge, or discard this patch.
example/ssh_async_multi_command.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
 use Dazzle\SSH\SSH2Interface;
20 20
 use Dazzle\SSH\SSH2ResourceInterface;
21 21
 
22
-function executeCommand(SSH2DriverInterface $shell, $shellCommand) {
22
+function executeCommand(SSH2DriverInterface $shell, $shellCommand)
23
+{
23 24
 
24 25
     $buffer = '';
25 26
     $command = $shell->open();
@@ -49,12 +50,14 @@  discard block
 block discarded – undo
49 50
     $commandsRemain = count($commands);
50 51
 
51 52
     $shell->on('resource:close', function(SSH2DriverInterface $shell) use(&$commandsRemain) {
52
-        if (--$commandsRemain === 0) {
53
+        if (--$commandsRemain === 0)
54
+        {
53 55
             $shell->disconnect();
54 56
         }
55 57
     });
56 58
 
57
-    foreach ($commands as $command) {
59
+    foreach ($commands as $command)
60
+    {
58 61
         executeCommand($shell, $command);
59 62
     }
60 63
 });
Please login to merge, or discard this patch.