piwik/vendor/mnapoli/php-di/src/DI/Definition/Helper/ClassDefinitionHelper.php
/**
     * Fixes parameters indexed by the parameter name -> reindex by position.
     *
     * This is necessary so that merging definitions between sources is possible.
     *
     * @param ClassDefinition $definition
     * @param string          $method
     * @param array           $parameters
     * @return array
     */
Fixes parameters indexed by the parameter name -> reindex by position.
This is necessary so that merging definitions between sources is possible.

@param ClassDefinition $definition
@param string          $method
@param array           $parameters
@return array
Fixes parameters indexed by the parameter name - > reindex by position . This is necessary so that merging definitions between sources is possible . @param ClassDefinition $definition @param string $method @param array $parameters @return array
private function fixParameters(ClassDefinition $definition, $method, $parameters)
    {
        $fixedParameters = array();
        foreach ($parameters as $index => $parameter) {
            if (is_string($index)) {
                $callable = array($definition->getClassName(), $method);
                $reflectionParameter = new \ReflectionParameter($callable, $index);
                $index = $reflectionParameter->getPosition();
            }
            $fixedParameters[$index] = $parameter;
        }
        return $fixedParameters;
    }
private function fixParameters ( ClassDefinition $ definition , $ method , $ parameters ) { $ fixedParameters = array ( ) ; foreach ( $ parameters as $ index => $ parameter ) { if ( is_string ( $ index ) ) { $ callable = array ( $ definition -> getClassName ( ) , $ method ) ; $ reflectionParameter = new \ ReflectionParameter ( $ callable , $ index ) ; $ index = $ reflectionParameter -> getPosition ( ) ; } $ fixedParameters [ $ index ] = $ parameter ; } return $ fixedParameters ; }
Fixes parameters indexed by the parameter name -> reindex by position.
Fixes parameters indexed by the parameter name - > reindex by position .
// Parameter indexed by the parameter name, we reindex it with its position