for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\SettingsBundle\Twig;
use Sylius\Bundle\SettingsBundle\Templating\Helper\SettingsHelper;
/**
* Sylius settings extension for Twig.
*
* @author Paweł Jędrzejewski <[email protected]>
*/
class SettingsExtension extends \Twig_Extension
{
* @var SettingsHelper
private $helper;
* @param SettingsHelper $helper
public function __construct($helper)
$this->helper = $helper;
}
* {@inheritdoc}
public function getFunctions()
return array(
new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')),
new \Twig_SimpleFunction('chamilo_settings_get', array($this, 'getSettingsParameter')),
new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']),
);
* Load settings from given namespace.
* @param string $namespace
* @return array
public function getSettings($namespace)
return $this->helper->getSettings($namespace);
* @param $name
* @return mixed
public function getSettingsParameter($name)
return $this->helper->getSettingsParameter($name);
getSettingsParameter()
Sylius\Bundle\SettingsBu...g\Helper\SettingsHelper
getSettings()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
//return $this->getSettingsParameter($name);
public function getName()
return 'chamilo_settings';
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.