vendor/ckfinder/ckfinder-symfony-bundle/Config/Definition/Builder/VariableArrayNodeDefinition.php line 32

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is a part of the CKFinder bundle for Symfony.
  4.  *
  5.  * Copyright (C) 2016, CKSource - Frederico Knabben. All rights reserved.
  6.  *
  7.  * Licensed under the terms of the MIT license.
  8.  * For the full copyright and license information, please view the LICENSE.txt
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace CKSource\Bundle\CKFinderBundle\Config\Definition\Builder;
  12. use CKSource\Bundle\CKFinderBundle\Config\Definition\VariableArrayNode;
  13. use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition;
  14. /**
  15.  * Provides an interface for defining an array node with any values.
  16.  */
  17. class VariableArrayNodeDefinition extends VariableNodeDefinition
  18. {
  19.     /**
  20.      * Keys required in variable array node
  21.      *
  22.      * @var array
  23.      */
  24.     protected $requiredKeys = array();
  25.     /**
  26.      * {@inheritdoc}
  27.      */
  28.     protected function instantiateNode()
  29.     {
  30.         return new VariableArrayNode($this->name$this->parent$this->requiredKeys);
  31.     }
  32.     /**
  33.      * Sets array keys that must be present
  34.      *
  35.      * @param array $requiredKeys
  36.      *
  37.      * @return $this
  38.      */
  39.     public function requiresKeys(array $requiredKeys)
  40.     {
  41.         $this->requiredKeys $requiredKeys;
  42.         return $this;
  43.     }
  44. }