mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 04:53:49 +00:00
cs: Switch to a stricter way of coding - this might break in a lot of places.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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';
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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';
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user