Completed
Pull Request — master (#6)
by
unknown
05:44
created
src/S3BucketStreamZip.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
    *   secret: your_aws_secret
30 30
    * }
31 31
    */
32
-  private $auth   = array();
32
+  private $auth = array();
33 33
 
34 34
   /**
35 35
    * @var array
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
   public function __construct($auth, $params)
60 60
   {
61 61
     // We require the AWS key to be passed in $auth.
62
-    if(!isset($auth['key']))
62
+    if (!isset($auth['key']))
63 63
       throw new InvalidParameterException('$auth parameter to constructor requires a `key` attribute');
64 64
 
65 65
     // We require the AWS secret to be passed in $auth.
66
-    if(!isset($auth['secret']))
66
+    if (!isset($auth['secret']))
67 67
       throw new InvalidParameterException('$auth parameter to constructor requires a `secret` attribute');
68 68
 
69 69
     // We require the AWS S3 bucket to be passed in $params.
70
-    if(!isset($params['Bucket']))
70
+    if (!isset($params['Bucket']))
71 71
       throw new InvalidParameterException('$params parameter to constructor requires a `Bucket` attribute (with a capital B)');
72 72
 
73 73
     $this->auth   = $auth;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
   public function send($filename, $params = array())
89 89
   {
90 90
     // Set default values for the optional $params argument
91
-    if(!isset($params['expiration']))
91
+    if (!isset($params['expiration']))
92 92
       $params['expiration'] = '+10 minutes';
93 93
 
94 94
     // Initialize the ZipStream object and pass in the file name which
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     $result = $this->s3Client->getIterator('ListObjects', $this->params);
103 103
 
104 104
     // We loop over each object from the ListObjects call.
105
-    foreach($result as $file)
105
+    foreach ($result as $file)
106 106
     {
107 107
       // We need to use a command to get a request for the S3 object
108 108
       //  and then we can get the presigned URL.
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
       curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
132 132
       curl_exec($ch);
133 133
       curl_close($ch);
134
-      fseek($fp,0);
134
+      fseek($fp, 0);
135 135
       $zip->addFileFromStream($fileName, $fp);
136 136
       fclose($fp);
137 137
     }
Please login to merge, or discard this patch.