* coding style fixes

This commit is contained in:
Danyi Dávid
2021-02-20 20:55:17 +01:00
parent e9f28022c6
commit 2409ccfaaf
28 changed files with 822 additions and 487 deletions

View File

@@ -1,21 +1,20 @@
<?php
declare(strict_types=1);
namespace DoctrineMezzioModule\Form\Element;
use Laminas\Form\Element\MultiCheckbox;
use Laminas\Stdlib\ArrayUtils;
use Traversable;
use function array_map;
use function is_array;
class ObjectMultiCheckbox extends MultiCheckbox
{
/**
* @var Proxy
*/
protected $proxy;
protected Proxy $proxy;
/**
* @return Proxy
*/
public function getProxy(): Proxy
{
if (null === $this->proxy) {
@@ -52,10 +51,10 @@ class ObjectMultiCheckbox extends MultiCheckbox
{
if ($value instanceof Traversable) {
$value = ArrayUtils::iteratorToArray($value);
} elseif ($value == null) {
} elseif ($value === null) {
return parent::setValue([]);
} elseif (! is_array($value)) {
$value = (array)$value;
$value = (array) $value;
}
return parent::setValue(array_map([$this->getProxy(), 'getValue'], $value));