Постфиксная запись типов вместо префиксной
This commit is contained in:
parent
04662a94df
commit
11370eecc9
33 changed files with 95 additions and 79 deletions
|
|
@ -47,8 +47,8 @@ class Action
|
|||
private $helpers = array(); // Помошники для действий
|
||||
public $part = null; // Параметры для ссылки
|
||||
|
||||
public /*.Registry.*/$config; // Ссылка на настройки
|
||||
public /*.User.*/$user; // Обьект пользователя
|
||||
public $config/*: Registry*/; // Ссылка на настройки
|
||||
public $user/*: User*/; // Обьект пользователя
|
||||
|
||||
// Для Widgets
|
||||
public $view = null;
|
||||
|
|
@ -124,7 +124,7 @@ class Action
|
|||
if(file_exists($template)) { break; }
|
||||
}
|
||||
|
||||
/*.Composite.*/$tpl = new $viewClass($template);
|
||||
$tpl/*: Composite*/ = new $viewClass($template);
|
||||
$tpl->config = $this->config;
|
||||
|
||||
$stylePath = Path::join($webPath, "assets", "css");
|
||||
|
|
@ -215,7 +215,7 @@ class Action
|
|||
*/
|
||||
public function nUrl($name, array $param = array())
|
||||
{
|
||||
/*.ActionAccess.*/$access = $this->access;
|
||||
$access/*: ActionAccess*/ = $this->access;
|
||||
$url = new Url();
|
||||
|
||||
if ($access == null || $access->checkAction($name)) {
|
||||
|
|
@ -334,7 +334,7 @@ class Action
|
|||
if ($view instanceof View) {
|
||||
$this->view->assignValues($this->ctrlValues);
|
||||
|
||||
/*.Composite.*/$node = null;
|
||||
$node/*: Composite*/ = null;
|
||||
foreach ($this->childNodes as $name => $node) {
|
||||
$node->make($this);
|
||||
$this->view->setView($name, $node->view);
|
||||
|
|
@ -373,7 +373,7 @@ class Action
|
|||
$this->_getActionPath()->getPath($this, ($action) ? $action : $request->getAction());
|
||||
}
|
||||
|
||||
function redirect(/*.string.*/$action) {
|
||||
function redirect($action/*: string*/) {
|
||||
header('location: ' . $action);
|
||||
exit();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ class Component
|
|||
|
||||
public $COMPONENTS_WEB;
|
||||
|
||||
public /*.Registry.*/$config;
|
||||
public /*.Database.*/$db;
|
||||
public /*.Collection.*/$parameter;
|
||||
public $config/*: Registry*/;
|
||||
public $db/*: Database*/;
|
||||
public $parameter/*: Collection*/;
|
||||
|
||||
public $output = 'html';
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class Component
|
|||
return new FakeTemplate($name);
|
||||
}
|
||||
|
||||
/*.Registry.*/$config = $this->config;
|
||||
$config/*: Registry*/ = $this->config;
|
||||
$default = $config->get('site', 'template');
|
||||
$template = ($this->template) ? $this->template : $default;
|
||||
|
||||
|
|
@ -157,7 +157,7 @@ class Component
|
|||
return $model;
|
||||
}
|
||||
|
||||
public function options($key, $val, /*.PDOStatement.*/$res) {
|
||||
public function options($key, $val, $res/*: PDOStatement*/) {
|
||||
$result = array();
|
||||
while($res->next()) {
|
||||
$result[] = array('value' => $res->getString($key), 'name' => $res->getString($val));
|
||||
|
|
@ -195,7 +195,7 @@ class Component
|
|||
/**
|
||||
* Генерация интерфейса для выбора галлереи фотографии
|
||||
*/
|
||||
public function setParameters(/*.Composite.*/ $view, $options = null)
|
||||
public function setParameters($view/*: Composite*/, $options = null)
|
||||
{
|
||||
$form = new Form();
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ class Component
|
|||
$view->component_title = $settings['title'];
|
||||
}
|
||||
|
||||
static function loadComponent($expression, /*.SiteInterface.*/ $site)
|
||||
static function loadComponent($expression, $site/*: SiteInterface*/)
|
||||
{
|
||||
|
||||
$expression = htmlspecialchars_decode($expression);
|
||||
|
|
@ -227,7 +227,7 @@ class Component
|
|||
$path = Path::join ($this->config->get('site', 'path'), 'components', $name, $name . '.php');
|
||||
$className = 'Component_' . $name;
|
||||
|
||||
/*.Component.*/$component = null;
|
||||
$component/*: Component*/ = null;
|
||||
|
||||
if (file_exists($path)) {
|
||||
require_once ($path);
|
||||
|
|
@ -297,12 +297,12 @@ class 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;
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ class Component
|
|||
}
|
||||
|
||||
|
||||
function query(/*.ComponentRequest.*/ $request, $list)
|
||||
function query($request/*: ComponentRequest*/, $list)
|
||||
{
|
||||
$arr = $request->r->export('get');
|
||||
|
||||
|
|
@ -336,6 +336,6 @@ class Component
|
|||
$this->site->addRequireJsPath($name, $path, $shim);
|
||||
}
|
||||
|
||||
function actionIndex(/*.ComponentRequest.*/ $request) {
|
||||
function actionIndex($request/*: ComponentRequest*/) {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ class Request {
|
|||
public $r;
|
||||
public $id;
|
||||
|
||||
function __construct(/*.HttpRequest.*/$request, $id) {
|
||||
function __construct($request/*: HttpRequest*/, $id) {
|
||||
$this->r = $request;
|
||||
$this->id = $id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Service
|
|||
{
|
||||
public $viewPath = [];
|
||||
public $webPath = [];
|
||||
public /*.Registry.*/$config;
|
||||
public $config/*: Registry*/;
|
||||
public $template;
|
||||
public $templatePath;
|
||||
public $COMPONENTS_WEB;
|
||||
|
|
@ -51,7 +51,7 @@ class Service
|
|||
return $model;
|
||||
}
|
||||
|
||||
public function options($key, $val, /*.PDOStatement.*/$res) {
|
||||
public function options($key, $val, $res/*: PDOStatement*/) {
|
||||
$result = array();
|
||||
while($res->next()) {
|
||||
$result[] = array('value' => $res->getInt($key), 'name' => $res->getString($val));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue