diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-11-25 16:28:24 +0100 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-11-25 16:28:24 +0100 |
commit | bc8cc9142e08611104cdc4df9d518775ef576066 (patch) | |
tree | 12e88197b6db36f74b91fb1778f3fc18c7257dde /lib | |
parent | 248eed16a6bf917292d4a99191d123a7e7cc9002 (diff) | |
download | nextcloud-server-bc8cc9142e08611104cdc4df9d518775ef576066.tar.gz nextcloud-server-bc8cc9142e08611104cdc4df9d518775ef576066.zip |
AppFramework(Controller|HTTP|HTTP-Responses|Middleware), IContainer API fixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/public/appframework/controller.php | 7 | ||||
-rw-r--r-- | lib/public/appframework/http.php | 8 | ||||
-rw-r--r-- | lib/public/appframework/http/jsonresponse.php | 11 | ||||
-rw-r--r-- | lib/public/appframework/http/response.php | 4 | ||||
-rw-r--r-- | lib/public/appframework/http/templateresponse.php | 26 | ||||
-rw-r--r-- | lib/public/appframework/middleware.php | 4 | ||||
-rw-r--r-- | lib/public/icontainer.php | 2 |
7 files changed, 58 insertions, 4 deletions
diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php index 320e0cfebb2..dc8da967871 100644 --- a/lib/public/appframework/controller.php +++ b/lib/public/appframework/controller.php @@ -20,6 +20,10 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * AppFramework\Controller class + */ namespace OCP\AppFramework; @@ -34,16 +38,19 @@ use OCP\IRequest; abstract class Controller { /** + * app container for dependency injection * @var \OCP\AppFramework\IAppContainer */ protected $app; /** + * current request * @var \OCP\IRequest */ protected $request; /** + * constructor of the controller * @param IAppContainer $app interface to the app * @param IRequest $request an instance of the request */ diff --git a/lib/public/appframework/http.php b/lib/public/appframework/http.php index c584d4ec670..60f314202cc 100644 --- a/lib/public/appframework/http.php +++ b/lib/public/appframework/http.php @@ -20,10 +20,16 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * AppFramework\HTTP class + */ namespace OCP\AppFramework; - +/** + * Base class which contains constants for HTTP status codes + */ class Http { const STATUS_CONTINUE = 100; diff --git a/lib/public/appframework/http/jsonresponse.php b/lib/public/appframework/http/jsonresponse.php index 7c2b609bc2e..b54b23a34e6 100644 --- a/lib/public/appframework/http/jsonresponse.php +++ b/lib/public/appframework/http/jsonresponse.php @@ -20,6 +20,10 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * AppFramework\HTTP\JSONResponse class + */ namespace OCP\AppFramework\Http; @@ -30,10 +34,15 @@ use OCP\AppFramework\Http; */ class JSONResponse extends Response { + /** + * response data + * @var array|object + */ protected $data; /** + * constructor of JSONResponse * @param array|object $data the object or array that should be transformed * @param int $statusCode the Http status code, defaults to 200 */ @@ -55,7 +64,7 @@ class JSONResponse extends Response { /** * Sets values in the data json array - * @param array|object $params an array or object which will be transformed + * @param array|object $data an array or object which will be transformed * to JSON */ public function setData($data){ diff --git a/lib/public/appframework/http/response.php b/lib/public/appframework/http/response.php index f776878a814..0f5a18ca4fe 100644 --- a/lib/public/appframework/http/response.php +++ b/lib/public/appframework/http/response.php @@ -20,6 +20,10 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * AppFramework\HTTP\Response class + */ namespace OCP\AppFramework\Http; diff --git a/lib/public/appframework/http/templateresponse.php b/lib/public/appframework/http/templateresponse.php index 6156f8062fc..2200a38beca 100644 --- a/lib/public/appframework/http/templateresponse.php +++ b/lib/public/appframework/http/templateresponse.php @@ -20,6 +20,10 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * AppFramework\HTTP\TemplateResponse class + */ namespace OCP\AppFramework\Http; @@ -29,14 +33,34 @@ namespace OCP\AppFramework\Http; */ class TemplateResponse extends Response { + /** + * name of the template + * @var string + */ protected $templateName; + + /** + * parameters + * @var array + */ protected $params; + + /** + * rendering type (admin, user, blank) + * @var string + */ protected $renderAs; + + /** + * app name + * @var string + */ protected $appName; /** - * @param string $templateName the name of the template + * constructor of TemplateResponse * @param string $appName the name of the app to load the template from + * @param string $templateName the name of the template */ public function __construct($appName, $templateName) { $this->templateName = $templateName; diff --git a/lib/public/appframework/middleware.php b/lib/public/appframework/middleware.php index c4ee1c0dbae..24f31939935 100644 --- a/lib/public/appframework/middleware.php +++ b/lib/public/appframework/middleware.php @@ -20,6 +20,10 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * AppFramework\Middleware class + */ namespace OCP\AppFramework; diff --git a/lib/public/icontainer.php b/lib/public/icontainer.php index 6b7052cc4f4..eaffa5d5a06 100644 --- a/lib/public/icontainer.php +++ b/lib/public/icontainer.php @@ -64,7 +64,7 @@ interface IContainer { * In case the parameter is false the service will be recreated on every call. * * @param string $name - * @param callable $closure + * @param \Closure $closure * @param bool $shared * @return void */ |