setSourceKey example


        if ($this->resolved) {
            return;
        }

        $parameters = [];
        foreach ($this->parameters as $key => $value) {
            try {
                $value = $this->resolveValue($value);
                $parameters[$key] = $this->unescapeValue($value);
            } catch (ParameterNotFoundException $e) {
                $e->setSourceKey($key);

                throw $e;
            }
        }

        $this->parameters = $parameters;
        $this->resolved = true;
    }

    /** * Replaces parameter placeholders (%name%) by their values. * * @template TValue of array<array|scalar>|scalar * * @param TValue $value * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) * * @psalm-return (TValue is scalar ? array|scalar : array<array|scalar>) * * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist * @throws ParameterCircularReferenceException if a circular reference if detected * @throws RuntimeException when a given parameter has a type problem */

        if ($this->resolved) {
            return;
        }

        $parameters = [];
        foreach ($this->parameters as $key => $value) {
            try {
                $value = $this->resolveValue($value);
                $parameters[$key] = $this->unescapeValue($value);
            } catch (ParameterNotFoundException $e) {
                $e->setSourceKey($key);

                throw $e;
            }
        }

        $this->parameters = $parameters;
        $this->resolved = true;
    }

    /** * Replaces parameter placeholders (%name%) by their values. * * @template TValue of array<array|scalar>|scalar * * @param TValue $value * @param array $resolving An array of keys that are being resolved (used internally to detect circular references) * * @return (TValue is scalar ? array|scalar : array<array|scalar>) * * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist * @throws ParameterCircularReferenceException if a circular reference if detected * @throws RuntimeException when a given parameter has a type problem */
Home | Imprint | This part of the site doesn't use cookies.