Skip to content

Commit 15db0b9

Browse files
committed
Add syntax check exclusion; Clean up syntax
1 parent ecdfa17 commit 15db0b9

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

examples/receive_large_file_chunked.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ function file_get_contents_chunked($filename, $chunk_size, $callback) {
1515

1616
// Use file_get_contents_chunked() rather than file_get_contents() to avoid error:
1717
// "Fatal error: Allowed memory size of ... bytes exhausted (tried to allocate ... bytes) in ... on line 0".
18-
file_get_contents_chunked('php://input', 4096, function($chunk) use (&$file) {
18+
file_get_contents_chunked('php://input', 4096, function ($chunk) use (&$file) {
1919
fwrite($file, $chunk);
2020
});

src/Curl/Curl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,12 @@ public function setMaxFilesize($bytes)
739739
// argument to the CURLOPT_PROGRESSFUNCTION callback.
740740
$gte_v550 = version_compare(PHP_VERSION, '5.5.0') >= 0;
741741
if ($gte_v550) {
742-
$callback = function($resource, $download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
742+
$callback = function ($resource, $download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
743743
// Abort the transfer when $downloaded bytes exceeds maximum $bytes by returning a non-zero value.
744744
return $downloaded > $bytes ? 1 : 0;
745745
};
746746
} else {
747-
$callback = function($download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
747+
$callback = function ($download_size, $downloaded, $upload_size, $uploaded) use ($bytes) {
748748
return $downloaded > $bytes ? 1 : 0;
749749
};
750750
}

tests/ruleset.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
55
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
66
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
7+
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
78
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.UseOneParamPerLine" />
89
</rule>
910
</ruleset>

0 commit comments

Comments
 (0)