mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-16 06:17:56 +08:00
many phpcs fixes
This commit is contained in:
@@ -68,7 +68,8 @@ class TwigSimpleFileLoader implements \Twig_LoaderInterface
|
||||
* @param string $name file name
|
||||
* @return string absolute path of file
|
||||
*/
|
||||
protected function getFilePath($name){
|
||||
protected function getFilePath($name)
|
||||
{
|
||||
return $this->_dir . '/' . $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,33 +33,33 @@ class ViewRenderer extends BaseViewRenderer
|
||||
* @see http://twig.sensiolabs.org/doc/api.html#environment-options
|
||||
*/
|
||||
public $options = [];
|
||||
/**
|
||||
/**
|
||||
* @var array Objects or static classes.
|
||||
* Keys of the array are names to call in template, values are objects or names of static classes.
|
||||
* Example: `['html' => '\yii\helpers\Html']`.
|
||||
* In the template you can use it like this: `{{ html.a('Login', 'site/login') | raw }}`.
|
||||
*/
|
||||
public $globals = [];
|
||||
/**
|
||||
public $globals = [];
|
||||
/**
|
||||
* @var array Custom functions.
|
||||
* Keys of the array are names to call in template, values are names of functions or static methods of some class.
|
||||
* Example: `['rot13' => 'str_rot13', 'a' => '\yii\helpers\Html::a']`.
|
||||
* In the template you can use it like this: `{{ rot13('test') }}` or `{{ a('Login', 'site/login') | raw }}`.
|
||||
*/
|
||||
public $functions = [];
|
||||
/**
|
||||
public $functions = [];
|
||||
/**
|
||||
* @var array Custom filters.
|
||||
* Keys of the array are names to call in template, values are names of functions or static methods of some class.
|
||||
* Example: `['rot13' => 'str_rot13', 'jsonEncode' => '\yii\helpers\Json::encode']`.
|
||||
* In the template you can use it like this: `{{ 'test'|rot13 }}` or `{{ model|jsonEncode }}`.
|
||||
*/
|
||||
public $filters = [];
|
||||
/**
|
||||
public $filters = [];
|
||||
/**
|
||||
* @var array Custom extensions.
|
||||
* Example: `['Twig_Extension_Sandbox', 'Twig_Extension_Text']`
|
||||
*/
|
||||
public $extensions = [];
|
||||
/**
|
||||
public $extensions = [];
|
||||
/**
|
||||
* @var array Twig lexer options.
|
||||
* Example: Smarty-like syntax:
|
||||
* ```php
|
||||
@@ -71,8 +71,8 @@ class ViewRenderer extends BaseViewRenderer
|
||||
* ```
|
||||
* @see http://twig.sensiolabs.org/doc/recipes.html#customizing-the-syntax
|
||||
*/
|
||||
public $lexerOptions = [];
|
||||
/**
|
||||
public $lexerOptions = [];
|
||||
/**
|
||||
* @var \Twig_Environment twig environment object that do all rendering twig templates
|
||||
*/
|
||||
public $twig;
|
||||
@@ -118,7 +118,7 @@ class ViewRenderer extends BaseViewRenderer
|
||||
}
|
||||
|
||||
// Adding global 'void' function (usage: {{void(App.clientScript.registerScriptFile(...))}})
|
||||
$this->twig->addFunction('void', new \Twig_Function_Function(function($argument){
|
||||
$this->twig->addFunction('void', new \Twig_Function_Function(function ($argument) {
|
||||
}));
|
||||
|
||||
$this->twig->addFunction('path', new \Twig_Function_Function(function ($path, $args = []) {
|
||||
|
||||
@@ -19,7 +19,8 @@ class ViewRendererStaticClassProxy
|
||||
{
|
||||
private $_staticClassName;
|
||||
|
||||
public function __construct($staticClassName) {
|
||||
public function __construct($staticClassName)
|
||||
{
|
||||
$this->_staticClassName = $staticClassName;
|
||||
}
|
||||
|
||||
@@ -40,4 +41,4 @@ class ViewRendererStaticClassProxy
|
||||
{
|
||||
return call_user_func_array(array($this->_staticClassName, $method), $arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user