diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php index d1d4ace131..20e1fa3237 100644 --- a/system/HTTP/CURLRequest.php +++ b/system/HTTP/CURLRequest.php @@ -617,7 +617,7 @@ class CURLRequest extends Request // Debug if ($config['debug']) { $curlOptions[CURLOPT_VERBOSE] = 1; - $curlOptions[CURLOPT_STDERR] = is_string($config['debug']) ? fopen($config['debug'], 'a+') : fopen('php://stderr', 'w'); + $curlOptions[CURLOPT_STDERR] = is_string($config['debug']) ? fopen($config['debug'], 'a+b') : fopen('php://stderr', 'wb'); } // Decode Content diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index e73cea9238..351ffa7de2 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -177,7 +177,7 @@ class UploadedFile extends File implements UploadedFileInterface mkdir($path, 0777, true); //create the index.html file if (! is_file($path . 'index.html')) { - $file = fopen($path . 'index.html', 'x+'); + $file = fopen($path . 'index.html', 'x+b'); fclose($file); } } diff --git a/tests/system/Log/Handlers/FileHandlerTest.php b/tests/system/Log/Handlers/FileHandlerTest.php index dca8d3ad1b..ef55dcbbc6 100644 --- a/tests/system/Log/Handlers/FileHandlerTest.php +++ b/tests/system/Log/Handlers/FileHandlerTest.php @@ -56,7 +56,7 @@ final class FileHandlerTest extends CIUnitTestCase vfsStream::newFile($expected)->at(vfsStream::setup('root'))->withContent('This is a test log'); $logger->handle('warning', 'This is a test log'); - $fp = fopen($config->handlers['Tests\Support\Log\Handlers\TestHandler']['path'] . $expected, 'r'); + $fp = fopen($config->handlers['Tests\Support\Log\Handlers\TestHandler']['path'] . $expected, 'rb'); $line = fgets($fp); fclose($fp); @@ -75,7 +75,7 @@ final class FileHandlerTest extends CIUnitTestCase $expected = 'log-' . date('Y-m-d') . '.log'; vfsStream::newFile($expected)->at(vfsStream::setup('root'))->withContent('Test message'); $logger->handle('debug', 'Test message'); - $fp = fopen($config->handlers['Tests\Support\Log\Handlers\TestHandler']['path'] . $expected, 'r'); + $fp = fopen($config->handlers['Tests\Support\Log\Handlers\TestHandler']['path'] . $expected, 'rb'); $line = fgets($fp); // and get the second line fclose($fp); diff --git a/utils/PhpCsFixer/CodeIgniter4.php b/utils/PhpCsFixer/CodeIgniter4.php index 47faf8c231..09838317af 100644 --- a/utils/PhpCsFixer/CodeIgniter4.php +++ b/utils/PhpCsFixer/CodeIgniter4.php @@ -121,23 +121,30 @@ final class CodeIgniter4 extends AbstractRuleset 'annotation_include' => ['@internal'], 'consider_absent_docblock_as_internal_class' => false, ], - 'function_to_constant' => true, - 'heredoc_indentation' => ['indentation' => 'start_plus_one'], - 'heredoc_to_nowdoc' => true, - 'increment_style' => ['style' => 'post'], - 'indentation_type' => true, - 'lambda_not_used_import' => true, - 'line_ending' => true, - 'linebreak_after_opening_tag' => true, - 'list_syntax' => ['syntax' => 'short'], - 'logical_operators' => true, - 'lowercase_cast' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, - 'magic_constant_casing' => true, - 'magic_method_casing' => true, - 'mb_str_functions' => false, - 'method_argument_space' => [ + 'final_public_method_for_abstract_class' => false, + 'fopen_flag_order' => true, + 'fopen_flags' => ['b_mode' => true], + 'full_opening_tag' => true, + 'fully_qualified_strict_types' => true, + 'function_declaration' => ['closure_function_spacing' => 'one'], + 'function_typehint_space' => true, + 'function_to_constant' => true, + 'heredoc_indentation' => ['indentation' => 'start_plus_one'], + 'heredoc_to_nowdoc' => true, + 'increment_style' => ['style' => 'post'], + 'indentation_type' => true, + 'lambda_not_used_import' => true, + 'line_ending' => true, + 'linebreak_after_opening_tag' => true, + 'list_syntax' => ['syntax' => 'short'], + 'logical_operators' => true, + 'lowercase_cast' => true, + 'lowercase_keywords' => true, + 'lowercase_static_reference' => true, + 'magic_constant_casing' => true, + 'magic_method_casing' => true, + 'mb_str_functions' => false, + 'method_argument_space' => [ 'after_heredoc' => false, 'keep_multiple_spaces_after_comma' => false, 'on_multiline' => 'ensure_fully_multiline',