Enable remaining rules in "f" (#4888)

This commit is contained in:
John Paul E. Balandan, CPA 2021-07-02 16:58:12 +08:00 committed by GitHub
parent 0641dd9023
commit 05988508d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 21 deletions

View File

@ -617,7 +617,7 @@ class CURLRequest extends Request
// Debug // Debug
if ($config['debug']) { if ($config['debug']) {
$curlOptions[CURLOPT_VERBOSE] = 1; $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 // Decode Content

View File

@ -177,7 +177,7 @@ class UploadedFile extends File implements UploadedFileInterface
mkdir($path, 0777, true); mkdir($path, 0777, true);
//create the index.html file //create the index.html file
if (! is_file($path . 'index.html')) { if (! is_file($path . 'index.html')) {
$file = fopen($path . 'index.html', 'x+'); $file = fopen($path . 'index.html', 'x+b');
fclose($file); fclose($file);
} }
} }

View File

@ -56,7 +56,7 @@ final class FileHandlerTest extends CIUnitTestCase
vfsStream::newFile($expected)->at(vfsStream::setup('root'))->withContent('This is a test log'); vfsStream::newFile($expected)->at(vfsStream::setup('root'))->withContent('This is a test log');
$logger->handle('warning', '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); $line = fgets($fp);
fclose($fp); fclose($fp);
@ -75,7 +75,7 @@ final class FileHandlerTest extends CIUnitTestCase
$expected = 'log-' . date('Y-m-d') . '.log'; $expected = 'log-' . date('Y-m-d') . '.log';
vfsStream::newFile($expected)->at(vfsStream::setup('root'))->withContent('Test message'); vfsStream::newFile($expected)->at(vfsStream::setup('root'))->withContent('Test message');
$logger->handle('debug', '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 $line = fgets($fp); // and get the second line
fclose($fp); fclose($fp);

View File

@ -121,23 +121,30 @@ final class CodeIgniter4 extends AbstractRuleset
'annotation_include' => ['@internal'], 'annotation_include' => ['@internal'],
'consider_absent_docblock_as_internal_class' => false, 'consider_absent_docblock_as_internal_class' => false,
], ],
'function_to_constant' => true, 'final_public_method_for_abstract_class' => false,
'heredoc_indentation' => ['indentation' => 'start_plus_one'], 'fopen_flag_order' => true,
'heredoc_to_nowdoc' => true, 'fopen_flags' => ['b_mode' => true],
'increment_style' => ['style' => 'post'], 'full_opening_tag' => true,
'indentation_type' => true, 'fully_qualified_strict_types' => true,
'lambda_not_used_import' => true, 'function_declaration' => ['closure_function_spacing' => 'one'],
'line_ending' => true, 'function_typehint_space' => true,
'linebreak_after_opening_tag' => true, 'function_to_constant' => true,
'list_syntax' => ['syntax' => 'short'], 'heredoc_indentation' => ['indentation' => 'start_plus_one'],
'logical_operators' => true, 'heredoc_to_nowdoc' => true,
'lowercase_cast' => true, 'increment_style' => ['style' => 'post'],
'lowercase_keywords' => true, 'indentation_type' => true,
'lowercase_static_reference' => true, 'lambda_not_used_import' => true,
'magic_constant_casing' => true, 'line_ending' => true,
'magic_method_casing' => true, 'linebreak_after_opening_tag' => true,
'mb_str_functions' => false, 'list_syntax' => ['syntax' => 'short'],
'method_argument_space' => [ '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, 'after_heredoc' => false,
'keep_multiple_spaces_after_comma' => false, 'keep_multiple_spaces_after_comma' => false,
'on_multiline' => 'ensure_fully_multiline', 'on_multiline' => 'ensure_fully_multiline',