apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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;