Типы для php-lint v2
This commit is contained in:
parent
f570da257d
commit
6173eb4892
31 changed files with 83 additions and 76 deletions
|
|
@ -40,7 +40,7 @@ class Controller_Action
|
|||
private $helpers = array(); // Помошники для действий
|
||||
public $param = array(); // Параметры для ссылки
|
||||
|
||||
public /*.Registry.*/$_registry; // Ссылка на реестр
|
||||
public $_registry/*: Registry*/; // Ссылка на реестр
|
||||
public $_shortcut;
|
||||
public $modulePrefix = '';
|
||||
public $iconPath = '';
|
||||
|
|
@ -114,7 +114,7 @@ class Controller_Action
|
|||
if(file_exists($template)) { break; }
|
||||
}
|
||||
|
||||
/*.View_Composite.*/$tpl = new $viewClass($template);
|
||||
$tpl/*: View_Composite*/ = new $viewClass($template);
|
||||
|
||||
$assets = Path::join(enableHttps(WWW_PATH), "assets", "css");
|
||||
$tpl->set('icons', $this->iconPath); // Путь к файлам текущей темы
|
||||
|
|
@ -207,7 +207,7 @@ class Controller_Action
|
|||
*/
|
||||
public function nUrl($name, array $param = array())
|
||||
{
|
||||
/*.Filter_ActionAccess.*/$access = $this->access;
|
||||
$access/*: Filter_ActionAccess*/ = $this->access;
|
||||
|
||||
if ($access == null || $access->checkAction($name)) {
|
||||
return Functions::lcurry(array($this, 'postUrl'), $name, $param);
|
||||
|
|
@ -331,7 +331,7 @@ class Controller_Action
|
|||
if ($this->view instanceof View_View) {
|
||||
$this->view->assignValues($this->ctrlValues);
|
||||
|
||||
/*.Widgets_Widget.*/$node = null;
|
||||
$node/*: Widgets_Widget*/ = null;
|
||||
foreach ($this->childNodes as $name => $node) {
|
||||
$node->make($this);
|
||||
$this->view->setView($name, $node->view);
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ class Controller_Component
|
|||
public $component_title;
|
||||
public $COMPONENTS_WEB;
|
||||
|
||||
public /*.Settings.*/$registry;
|
||||
public /*.Database.*/$db;
|
||||
public /*.Collection.*/$parameter;
|
||||
public $registry/*: Settings*/;
|
||||
public $db/*: Database*/;
|
||||
public $parameter/*: Collection*/;
|
||||
|
||||
public $module;
|
||||
public $item_module;
|
||||
|
|
@ -88,7 +88,7 @@ class Controller_Component
|
|||
public function getView($name)
|
||||
{
|
||||
//
|
||||
/*.Settings.*/$registry = $this->registry;
|
||||
$registry/*: Settings*/ = $this->registry;
|
||||
$template = ($this->template) ? $this->template : $registry->readKey(array('system', 'template'));
|
||||
|
||||
$selected = null;
|
||||
|
|
@ -128,7 +128,7 @@ class Controller_Component
|
|||
}
|
||||
|
||||
public function getTemplatePath($name) {
|
||||
/*.Settings.*/$registry = $this->registry;
|
||||
$registry/*: Settings*/ = $this->registry;
|
||||
$template = ($this->template) ? $this->template : $registry->readKey(array('system', 'template'));
|
||||
foreach ($this->viewPath as $index => $viewPath) {
|
||||
if(is_dir(Path::join($this->viewPath[$index], 'templates', $template))) {
|
||||
|
|
@ -157,7 +157,7 @@ class Controller_Component
|
|||
return $model;
|
||||
}
|
||||
|
||||
public function options($key, $val, /*.Database_PDOStatement.*/$res) {
|
||||
public function options($key, $val, $res/*: Database_PDOStatement*/) {
|
||||
$result = array();
|
||||
while($res->next()) {
|
||||
$result[] = array('value' => $res->getString($key), 'name' => $res->getString($val));
|
||||
|
|
@ -185,7 +185,7 @@ class Controller_Component
|
|||
/**
|
||||
* Генерация интерфейса для выбора галлереи фотографии
|
||||
*/
|
||||
public function setParameters(/*.View_Composite.*/$view)
|
||||
public function setParameters($view/*: View_Composite*/)
|
||||
{
|
||||
$form = new Form_Form();
|
||||
$options = new Form_OptionFactory($this->db, $this->registry);
|
||||
|
|
@ -198,7 +198,7 @@ class Controller_Component
|
|||
$view->component_title = $settings['title'];
|
||||
}
|
||||
|
||||
static function loadComponent($expression, Database $db, /*.Registry.*/ $registry)
|
||||
static function loadComponent($expression, Database $db, $registry/*: Registry*/)
|
||||
{
|
||||
|
||||
$expression = htmlspecialchars_decode($expression);
|
||||
|
|
@ -218,7 +218,7 @@ class Controller_Component
|
|||
$path = Path::join (BASE_PATH, 'components', $name, $name . '.php');
|
||||
$className = 'Component_' . $name;
|
||||
|
||||
/*.Controller_Component.*/$component = null;
|
||||
$component/*: Controller_Component*/ = null;
|
||||
|
||||
if (file_exists($path)) {
|
||||
require_once ($path);
|
||||
|
|
@ -293,12 +293,12 @@ class Controller_Component
|
|||
return null;
|
||||
}
|
||||
|
||||
function raw_query(/*.ComponentRequest.*/ $request)
|
||||
function raw_query($request/*: ComponentRequest*/)
|
||||
{
|
||||
$arr = $request->r->export('get');
|
||||
|
||||
$param = array();
|
||||
/*.Collection.*/$parameter = $this->parameter;
|
||||
$parameter/*: Collection*/ = $this->parameter;
|
||||
foreach($parameter->export() as $key => $value) {
|
||||
$param[$key] = $value;
|
||||
}
|
||||
|
|
@ -316,7 +316,7 @@ class Controller_Component
|
|||
}
|
||||
|
||||
|
||||
function query(/*.ComponentRequest.*/ $request, $list)
|
||||
function query($request/*: ComponentRequest*/, $list)
|
||||
{
|
||||
$arr = $request->r->export('get');
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ class Controller_Component
|
|||
Controller_Site::addRequireJsPath($name, $path, $shim);
|
||||
}
|
||||
|
||||
function actionIndex(/*.ComponentRequest.*/ $request) {
|
||||
function actionIndex($request/*: ComponentRequest*/) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class Controller_Front extends Controller_Action
|
|||
$this->default = $name;
|
||||
}
|
||||
|
||||
public function execute(HTTPRequest $request)
|
||||
public function execute(HttpRequest $request)
|
||||
{
|
||||
$name = explode("_", $request->get($this->_param, $this->default));
|
||||
if (count($name) >= 2) {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
<?php
|
||||
|
||||
class Controller_Request {
|
||||
public $r;
|
||||
public $id;
|
||||
|
||||
function __construct($request, $id) {
|
||||
$this->r = $request;
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
function get($name) {
|
||||
function get($name, $def = null) {
|
||||
$v = $this->r->get($name);
|
||||
$id = $this->id;
|
||||
if ($id && is_array($v)) {
|
||||
return isset($v[$id]) ? $v[$id] : $def;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue