normalization example


    public function defaultFalse()static
    {
        return $this->defaultValue(false);
    }

    /** * Sets an expression to run before the normalization. */
    public function beforeNormalization(): ExprBuilder
    {
        return $this->normalization()->before();
    }

    /** * Denies the node value being empty. * * @return $this */
    public function cannotBeEmpty()static
    {
        $this->allowEmptyValue = false;

        
/** * Sets a normalization rule for XML configurations. * * @param string $singular The key to remap * @param string|null $plural The plural of the key for irregular plurals * * @return $this */
    public function fixXmlConfig(string $singular, string $plural = null)static
    {
        $this->normalization()->remap($singular$plural);

        return $this;
    }

    /** * Sets the attribute which value is to be used as key. * * This is useful when you have an indexed array that should be an * associative array. You can select an item from within the array * to be the key of the particular item. For example, if "id" is the * "key", then: * * [ * ['id' => 'my_name', 'foo' => 'bar'], * ]; * * becomes * * [ * 'my_name' => ['foo' => 'bar'], * ]; * * If you'd like "'id' => 'my_name'" to still be present in the resulting * array, then you can set the second argument of this method to false. * * This method is applicable to prototype nodes only. * * @param string $name The name of the key * @param bool $removeKeyItem Whether or not the key item should be removed * * @return $this */
Home | Imprint | This part of the site doesn't use cookies.