mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -12,10 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\DocGeneratorBundle\Serializer\Encoder;
|
||||
|
||||
use Symfony\Component\Serializer\Encoder\EncoderInterface;
|
||||
|
||||
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||
use function array_keys;
|
||||
use function is_array;
|
||||
|
||||
class DocGenEncoder implements EncoderInterface
|
||||
{
|
||||
@@ -38,21 +35,21 @@ class DocGenEncoder implements EncoderInterface
|
||||
|
||||
private function canonicalizeKey(string $path, string $key): string
|
||||
{
|
||||
return '' === $path ? $key : $path . '_' . $key;
|
||||
return '' === $path ? $key : $path.'_'.$key;
|
||||
}
|
||||
|
||||
private function isAssociative(array $data)
|
||||
{
|
||||
$keys = array_keys($data);
|
||||
$keys = \array_keys($data);
|
||||
|
||||
return array_keys($keys) !== $keys;
|
||||
return \array_keys($keys) !== $keys;
|
||||
}
|
||||
|
||||
private function recusiveEncoding(array $data, array &$result, $path)
|
||||
{
|
||||
if ($this->isAssociative($data)) {
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
if (\is_array($value)) {
|
||||
$this->recusiveEncoding($value, $result, $this->canonicalizeKey($path, $key));
|
||||
} else {
|
||||
$result[$this->canonicalizeKey($path, $key)] = $value;
|
||||
|
Reference in New Issue
Block a user