mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-14 12:26:51 +00:00
Add syntax check exclusion; Clean up syntax
This commit is contained in:
@@ -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
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user