The flags in fopen
calls must omit t
, and b
must be omitted or
included consistently.
Warning
Using this rule is risky.
Risky when the function fopen
is overridden.
The b
flag must be used (true
) or omitted (false
).
Allowed types: bool
Default value: true
Default configuration.
--- Original
+++ New
@@ -1,2 +1,2 @@
<?php
-$a = fopen($foo, 'rwt');
+$a = fopen($foo, 'rwb');
With configuration: ['b_mode' => false]
.
--- Original
+++ New
@@ -1,2 +1,2 @@
<?php
-$a = fopen($foo, 'rwt');
+$a = fopen($foo, 'rw');
The rule is part of the following rule sets:
- @PhpCsFixer:risky
Using the @PhpCsFixer:risky rule set will enable the
fopen_flags
rule with the config below:['b_mode' => false]
- @Symfony:risky
Using the @Symfony:risky rule set will enable the
fopen_flags
rule with the config below:['b_mode' => false]