PHP 8.2.31
Preview: FormCollectionAnalyzer.php Size: 1.21 KB
/opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/rector/rector-symfony/src/NodeAnalyzer/FormCollectionAnalyzer.php

<?php

declare (strict_types=1);
namespace Rector\Symfony\NodeAnalyzer;

use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\MethodCall;
use Rector\NodeNameResolver\NodeNameResolver;
use Rector\PhpParser\Node\Value\ValueResolver;
final class FormCollectionAnalyzer
{
    /**
     * @readonly
     * @var \Rector\PhpParser\Node\Value\ValueResolver
     */
    private $valueResolver;
    /**
     * @readonly
     * @var \Rector\NodeNameResolver\NodeNameResolver
     */
    private $nodeNameResolver;
    public function __construct(ValueResolver $valueResolver, NodeNameResolver $nodeNameResolver)
    {
        $this->valueResolver = $valueResolver;
        $this->nodeNameResolver = $nodeNameResolver;
    }
    public function isCollectionType(MethodCall $methodCall) : bool
    {
        $typeValue = $methodCall->getArgs()[1]->value;
        if (!$typeValue instanceof ClassConstFetch) {
            return $this->valueResolver->isValue($typeValue, 'collection');
        }
        if (!$this->nodeNameResolver->isName($typeValue->class, 'Symfony\\Component\\Form\\Extension\\Core\\Type\\CollectionType')) {
            return $this->valueResolver->isValue($typeValue, 'collection');
        }
        return \true;
    }
}

Directory Contents

Dirs: 2 × Files: 12

Name Size Perms Modified Actions
- drwxr-xr-x 2024-11-08 13:59:10
Edit Download
FormType DIR
- drwxr-xr-x 2024-11-08 13:59:10
Edit Download
730 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
3.83 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.49 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.21 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
3.62 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
508 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.43 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
5.08 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.52 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
3.12 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
2.62 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
1.18 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).