for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Mvc;
use Nip\Container\ServiceProviders\Providers\AbstractSignatureServiceProvider;
use Nip\Mvc\Modules\ModulesManager;
use Nip\Mvc\Sections\SectionsManager;
/**
* Class MvcServiceProvider
* @package Nip\Mvc
*/
class MvcServiceProvider extends AbstractSignatureServiceProvider
{
* {@inheritdoc}
public function register()
$this->registerModules();
$this->registerSections();
}
protected function registerModules()
$this->getContainer()->share('mvc.modules', function () {
return $this->createModulesProvider();
});
* @return ModulesManager
protected function createModulesProvider()
if ($this->getContainer()->has(Modules::class)) {
return $this->getContainer()->get(Modules::class);
if ($this->getContainer()->has(ModulesManager::class)) {
return $this->getContainer()->get(ModulesManager::class);
return new ModulesManager();
protected function registerSections()
$this->getContainer()->share('mvc.sections', function () {
return $this->createSectionsManager();
* @return Modules
protected function createSectionsManager()
$sections = $this->getContainer()->has(SectionsManager::class) ?
$this->getContainer()->get(SectionsManager::class)
: new SectionsManager();
$sections->init();
Nip\Mvc\Sections\SectionsManager::init()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
/** @scrutinizer ignore-deprecated */ $sections->init();
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
return $sections;
return $sections
Nip\Mvc\Sections\SectionsManager
Nip\Mvc\Modules
* @inheritdoc
public function provides()
return ['mvc.modules', 'mvc.sections'];
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.