mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-20 00:20:44 +08:00
* 'ext-codestyle-fix' of https://github.com/AlexGx/yii2: fix php5.4 array syntax many phpcs fixes fix phpDoc LuaScriptBuilder build @throws Conflicts: extensions/apidoc/commands/RenderController.php extensions/apidoc/models/BaseDoc.php extensions/apidoc/templates/BaseRenderer.php extensions/apidoc/templates/bootstrap/Renderer.php extensions/apidoc/templates/bootstrap/layouts/guide.php extensions/apidoc/templates/bootstrap/layouts/main.php extensions/apidoc/templates/html/Renderer.php extensions/apidoc/templates/offline/Renderer.php extensions/apidoc/templates/offline/assets/AssetBundle.php extensions/apidoc/templates/offline/views/index.php
45 lines
1009 B
PHP
45 lines
1009 B
PHP
<?php
|
|
/**
|
|
* Twig ViewRendererStaticClassProxy class file.
|
|
*
|
|
* @link http://www.yiiframework.com/
|
|
* @copyright Copyright © 2008 Yii Software LLC
|
|
* @license http://www.yiiframework.com/license/
|
|
*/
|
|
|
|
namespace yii\twig;
|
|
|
|
/**
|
|
* Class-proxy for static classes
|
|
* Needed because you can't pass static class to Twig other way
|
|
*
|
|
* @author Leonid Svyatov <leonid@svyatov.ru>
|
|
*/
|
|
class ViewRendererStaticClassProxy
|
|
{
|
|
private $_staticClassName;
|
|
|
|
public function __construct($staticClassName)
|
|
{
|
|
$this->_staticClassName = $staticClassName;
|
|
}
|
|
|
|
public function __get($property)
|
|
{
|
|
$class = new \ReflectionClass($this->_staticClassName);
|
|
return $class->getStaticPropertyValue($property);
|
|
}
|
|
|
|
public function __set($property, $value)
|
|
{
|
|
$class = new \ReflectionClass($this->_staticClassName);
|
|
$class->setStaticPropertyValue($property, $value);
|
|
return $value;
|
|
}
|
|
|
|
public function __call($method, $arguments)
|
|
{
|
|
return call_user_func_array([$this->_staticClassName, $method], $arguments);
|
|
}
|
|
}
|