From 4f553330644aa8a6fb3cda9fabd65b5a0bfbe754 Mon Sep 17 00:00:00 2001 From: Anton Terekhov Date: Sat, 10 Nov 2012 15:55:11 +0400 Subject: [PATCH] PHPdoc updated --- app/FrontController.php | 7 +++++-- app/router/Router.php | 21 ++++++++++++++++++--- layout/Layout.php | 8 +++++++- redis/RedisDebug.php | 2 -- redis/RedisManager.php | 3 ++- redis/redis.php | 3 ++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/app/FrontController.php b/app/FrontController.php index cb31776..cbf4c65 100644 --- a/app/FrontController.php +++ b/app/FrontController.php @@ -5,8 +5,6 @@ * @package Majestic * @subpackage app * @since 2010-02-24 - * @version SVN: $Id$ - * @filesource $URL$ */ class FrontController @@ -65,6 +63,7 @@ class FrontController /** * + * @param null $view * @return iView */ public function getView($view = null) @@ -75,6 +74,7 @@ class FrontController /** * @param string $url + * @return FrontController */ public function setBaseUrl($url) { @@ -115,6 +115,9 @@ class FrontController throw new GeneralException('Layout class "' . $layout_class . '" not found.'); } + /** + * @var Layout $layout + */ $layout = new $layout_class(); $html = $layout->fetch($action); if (Config::get('PROFILER')) { diff --git a/app/router/Router.php b/app/router/Router.php index f79f588..0a296c2 100644 --- a/app/router/Router.php +++ b/app/router/Router.php @@ -5,15 +5,18 @@ * @package Majestic * @subpackage app * @since 2010-02-25 - * @version SVN: $Id$ - * @filesource $URL$ */ class Router { - + /** + * @var Route[] + */ protected $routes = array(); + /** + * @var string + */ protected $route_name; protected $default_layout = 'Default'; @@ -33,6 +36,10 @@ class Router $this->routes[$name] = new Route($route, $action, $params, $layout); } + /** + * @param $request + * @return bool|Route + */ public function route($request) { $req = explode('/', trim($request, '/')); @@ -48,6 +55,10 @@ class Router return false; } + /** + * Set default layout name + * @param string $layout + */ public function setDefaultLayout($layout = 'Default') { $this->default_layout = $layout; @@ -71,6 +82,10 @@ class Router return $this->error_layout . 'Layout'; } + /** + * Return current router name + * @return string + */ public function getRouteName() { return $this->route_name; diff --git a/layout/Layout.php b/layout/Layout.php index 9c5eaae..ee75ac1 100644 --- a/layout/Layout.php +++ b/layout/Layout.php @@ -56,7 +56,9 @@ abstract class Layout abstract protected function execute(); /** + * Execute Action, insert action's result html into layout template and return Layout html * @param Action $action + * @return string */ public function fetch($action) { @@ -64,7 +66,11 @@ abstract class Layout $this->execute(); return $this->view->fetch($this->getTemplate()); } - + + /** + * Return content of template + * @return string + */ protected function getTemplate() { $template = ($this->template) ? $this->template : substr(get_class($this), 0, -6/*strlen('Layout')*/); diff --git a/redis/RedisDebug.php b/redis/RedisDebug.php index 692f0ea..bfa7d26 100644 --- a/redis/RedisDebug.php +++ b/redis/RedisDebug.php @@ -5,8 +5,6 @@ * @package Majestic * @subpackage Redis * @since 2011-07-29 - * @version SVN: $Id$ - * @filesource $URL$ */ class RedisDebug diff --git a/redis/RedisManager.php b/redis/RedisManager.php index ae5f3db..b329f11 100644 --- a/redis/RedisManager.php +++ b/redis/RedisManager.php @@ -15,7 +15,7 @@ class RedisManager /** * Redis connections * - * @var array + * @var Redis[] */ static protected $connections = array(); @@ -25,6 +25,7 @@ class RedisManager * @param string $name connection name. If not set 'default' will be used. * @param array $config Configuration array. * + * @throws GeneralException * @return Redis */ static public function connect($name = 'default', $config = null) diff --git a/redis/redis.php b/redis/redis.php index a6bffbf..94a8842 100644 --- a/redis/redis.php +++ b/redis/redis.php @@ -15,7 +15,8 @@ * @see https://github.com/nicolasff/phpredis * * @method bool connect() connect(string $host, int $port = 6379, float $timeout = 0) Connect to redis - * @method bool pconnect() connect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id) Connect to redis with reusing connection + * @method bool pconnect() pconnect(string $host, int $port = 6379, float $timeout = 0, string $persistent_id) Connect to redis with reusing connection + * @method bool select() select(int $dbindex) Switches to a given database * @method void close() Close connection to redis * @method bool setOption() setOption(mixed $name, mixed $value) Set client option * @method mixed getOption() getOption(mixed $name) Get client option