cs: Switch to a stricter way of coding - this might break in a lot of places.

This commit is contained in:
Pol Dellaiera
2021-11-30 13:33:18 +01:00
parent 28d2c42454
commit 47c5855a21
957 changed files with 9025 additions and 568 deletions

View File

@@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Export;
use Chill\MainBundle\Form\Type\Export\ExportType;
@@ -120,7 +129,7 @@ class ExportManager
public function &getFiltersApplyingOn(ExportInterface $export, ?array $centers = null)
{
foreach ($this->filters as $alias => $filter) {
if (in_array($filter->applyOn(), $export->supportsModifiers())
if (in_array($filter->applyOn(), $export->supportsModifiers(), true)
&& $this->isGrantedForElement($filter, $export, $centers)) {
yield $alias => $filter;
}
@@ -141,7 +150,7 @@ class ExportManager
}
foreach ($this->aggregators as $alias => $aggregator) {
if (in_array($aggregator->applyOn(), $export->supportsModifiers())
if (in_array($aggregator->applyOn(), $export->supportsModifiers(), true)
&& $this->isGrantedForElement($aggregator, $export, $centers)) {
yield $alias => $aggregator;
}
@@ -350,7 +359,7 @@ class ExportManager
$existingTypes = [];
foreach ($this->exports as $export) {
if (!in_array($export->getType(), $existingTypes)) {
if (!in_array($export->getType(), $existingTypes, true)) {
$existingTypes[] = $export->getType();
}
}
@@ -478,7 +487,7 @@ class ExportManager
public function getFormattersByTypes(array $types)
{
foreach ($this->formatters as $alias => $formatter) {
if (in_array($formatter->getType(), $types)) {
if (in_array($formatter->getType(), $types, true)) {
yield $alias => $formatter;
}
}
@@ -679,7 +688,7 @@ class ExportManager
$usedTypes = [];
foreach ($this->retrieveUsedAggregators($data) as $alias => $aggregator) {
if (!in_array($aggregator->applyOn(), $usedTypes)) {
if (!in_array($aggregator->applyOn(), $usedTypes, true)) {
$usedTypes[] = $aggregator->applyOn();
}
}
@@ -719,10 +728,10 @@ class ExportManager
$usedTypes = [];
foreach ($data as $alias => $filterData) {
if (true == $filterData['enabled']) {
if (true === $filterData['enabled']) {
$filter = $this->getFilter($alias);
if (!in_array($filter->applyOn(), $usedTypes)) {
if (!in_array($filter->applyOn(), $usedTypes, true)) {
$usedTypes[] = $filter->applyOn();
}
}