@@ -46,7 +46,7 @@ |
||
46 | 46 | * @param bool $auth |
47 | 47 | * @return resource<curl> |
48 | 48 | */ |
49 | - public static function getConnection($origin, $auth=false) |
|
49 | + public static function getConnection($origin, $auth = false) |
|
50 | 50 | { |
51 | 51 | $instance = self::getInstance(); |
52 | 52 | if ($auth) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return bool true |
58 | 58 | */ |
59 | - public function copy($origin, $fileUrl, $fileName, $progress=true, $options=array()) |
|
59 | + public function copy($origin, $fileUrl, $fileName, $progress = true, $options = array()) |
|
60 | 60 | { |
61 | 61 | return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request) use($fileName){ |
62 | 62 | $fp = $this->createFile($fileName); |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return bool|string The content |
88 | 88 | */ |
89 | - public function getContents($origin, $fileUrl, $progress=true, $options=array()) |
|
89 | + public function getContents($origin, $fileUrl, $progress = true, $options = array()) |
|
90 | 90 | { |
91 | - return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request){ |
|
91 | + return $this->fetch($origin, $fileUrl, $progress, $options, function($ch, $request) { |
|
92 | 92 | // This order is important. |
93 | 93 | curl_setopt($ch, CURLOPT_FILE, STDOUT); |
94 | 94 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | $config = $this->config->get('prestissimo'); |
110 | - if (! is_array($config)) { |
|
110 | + if (!is_array($config)) { |
|
111 | 111 | $config = array(); |
112 | 112 | } |
113 | 113 | $config += array( |
@@ -118,16 +118,16 @@ discard block |
||
118 | 118 | 'privatePackages' => array(), |
119 | 119 | ); |
120 | 120 | |
121 | - if (! is_int($config['maxConnections']) || $config['maxConnections'] < 1) { |
|
121 | + if (!is_int($config['maxConnections']) || $config['maxConnections'] < 1) { |
|
122 | 122 | $config['maxConnections'] = 6; |
123 | 123 | } |
124 | - if (! is_int($config['minConnections']) || $config['minConnections'] > $config['maxConnections']) { |
|
124 | + if (!is_int($config['minConnections']) || $config['minConnections'] > $config['maxConnections']) { |
|
125 | 125 | $config['minConnections'] = 3; |
126 | 126 | } |
127 | - if (! is_bool($config['pipeline'])) { |
|
127 | + if (!is_bool($config['pipeline'])) { |
|
128 | 128 | $config['pipeline'] = (bool)$config['pipeline']; |
129 | 129 | } |
130 | - if (! is_array($config['privatePackages'])) { |
|
130 | + if (!is_array($config['privatePackages'])) { |
|
131 | 131 | $config['privatePackages'] = (array)$config['privatePackages']; |
132 | 132 | } |
133 | 133 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function importURL($url) |
64 | 64 | { |
65 | 65 | $struct = parse_url($url); |
66 | - if (! $struct) throw new \InvalidArgumentException("$url is not valid URL"); |
|
66 | + if (!$struct) throw new \InvalidArgumentException("$url is not valid URL"); |
|
67 | 67 | |
68 | 68 | $this->scheme = self::setOr($struct, 'scheme', $this->scheme); |
69 | 69 | $this->host = self::setOr($struct, 'host', $this->host); |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | $this->username = self::setOr($struct, 'user', null); |
73 | 73 | $this->password = self::setOr($struct, 'pass', null); |
74 | 74 | |
75 | - if (! empty($struct['query'])) { |
|
75 | + if (!empty($struct['query'])) { |
|
76 | 76 | parse_str($struct['query'], $this->query); |
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | 80 | // utility for __construct |
81 | - private static function setOr(array $struct, $key, $default=null) |
|
81 | + private static function setOr(array $struct, $key, $default = null) |
|
82 | 82 | { |
83 | 83 | if (!empty($struct[$key])) { |
84 | 84 | return $struct[$key]; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | CURLOPT_USERAGENT => $this->genUA(), |
99 | 99 | ); |
100 | 100 | |
101 | - $curlOpts[CURLOPT_VERBOSE] = (bool) $this->verbose; |
|
101 | + $curlOpts[CURLOPT_VERBOSE] = (bool)$this->verbose; |
|
102 | 102 | |
103 | 103 | if ($this->username && $this->password) { |
104 | 104 | $curlOpts[CURLOPT_USERPWD] = "$this->username:$this->password"; |