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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;

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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;
@@ -90,7 +99,7 @@ class CustomFieldChoice extends AbstractCustomField
];
//if allow_other = true
if (true == $customFieldOptions[self::ALLOW_OTHER]) {
if (true === $customFieldOptions[self::ALLOW_OTHER]) {
$otherValueLabel = null;
if (array_key_exists(self::OTHER_VALUE_LABEL, $customFieldOptions)) {
@@ -233,10 +242,10 @@ class CustomFieldChoice extends AbstractCustomField
if ($cf->getOptions()[self::MULTIPLE]) {
if ($cf->getOptions()[self::ALLOW_OTHER]) {
return in_array($choiceSlug, $this->deserialize($data, $cf)['_choices']);
return in_array($choiceSlug, $this->deserialize($data, $cf)['_choices'], true);
}
return in_array($choiceSlug, $this->deserialize($data, $cf));
return in_array($choiceSlug, $this->deserialize($data, $cf), true);
}
if ($cf->getOptions()[self::ALLOW_OTHER]) {
@@ -295,13 +304,13 @@ class CustomFieldChoice extends AbstractCustomField
$selected = (is_array($data)) ? $data : [$data];
$choices = $customField->getOptions()[self::CHOICES];
if (in_array('_other', $selected)) {
if (in_array('_other', $selected, true)) {
$choices[] = ['name' => $value['_other'], 'slug' => '_other'];
}
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:choice.html.twig';
if ('csv' == $documentType) {
if ('csv' === $documentType) {
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:choice.csv.twig';
}

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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;

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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;

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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;

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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;
@@ -103,7 +112,7 @@ class CustomFieldText extends AbstractCustomField
{
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:text.html.twig';
if ('csv' == $documentType) {
if ('csv' === $documentType) {
$template = 'ChillCustomFieldsBundle:CustomFieldsRendering:text.csv.twig';
}

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\CustomFieldsBundle\CustomFields;
use Chill\CustomFieldsBundle\Entity\CustomField;