diff --git a/src/Collection.php b/src/Collection.php index 1f977ee..ccc60cf 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -42,7 +42,7 @@ class Collection implements \ArrayAccess * * @return void */ - public function set(/*.string.*/$key, /*.any.*/$value) + public function set($key/*: string*/, $value/*: any*/) { $this->data[$key] = $value; } diff --git a/src/Controller/Action.php b/src/Controller/Action.php index 34137af..d365a49 100644 --- a/src/Controller/Action.php +++ b/src/Controller/Action.php @@ -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(); } diff --git a/src/Controller/Component.php b/src/Controller/Component.php index 30d1904..655fbd5 100644 --- a/src/Controller/Component.php +++ b/src/Controller/Component.php @@ -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*/) { } } diff --git a/src/Controller/Request.php b/src/Controller/Request.php index e67ed7d..b9e77e9 100644 --- a/src/Controller/Request.php +++ b/src/Controller/Request.php @@ -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; } diff --git a/src/Controller/Service.php b/src/Controller/Service.php index fbcbb69..4992e50 100644 --- a/src/Controller/Service.php +++ b/src/Controller/Service.php @@ -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)); diff --git a/src/Database.php b/src/Database.php index 9ac4c6d..ebf717c 100644 --- a/src/Database.php +++ b/src/Database.php @@ -44,13 +44,13 @@ class Database extends PDO if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') { $port = (isset($dsn['port'])) ? "port={$dsn['port']};" : ""; - /*.Database.*/$connection = new static("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']); + $connection/*: Database*/ = new static("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']); if ($dsn['phptype'] == 'pgsql') { $connection->query('SET client_encoding="UTF-8"'); } } if ($dsn['phptype'] == 'sqlite') { - /*.Database.*/$connection = new static("{$dsn['phptype']}:{$dsn['database']}"); + $connection/*: Database*/ = new static("{$dsn['phptype']}:{$dsn['database']}"); $connection->setAttribute(PDO::ATTR_TIMEOUT, 5); $mode = defined('SQLITE_JOURNAL_MODE') ? SQLITE_JOURNAL_MODE : 'WAL'; $connection->query("PRAGMA journal_mode=$mode"); @@ -62,7 +62,7 @@ class Database extends PDO public function executeQuery($query, $values=null) { - /*.PDOStatement.*/$stmt = $this->prepare($query); + $stmt/*: PDOStatement*/ = $this->prepare($query); $stmt->execute($values); $stmt->cache = $stmt->fetchAll(PDO::FETCH_ASSOC); @@ -80,7 +80,7 @@ class Database extends PDO */ public function fetchAllArray($query, $values = null) { - /*.PDOStatement.*/$sth = $this->prepare($query); + $sth/*: PDOStatement*/ = $this->prepare($query); $prep = $this->prepareValues($values); $sth->execute($prep); return $sth->fetchAll(PDO::FETCH_ASSOC); @@ -91,7 +91,7 @@ class Database extends PDO */ public function fetchOneArray($query, $values = null) { - /*.PDOStatement.*/$sth = $this->prepare($query); + $sth/*: PDOStatement*/ = $this->prepare($query); $prep = $this->prepareValues($values); $sth->execute($prep); return $sth->fetch(PDO::FETCH_ASSOC); @@ -182,7 +182,7 @@ class Database extends PDO } function prepare($query, $options = NULL) { - /*.PDOStatement.*/$result = parent::prepare($query); + $result/*: PDOStatement*/ = parent::prepare($query); return $result; } diff --git a/src/Database/JsonInstall.php b/src/Database/JsonInstall.php index 0395427..6acb9b7 100644 --- a/src/Database/JsonInstall.php +++ b/src/Database/JsonInstall.php @@ -43,7 +43,7 @@ class JsonInstall { } //Создать таблицы - function initDataBase(/*.array.*/$initActions, $dbinit_path) { + function initDataBase($initActions/*: array*/, $dbinit_path) { $pg = $this->db_manager->db->isPostgres(); if (!$pg) { $refs = []; diff --git a/src/Database/Manager.php b/src/Database/Manager.php index a0e46a5..354a722 100644 --- a/src/Database/Manager.php +++ b/src/Database/Manager.php @@ -8,13 +8,13 @@ use ctiso\Database, class Manager { - public /*.Database.*/$db; + public $db/*: Database*/; function __construct(Database $db) { $this->db = $db; } - public function ExecuteAction(/*.array.*/$action, $db_file = "") { + public function ExecuteAction($action/*: array*/, $db_file = "") { switch($action["type"]) { case "dropTable": $this->DropTableQuery($action["table_name"], true); @@ -100,7 +100,7 @@ class Manager return; } - /*.array.*/$data = $this->DumpTable($table); + $data/*: array*/ = $this->DumpTable($table); $this->db->query("ALTER TABLE ".$table." RENAME TO ".$tmp_table.";"); $table_info[$new_name] = $table_info[$old_name]; @@ -147,7 +147,7 @@ class Manager $this->db->query($q); } - function getConstraintDef(/*.array.*/$c) { + function getConstraintDef($c/*: array*/) { if ($c['type'] == 'unique') { return "UNIQUE(" . implode(", ", $c['fields']) . ")"; } @@ -175,8 +175,8 @@ class Manager public function DumpTable($table_name) { $pg = $this->db->isPostgres(); - /*.array.*/$result = array(); - /*.array.*/$data = $this->db->fetchAllArray("SELECT * FROM ".$table_name.";"); + $result/*: array*/ = array(); + $data/*: array*/ = $this->db->fetchAllArray("SELECT * FROM ".$table_name.";"); if (!$pg) { $table_fields = $this->TableInfo($table_name); @@ -184,7 +184,7 @@ class Manager $type = strtolower($value['type']); if ($type == "boolean") { foreach ($data as &$row) { - /*.array.*/$row = $row; + $row/*: array*/ = $row; if (isset($row[$name])) { $row[$name] = boolval($row[$name]); } diff --git a/src/Database/Statement.php b/src/Database/Statement.php index f47278f..b25b008 100644 --- a/src/Database/Statement.php +++ b/src/Database/Statement.php @@ -16,7 +16,7 @@ class Statement protected $conn; protected $query; - function __construct($query, /*.Database.*/ $conn) { + function __construct($query, $conn/*: Database*/) { $this->query = $query; $this->conn = $conn; } @@ -51,7 +51,7 @@ class Statement if ($this->limit) { $this->query .= " LIMIT {$this->limit} OFFSET {$this->offset}"; } - /*.PDOStatement.*/$stmt = $this->conn->prepare($this->query); + $stmt/*: PDOStatement*/ = $this->conn->prepare($this->query); foreach ($this->binds as $bind) { list($n, $value, $type) = $bind; $stmt->bindValue($n, $value, (int) $type); diff --git a/src/Database/StatementIterator.php b/src/Database/StatementIterator.php index 6286a6d..aad0c90 100644 --- a/src/Database/StatementIterator.php +++ b/src/Database/StatementIterator.php @@ -11,7 +11,7 @@ class StatementIterator implements \Iterator private $fetchmode; private $row_count; - public function __construct(/*.PDOStatement.*/ $rs) { + public function __construct($rs/*: PDOStatement*/) { $this->result = $rs; $this->row_count = $rs->getRecordCount(); } diff --git a/src/Excel/Document.php b/src/Excel/Document.php index eba0654..dff1c3b 100644 --- a/src/Excel/Document.php +++ b/src/Excel/Document.php @@ -43,7 +43,7 @@ class Document { if ($type == 'Borders') { $doc->startElement('Borders'); foreach ($s as $border) { - /*.array.*/$border = $border; + $border/*: array*/ = $border; $doc->startElement('Border'); foreach ($border as $key => $value) { $doc->writeAttribute('ss:' . $key, $value); diff --git a/src/Excel/Table.php b/src/Excel/Table.php index 5a1786f..7754aa1 100644 --- a/src/Excel/Table.php +++ b/src/Excel/Table.php @@ -69,7 +69,7 @@ class Table if(! isset($this->rows[$x])) { $this->rows[$x] = new TableRow(); } - /*.TableRow.*/$row = $this->rows[$x]; + $row/*: TableRow*/ = $this->rows[$x]; $row->setCell($y, $value); } @@ -123,7 +123,7 @@ class Table assert(is_numeric($x) && $x > 0); assert(is_numeric($cell) && $cell > 0); - /*.TableRow.*/$row = $this->rows[$x]; + $row/*: TableRow*/ = $this->rows[$x]; $row->cells[$cell]->merge = $merge; } @@ -158,7 +158,7 @@ class Table */ function getRows() { - /*.array.*/$keys = array_keys($this->rows); + $keys/*: array*/ = array_keys($this->rows); return max($keys); } @@ -169,7 +169,7 @@ class Table */ function getRowCells(TableRow $row) { - /*.array.*/$keys = array_keys($row->cells); + $keys/*: array*/ = array_keys($row->cells); return max($keys); } @@ -207,7 +207,7 @@ class Table /** * Генерация клетки таблицы (Переработать) */ - function createCell (TableCell $ncell, XMLWriter $doc, $j, /*.any.*/$value, $setIndex) { + function createCell (TableCell $ncell, XMLWriter $doc, $j, $value/*: any*/, $setIndex) { $doc->startElement("Cell"); if ($ncell->style) { @@ -267,7 +267,7 @@ class Table $doc->writeAttribute('ss:Height', $this->rows[$i]->height); } - /*.TableRow.*/$nrow = $this->rows[$i]; + $nrow/*: TableRow*/ = $this->rows[$i]; // Флаг индикатор подстановки номера столбца $setIndex = false; for ($j = 1; $j <= $columns; $j++) { diff --git a/src/Filter/ActionAccess.php b/src/Filter/ActionAccess.php index c27b1b2..4fabc60 100644 --- a/src/Filter/ActionAccess.php +++ b/src/Filter/ActionAccess.php @@ -12,9 +12,9 @@ class ActionAccess { public $access = array(); public $processor; - public /*.User.*/$user; + public $user/*: User*/; - function __construct(/*.Filter.*/$processor, $user) { + function __construct($processor/*: Filter*/, $user) { $this->processor = $processor; $this->user = $user; } diff --git a/src/Filter/ActionLogger.php b/src/Filter/ActionLogger.php index 403d3b0..09f497c 100644 --- a/src/Filter/ActionLogger.php +++ b/src/Filter/ActionLogger.php @@ -1,7 +1,8 @@ processor = $processor; $this->user = $user; @@ -27,7 +28,7 @@ class ActionLogger function execute(HttpRequest $request) { $action = $request->getAction(); if(in_array($action, $this->before)) { - $message = ["time" => date("r", time()), "query" => array_merge($_POST, $_GET), "user" => $this->user->name]; + $message = ["time" => date("r", time()), "query" => array_merge($_POST, $_GET), "user" => $this->user->getName()]; fwrite($this->file, json_encode($message) . "\n"); } return $this->processor->execute($request); diff --git a/src/Filter/Filter.php b/src/Filter/Filter.php index 864e898..156d4e0 100644 --- a/src/Filter/Filter.php +++ b/src/Filter/Filter.php @@ -11,7 +11,7 @@ use ctiso\Controller\Action, class Filter { public $processor; - public function __construct(/*.Action.*/$processor) + public function __construct($processor/*: Action*/) { $this->processor = $processor; } diff --git a/src/Filter/Login.php b/src/Filter/Login.php index 7d976bd..4362bc7 100644 --- a/src/Filter/Login.php +++ b/src/Filter/Login.php @@ -23,7 +23,7 @@ class Login extends Filter public $mode = 'ajax'; public $user; - public /*.User.*/$role; + public $role/*: User*/; public $whitelist; function __construct($processor, $role, $whitelist = []) { diff --git a/src/Form/Field.php b/src/Form/Field.php index 1e1dd47..83a23ea 100644 --- a/src/Form/Field.php +++ b/src/Form/Field.php @@ -40,7 +40,7 @@ class Field } } - function setValue(/*.any.*/$value) + function setValue($value/*: any*/) { $this->value = $value; } diff --git a/src/Functions.php b/src/Functions.php index fc1d5a8..be161bc 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -226,7 +226,7 @@ class Functions { * * @return mixed */ - static function key_values($key, /*array|ArrayIterator*/ $array) { + static function key_values($key, $array/*: array|ArrayIterator*/) { $result = array(); foreach($array as $item) { @@ -235,7 +235,7 @@ class Functions { return $result; } - static function key_values_object($key, /*array|ArrayIterator*/ $array) { + static function key_values_object($key, $array/*: array|ArrayIterator*/) { $result = array(); foreach($array as $item) { @@ -260,7 +260,7 @@ class Functions { return $result; } - static function _get($key, /*.any.*/$value, /*.array.*/$array) { + static function _get($key, $value/*: any*/, $array/*: array*/) { foreach ($array as $item) { if ($item[$key] == $value) return $item; } @@ -373,7 +373,7 @@ class Functions { * Преобразует ключи элементов для многомерного массива * @return mixed */ - static function hash_key ($key_name,/*. array .*/ $array) { + static function hash_key ($key_name,$array/*: array */) { $result = array(); foreach($array as $value) { diff --git a/src/HttpRequest.php b/src/HttpRequest.php index 5e1b519..05c435e 100644 --- a/src/HttpRequest.php +++ b/src/HttpRequest.php @@ -56,7 +56,7 @@ class HttpRequest extends Collection implements ArrayAccess return $this->_session; } - function set($key, /*.any.*/$value) + function set($key, $value/*: any*/) { return parent::get('data')->set($key, $value); } diff --git a/src/Layout/Manager.php b/src/Layout/Manager.php index 884fb3b..e843219 100644 --- a/src/Layout/Manager.php +++ b/src/Layout/Manager.php @@ -35,7 +35,7 @@ class Manager extends Filter $this->addCondition(Functions::rcurry(array($this, 'checkXHR'), $get), $layout); } - public function checkGet(/*.HttpRequest.*/$request, $get) + public function checkGet($request/*: HttpRequest*/, $get) { if (is_array($get)) { foreach ($get as $key => $value) { @@ -47,7 +47,7 @@ class Manager extends Filter return true; } - public function checkXHR(/*.HttpRequest.*/$request, $get) + public function checkXHR($request/*: HttpRequest*/, $get) { return $request->isAjax() && $this->checkGet($request, $get); } diff --git a/src/MailAlt.php b/src/MailAlt.php index 138ae94..753dedf 100644 --- a/src/MailAlt.php +++ b/src/MailAlt.php @@ -51,7 +51,7 @@ class MailAlt /** * Тема письма */ - function subject(/*.string.*/$subject) + function subject($subject/*: string*/) { $this->mailer->Subject = $subject; } diff --git a/src/Path.php b/src/Path.php index 5234e73..1918571 100644 --- a/src/Path.php +++ b/src/Path.php @@ -160,7 +160,7 @@ class Path } // Сравнение двух путей на равентство - public function equal(/*.Path.*/ $path) + public function equal($path/*: Path*/) { $count = count($this->path); if ($count == count($path->path)) { @@ -205,7 +205,7 @@ class Path * * @return boolean */ - public function isParent(/*.Path.*/ $path) + public function isParent($path/*: Path*/) { if (isset($this->url['host']) && isset($path->url['host']) && ($this->url['host'] != $path->url['host'])) return false; diff --git a/src/Role/User.php b/src/Role/User.php index f199363..8d3e892 100644 --- a/src/Role/User.php +++ b/src/Role/User.php @@ -5,7 +5,7 @@ use ctiso\Database, ctiso\Database\Statement; // Класс должен быть в библиотеке приложения -class User +class User implements UserInterface { const LIFE_TIME = 1800; // = 30min * 60sec; @@ -26,6 +26,10 @@ class User $this->db = $db; } + public function getName() { + return $this->name; + } + public function getUserByQuery(Statement $stmt) { $result = $stmt->executeQuery(); diff --git a/src/Role/UserInterface.php b/src/Role/UserInterface.php new file mode 100644 index 0000000..778394d --- /dev/null +++ b/src/Role/UserInterface.php @@ -0,0 +1,11 @@ +stack[count($this->stack) - 1]; + $item/*: \SimpleXMLElement*/ = $this->stack[count($this->stack) - 1]; $root = $item->children(); foreach ($root as $node) { @@ -200,7 +200,7 @@ class Setup /** * Выполнение Списка SQL команд */ - function batchSQLZip(/*.Database.*/ $conn, $file) + function batchSQLZip($conn/*: Database*/, $file) { $stmtList = SQLStatementExtractor::extract($this->zip->getFromName($file)); foreach ($stmtList as $stmt) { @@ -208,7 +208,7 @@ class Setup } } - static function batchSQL(/*.Database.*/ $conn, $file) + static function batchSQL($conn/*: Database*/, $file) { $stmtList = SQLStatementExtractor::extractFile($file); foreach ($stmtList as $stmt) { diff --git a/src/Tales.php b/src/Tales.php index b6fc45a..90ce298 100644 --- a/src/Tales.php +++ b/src/Tales.php @@ -32,7 +32,7 @@ class Tales_Component implements PHPTAL_Tales } class Tales { - static /*.SiteInterface.*/$site; + static $site/*: SiteInterface*/; static function phptal_date ($e) { return date("d.m.Y", $e); @@ -47,7 +47,7 @@ class Tales { */ static function phptal_component ($expression) { $begin = floatval(microtime(true)); - /*.Component.*/$component = null; + $component/*: Component*/ = null; $component = self::$site->loadComponent($expression); $req = new HttpRequest(); diff --git a/src/Tools/SQLStatementExtractor.php b/src/Tools/SQLStatementExtractor.php index dd4df20..d6acd15 100644 --- a/src/Tools/SQLStatementExtractor.php +++ b/src/Tools/SQLStatementExtractor.php @@ -124,7 +124,7 @@ class SQLStatementExtractor { * @param string $string The string to check in (haystack). * @return boolean True if $string ends with $check, or they are equal, or $check is empty. */ - protected static function endsWith(/*.string.*/$check, $string) { + protected static function endsWith($check/*: string*/, $string) { if ($check === "" || $check === $string) { return true; } else { diff --git a/src/Tools/TemplateImage.php b/src/Tools/TemplateImage.php index fad2434..8dbb21e 100644 --- a/src/Tools/TemplateImage.php +++ b/src/Tools/TemplateImage.php @@ -122,7 +122,7 @@ class TemplateImage return ""; } - function imageText($text, /*.\stdClass.*/$value) + function imageText($text, $value/*: \stdClass*/) { assert(is_string($text)); diff --git a/src/Url.php b/src/Url.php index 5c824ab..f4393b0 100644 --- a/src/Url.php +++ b/src/Url.php @@ -4,7 +4,7 @@ namespace ctiso; class Url { public $parts = []; - public /*.Url.*/$parent; + public $parent/*: Url*/; function __construct() { } diff --git a/src/Validator/Validator.php b/src/Validator/Validator.php index ed36f7f..0529662 100644 --- a/src/Validator/Validator.php +++ b/src/Validator/Validator.php @@ -74,7 +74,7 @@ class Validator } } - public function addRule(/*.any.*/$rule) { + public function addRule($rule/*: any*/) { if (is_array($rule)) { $this->chain = array_merge($this->chain, $rule); } else { @@ -82,7 +82,7 @@ class Validator } } - public function skip(/*.AbstractRule.*/$rule, /*.Collection.*/$container) // -> Rule_Abstract + public function skip($rule/*: AbstractRule*/, $container/*: Collection*/) // -> Rule_Abstract { if ($rule->skipEmpty()) { $data = $container->get($rule->field); diff --git a/src/View/Page.php b/src/View/Page.php index 3591abe..ec6b8f8 100644 --- a/src/View/Page.php +++ b/src/View/Page.php @@ -10,7 +10,7 @@ class Page extends View { private $counter; public $text; - public /*.SiteInterface.*/$site; + public $site/*: SiteInterface*/; function __construct($data, $site) { @@ -55,7 +55,7 @@ class Page extends View function replaceContent($match, $offset) { - /*.Component.*/$component = $this->site->loadComponent($match); + $component/*: Component*/ = $this->site->loadComponent($match); $req = new HttpRequest(); unset($req['active_page']); diff --git a/src/View/Pages.php b/src/View/Pages.php index 8eb0767..1bba197 100644 --- a/src/View/Pages.php +++ b/src/View/Pages.php @@ -33,7 +33,7 @@ class Pages * @param $onpage int количество элем на странице * @return string */ - static function getLimit(/*.number.*/$page, /*.number.*/$onpage) { + static function getLimit($page/*: number*/, $onpage/*: number*/) { if ($page <= 0) { $page = 1; } return "LIMIT $onpage OFFSET " . ($page - 1) * $onpage; } diff --git a/src/View/Top.php b/src/View/Top.php index 08051f0..b3fd768 100644 --- a/src/View/Top.php +++ b/src/View/Top.php @@ -102,7 +102,7 @@ class Top extends Composite { $init = array(); foreach($s->_section as $key => $item) { - /*.View.*/$ss = $item; + $ss/*: View*/ = $item; if ($ss->codeGenerator !== null) { // функцию которая вычисляет а не результат $part = call_user_func($ss->codeGenerator, $this, $key, $value);