vendor/symfony/form/Extension/DataCollector/Proxy/ResolvedTypeFactoryDataCollectorProxy.php line 25

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\Form\Extension\DataCollector\Proxy;
  11. use Symfony\Component\Form\Extension\DataCollector\FormDataCollectorInterface;
  12. use Symfony\Component\Form\FormTypeInterface;
  13. use Symfony\Component\Form\ResolvedFormTypeFactoryInterface;
  14. use Symfony\Component\Form\ResolvedFormTypeInterface;
  15. /**
  16.  * Proxy that wraps resolved types into {@link ResolvedTypeDataCollectorProxy}
  17.  * instances.
  18.  *
  19.  * @author Bernhard Schussek <bschussek@gmail.com>
  20.  */
  21. class ResolvedTypeFactoryDataCollectorProxy implements ResolvedFormTypeFactoryInterface
  22. {
  23.     private $proxiedFactory;
  24.     private $dataCollector;
  25.     public function __construct(ResolvedFormTypeFactoryInterface $proxiedFactoryFormDataCollectorInterface $dataCollector)
  26.     {
  27.         $this->proxiedFactory $proxiedFactory;
  28.         $this->dataCollector $dataCollector;
  29.     }
  30.     /**
  31.      * {@inheritdoc}
  32.      */
  33.     public function createResolvedType(FormTypeInterface $type, array $typeExtensionsResolvedFormTypeInterface $parent null)
  34.     {
  35.         return new ResolvedTypeDataCollectorProxy(
  36.             $this->proxiedFactory->createResolvedType($type$typeExtensions$parent),
  37.             $this->dataCollector
  38.         );
  39.     }
  40. }