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
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

View File

@ -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);
}
}

View File

@ -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);

View File

@ -121,6 +121,13 @@ final class CodeIgniter4 extends AbstractRuleset
'annotation_include' => ['@internal'],
'consider_absent_docblock_as_internal_class' => false,
],
'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,