protected function doInclusions(&$value, $key, string $baseDirectory)
    {
        if (!is_string($value)) {
            return;
        }

        $matches = [];
        if (preg_match(sprintf('/^\s*%1$s(?<action>include|extends)\:(?<var>[\w\-\.\,\s]+)%1$s\s*$/i', preg_quote(self::TAG)), $value, $matches) != 1) {
            return;
        }

        try {
            switch ($matches['action']) {
                case 'include':
                    $value = $this->load($matches['var'], true, $baseDirectory);
                    break;
                case 'extends':
                    $files = explode(',', $matches['var']);
                    $files = array_map('trim', $files);
                    $files = array_map(
                        function ($file) use ($baseDirectory) {
                            return $this->load($file, true, $baseDirectory);
                        },
                        $files);

                    $value = call_user_func_array('b_array_merge_recursive', $files);
                    break;
            }
        } catch (\Exception $e) {
            throw new ConfigException(sprintf('Unable to do action of config line "%s"', $value), 0, $e);
        }
    }
protected function doInclusions(&$value, $key, string $baseDirectory)
    {
        if (!is_string($value)) {
            return;
        }

        $matches = [];
        if (preg_match(sprintf('/^\s*%1$s(?<action>include|extends)\:(?<var>[\w\-\.\,\s]+)%1$s\s*$/i', preg_quote(self::TAG)), $value, $matches) != 1) {
            return;
        }

        try {
            switch ($matches['action']) {
                case 'include':
                    $value = $this->load($matches['var'], true, $baseDirectory);
                    break;
                case 'extends':
                    $files = explode(',', $matches['var']);
                    $files = array_map('trim', $files);
                    $files = array_map(
                        function ($file) use ($baseDirectory) {
                            return $this->load($file, true, $baseDirectory);
                        },
                        $files);

                    $value = call_user_func_array('b_array_merge_recursive', $files);
                    break;
            }
        } catch (\Exception $e) {
            throw new ConfigException(sprintf('Unable to do action of config line "%s"', $value), 0, $e);
        }
    }
protected function doInclusions ( & $ value , $ key , string $ baseDirectory ) { if ( ! is_string ( $ value ) ) { return ; } $ matches = [ ] ; if ( preg_match ( sprintf ( '/^\s*%1$s(?<action>include|extends)\:(?<var>[\w\-\.\,\s]+)%1$s\s*$/i' , preg_quote ( self :: TAG ) ) , $ value , $ matches ) != 1 ) { return ; } try { switch ( $ matches [ 'action' ] ) { case 'include' : $ value = $ this -> load ( $ matches [ 'var' ] , true , $ baseDirectory ) ; break ; case 'extends' : $ files = explode ( ',' , $ matches [ 'var' ] ) ; $ files = array_map ( 'trim' , $ files ) ; $ files = array_map ( function ( $ file ) use ( $ baseDirectory ) { return $ this -> load ( $ file , true , $ baseDirectory ) ; } , $ files ) ; $ value = call_user_func_array ( 'b_array_merge_recursive' , $ files ) ; break ; } } catch ( \ Exception $ e ) { throw new ConfigException ( sprintf ( 'Unable to do action of config line "%s"' , $ value ) , 0 , $ e ) ; } }
Do inclusions.

@param mixed  $value
@param string $baseDirectory Base directory

@throws \Berlioz\Config\Exception\ConfigException
Do inclusions .