Add syntax check exclusion; Clean up syntax

This commit is contained in:
Zach Borboa
2016-09-27 00:28:57 -07:00
parent ecdfa174cb
commit 15db0b95a3
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -15,6 +15,6 @@ $file = fopen($tmpnam, 'wb+');
// Use file_get_contents_chunked() rather than file_get_contents() to avoid error:
// "Fatal error: Allowed memory size of ... bytes exhausted (tried to allocate ... bytes) in ... on line 0".
file_get_contents_chunked('php://input', 4096, function($chunk) use (&$file) {
file_get_contents_chunked('php://input', 4096, function ($chunk) use (&$file) {
fwrite($file, $chunk);
});
+2 -2
View File
@@ -739,12 +739,12 @@ class Curl
// argument to the CURLOPT_PROGRESSFUNCTION callback.
$gte_v550 = version_compare(PHP_VERSION, '5.5.0') >= 0;
if ($gte_v550) {
$callback = function($resource, $download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
$callback = function ($resource, $download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
// Abort the transfer when $downloaded bytes exceeds maximum $bytes by returning a non-zero value.
return $downloaded > $bytes ? 1 : 0;
};
} else {
$callback = function($download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
$callback = function ($download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
return $downloaded > $bytes ? 1 : 0;
};
}
+1
View File
@@ -4,6 +4,7 @@
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.UseOneParamPerLine" />
</rule>
</ruleset>