private function setJsonDefaults(array $json)
    {
        $config = $this->app['config'];
        $pathResolver = $this->app['path_resolver'];

        $rootPath = $pathResolver->resolve('root');
        $extensionsPath = $pathResolver->resolve('extensions');
        $webPath = $pathResolver->resolve('web');
        $pathToRoot = Path::makeRelative($rootPath, $extensionsPath);
        $pathToWeb = Path::makeRelative($webPath, $extensionsPath);
        $pathToListeners = Path::makeRelative(__DIR__ . '/EventListener', $extensionsPath);
        /** @deprecated Handle BC on 'stability' key until 4.0 */
        $minimumStability = $config->get('general/extensions/stability') ?: $config->get('general/extensions/composer/minimum-stability', 'stable');

        $config = $config->get('general/extensions/composer/config', []) + [
            'discard-changes'   => true,
            'preferred-install' => 'dist',
        ];

        // Enforce standard settings
        $defaults = [
            'name'         => 'bolt/extensions',
            'description'  => 'Bolt extension installation interface',
            'license'      => 'MIT',
            'repositories' => [
                'packagist' => false,
                'bolt'      => [
                    'type' => 'composer',
                    'url'  => $this->app['extend.site'] . 'satis/',
                ],
            ],
            'minimum-stability' => $minimumStability,
            'prefer-stable'     => true,
            'config'            => $config,
            'provide'           => [
                'bolt/bolt' => Bolt\Version::forComposer(),
            ],
            'extra' => [
                'bolt-web-path'  => $pathToWeb,
                'bolt-root-path' => $pathToRoot,
            ],
            'autoload' => [
                'psr-4' => [
                    'Bolt\\Composer\\EventListener\\' => $pathToListeners,
                ],
            ],
            'scripts' => [
                'post-autoload-dump'   => 'Bolt\\Composer\\EventListener\\PackageEventListener::dump',
                'post-package-install' => 'Bolt\\Composer\\EventListener\\PackageEventListener::handle',
                'post-package-update'  => 'Bolt\\Composer\\EventListener\\PackageEventListener::handle',
            ],
        ];
        $json = Arr::replaceRecursive($json, $defaults);
        ksort($json);

        return $json;
    }
private function setJsonDefaults(array $json)
    {
        $config = $this->app['config'];
        $pathResolver = $this->app['path_resolver'];

        $rootPath = $pathResolver->resolve('root');
        $extensionsPath = $pathResolver->resolve('extensions');
        $webPath = $pathResolver->resolve('web');
        $pathToRoot = Path::makeRelative($rootPath, $extensionsPath);
        $pathToWeb = Path::makeRelative($webPath, $extensionsPath);
        $pathToListeners = Path::makeRelative(__DIR__ . '/EventListener', $extensionsPath);
        /** @deprecated Handle BC on 'stability' key until 4.0 */
        $minimumStability = $config->get('general/extensions/stability') ?: $config->get('general/extensions/composer/minimum-stability', 'stable');

        $config = $config->get('general/extensions/composer/config', []) + [
            'discard-changes'   => true,
            'preferred-install' => 'dist',
        ];

        // Enforce standard settings
        $defaults = [
            'name'         => 'bolt/extensions',
            'description'  => 'Bolt extension installation interface',
            'license'      => 'MIT',
            'repositories' => [
                'packagist' => false,
                'bolt'      => [
                    'type' => 'composer',
                    'url'  => $this->app['extend.site'] . 'satis/',
                ],
            ],
            'minimum-stability' => $minimumStability,
            'prefer-stable'     => true,
            'config'            => $config,
            'provide'           => [
                'bolt/bolt' => Bolt\Version::forComposer(),
            ],
            'extra' => [
                'bolt-web-path'  => $pathToWeb,
                'bolt-root-path' => $pathToRoot,
            ],
            'autoload' => [
                'psr-4' => [
                    'Bolt\\Composer\\EventListener\\' => $pathToListeners,
                ],
            ],
            'scripts' => [
                'post-autoload-dump'   => 'Bolt\\Composer\\EventListener\\PackageEventListener::dump',
                'post-package-install' => 'Bolt\\Composer\\EventListener\\PackageEventListener::handle',
                'post-package-update'  => 'Bolt\\Composer\\EventListener\\PackageEventListener::handle',
            ],
        ];
        $json = Arr::replaceRecursive($json, $defaults);
        ksort($json);

        return $json;
    }
private function setJsonDefaults ( array $ json ) { $ config = $ this -> app [ 'config' ] ; $ pathResolver = $ this -> app [ 'path_resolver' ] ; $ rootPath = $ pathResolver -> resolve ( 'root' ) ; $ extensionsPath = $ pathResolver -> resolve ( 'extensions' ) ; $ webPath = $ pathResolver -> resolve ( 'web' ) ; $ pathToRoot = Path :: makeRelative ( $ rootPath , $ extensionsPath ) ; $ pathToWeb = Path :: makeRelative ( $ webPath , $ extensionsPath ) ; $ pathToListeners = Path :: makeRelative ( __DIR__ . '/EventListener' , $ extensionsPath ) ; /** @deprecated Handle BC on 'stability' key until 4.0 */ $ minimumStability = $ config -> get ( 'general/extensions/stability' ) ? : $ config -> get ( 'general/extensions/composer/minimum-stability' , 'stable' ) ; $ config = $ config -> get ( 'general/extensions/composer/config' , [ ] ) + [ 'discard-changes' => true , 'preferred-install' => 'dist' , ] ; // Enforce standard settings $ defaults = [ 'name' => 'bolt/extensions' , 'description' => 'Bolt extension installation interface' , 'license' => 'MIT' , 'repositories' => [ 'packagist' => false , 'bolt' => [ 'type' => 'composer' , 'url' => $ this -> app [ 'extend.site' ] . 'satis/' , ] , ] , 'minimum-stability' => $ minimumStability , 'prefer-stable' => true , 'config' => $ config , 'provide' => [ 'bolt/bolt' => Bolt \ Version :: forComposer ( ) , ] , 'extra' => [ 'bolt-web-path' => $ pathToWeb , 'bolt-root-path' => $ pathToRoot , ] , 'autoload' => [ 'psr-4' => [ 'Bolt\\Composer\\EventListener\\' => $ pathToListeners , ] , ] , 'scripts' => [ 'post-autoload-dump' => 'Bolt\\Composer\\EventListener\\PackageEventListener::dump' , 'post-package-install' => 'Bolt\\Composer\\EventListener\\PackageEventListener::handle' , 'post-package-update' => 'Bolt\\Composer\\EventListener\\PackageEventListener::handle' , ] , ] ; $ json = Arr :: replaceRecursive ( $ json , $ defaults ) ; ksort ( $ json ) ; return $ json ; }
Enforce the default JSON settings.

@param array $json

@return array
Enforce the default JSON settings .