for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Plugin class
*/
namespace Phile\Plugin\Phile\TemplateTwig;
use Phile\Core\Container;
use Phile\Core\ServiceLocator;
use Phile\Plugin\AbstractPlugin;
use Phile\Plugin\Phile\TemplateTwig\Template\Twig;
* Class Plugin
* Default Phile template engine
*
* @author PhileCMS
* @link https://philecms.github.io
* @license http://opensource.org/licenses/MIT
* @package Phile\Plugin\Phile\TemplateTwig
class Plugin extends AbstractPlugin
{
* {@inheritdoc}
protected $events = ['plugins_loaded' => 'onPluginsLoaded'];
* Registers Twig as template service
* @param array $data
* @return void
public function onPluginsLoaded($data)
$data
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onPluginsLoaded(/** @scrutinizer ignore-unused */ $data)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$phile = Container::getInstance()->get('Phile_Config');
$settings = $this->settings + [
'theme' => $phile->get('theme'),
'themes_dir' => $phile->get('themes_dir')
];
ServiceLocator::registerService('Phile_Template', new Twig($settings));
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.