cs: Enable more risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-30 12:09:24 +01:00
parent 6ce511889f
commit 579c349e28
22 changed files with 29 additions and 15 deletions

View File

@@ -21,6 +21,7 @@ use function array_keys;
use function array_search;
use function count;
use function in_array;
use const ARRAY_FILTER_USE_BOTH;
class CRUDRoutesLoader extends Loader
{

View File

@@ -196,7 +196,7 @@ class LoadPostalCodesCommand extends Command
. 'have the right to read it.');
}
$resource = fopen($filename, 'r');
$resource = fopen($filename, 'rb');
if (false == $resource) {
throw new RuntimeException("The file '{$filename}' could not be opened.");

View File

@@ -228,7 +228,7 @@ class CSVFormatter implements FormatterInterface
$content = [];
// create a file pointer connected to the output stream
$output = fopen('php://output', 'w');
$output = fopen('php://output', 'wb');
//title
fputcsv($output, [$this->translator->trans($this->export->getTitle())]);

View File

@@ -115,7 +115,7 @@ class CSVListFormatter implements FormatterInterface
$this->exportData = $exportData;
$this->formatterData = $formatterData;
$output = fopen('php://output', 'w');
$output = fopen('php://output', 'wb');
$this->prepareHeaders($output);

View File

@@ -110,7 +110,7 @@ class CSVPivotedListFormatter implements FormatterInterface
$this->exportData = $exportData;
$this->formatterData = $formatterData;
$output = fopen('php://output', 'w');
$output = fopen('php://output', 'wb');
$i = 1;
$lines = [];

View File

@@ -204,7 +204,7 @@ class SpreadSheetFormatter implements FormatterInterface
$this->tempfile = tempnam(sys_get_temp_dir(), '');
$this->generateContent();
$f = fopen($this->tempfile, 'r');
$f = fopen($this->tempfile, 'rb');
$response->setContent(stream_get_contents($f));
fclose($f);

View File

@@ -199,7 +199,7 @@ class SpreadsheetListFormatter implements FormatterInterface
$tempfile = tempnam(sys_get_temp_dir(), '');
$writer->save($tempfile);
$f = fopen($tempfile, 'r');
$f = fopen($tempfile, 'rb');
$response->setContent(stream_get_contents($f));
fclose($f);

View File

@@ -17,6 +17,8 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
use const SORT_FLAG_CASE;
use const SORT_STRING;
/**
* Extends choice to allow adding select2 library on widget.

View File

@@ -17,6 +17,8 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsResolver\OptionsResolver;
use const SORT_FLAG_CASE;
use const SORT_STRING;
/**
* Extends choice to allow adding select2 library on widget for languages (multiple).

View File

@@ -15,6 +15,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
use function get_class;
use function in_array;
use const E_USER_DEPRECATED;
/**
* Voter for Chill software.

View File

@@ -22,6 +22,7 @@ use function array_unique;
use function array_values;
use function count;
use function ksort;
use const PHP_INT_MAX;
/**
* Utilities to compare date periods.