From 7f0eefbde55f0fa7e6021a7b8b1c7864fff1a802 Mon Sep 17 00:00:00 2001 From: yaman-jain Date: Wed, 18 Nov 2015 02:32:44 +0530 Subject: [PATCH 1/2] updated/added PhpDoc for methods --- system/src/Grav/Common/Filesystem/Folder.php | 4 ++-- system/src/Grav/Common/GPM/Remote/Plugins.php | 2 ++ system/src/Grav/Common/GPM/Remote/Themes.php | 2 ++ system/src/Grav/Common/GPM/Response.php | 6 ++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Common/Filesystem/Folder.php b/system/src/Grav/Common/Filesystem/Folder.php index 6026d8f04..af1b93352 100644 --- a/system/src/Grav/Common/Filesystem/Folder.php +++ b/system/src/Grav/Common/Filesystem/Folder.php @@ -64,8 +64,8 @@ abstract class Folder /** * Get relative path between target and base path. If path isn't relative, return full path. * - * @param string $path - * @param string $base + * @param string $path + * @param mixed|string $base * @return string */ public static function getRelativePath($path, $base = GRAV_ROOT) diff --git a/system/src/Grav/Common/GPM/Remote/Plugins.php b/system/src/Grav/Common/GPM/Remote/Plugins.php index ec6d64521..e40135096 100644 --- a/system/src/Grav/Common/GPM/Remote/Plugins.php +++ b/system/src/Grav/Common/GPM/Remote/Plugins.php @@ -16,6 +16,8 @@ class Plugins extends AbstractPackageCollection /** * Local Plugins Constructor + * @param bool $refresh + * @param null $callback */ public function __construct($refresh = false, $callback = null) { diff --git a/system/src/Grav/Common/GPM/Remote/Themes.php b/system/src/Grav/Common/GPM/Remote/Themes.php index 759b7e10a..e9ffacbdc 100644 --- a/system/src/Grav/Common/GPM/Remote/Themes.php +++ b/system/src/Grav/Common/GPM/Remote/Themes.php @@ -16,6 +16,8 @@ class Themes extends AbstractPackageCollection /** * Local Themes Constructor + * @param bool $refresh + * @param null $callback */ public function __construct($refresh = false, $callback = null) { diff --git a/system/src/Grav/Common/GPM/Response.php b/system/src/Grav/Common/GPM/Response.php index 4f61e2b42..0df7e3876 100644 --- a/system/src/Grav/Common/GPM/Response.php +++ b/system/src/Grav/Common/GPM/Response.php @@ -50,6 +50,7 @@ class Response /** * Sets the preferred method to use for making HTTP calls. * @param string $method Default is `auto` + * @return Response */ public static function setMethod($method = 'auto') { @@ -64,8 +65,9 @@ class Response /** * Makes a request to the URL by using the preferred method - * @param string $uri URL to call - * @param array $options An array of parameters for both `curl` and `fopen` + * @param string $uri URL to call + * @param array $options An array of parameters for both `curl` and `fopen` + * @param null $callback * @return string The response of the request */ public static function get($uri = '', $options = [], $callback = null) From 49a5b38589968e655d9b0762585a428f23132130 Mon Sep 17 00:00:00 2001 From: yaman-jain Date: Wed, 18 Nov 2015 16:01:19 +0530 Subject: [PATCH 2/2] PhpDoc: callback definition as per #451 --- system/src/Grav/Common/GPM/Remote/Plugins.php | 2 +- system/src/Grav/Common/GPM/Remote/Themes.php | 2 +- system/src/Grav/Common/GPM/Response.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/GPM/Remote/Plugins.php b/system/src/Grav/Common/GPM/Remote/Plugins.php index e40135096..df8668491 100644 --- a/system/src/Grav/Common/GPM/Remote/Plugins.php +++ b/system/src/Grav/Common/GPM/Remote/Plugins.php @@ -17,7 +17,7 @@ class Plugins extends AbstractPackageCollection /** * Local Plugins Constructor * @param bool $refresh - * @param null $callback + * @param callable $callback Either a function or callback in array notation */ public function __construct($refresh = false, $callback = null) { diff --git a/system/src/Grav/Common/GPM/Remote/Themes.php b/system/src/Grav/Common/GPM/Remote/Themes.php index e9ffacbdc..0af055b03 100644 --- a/system/src/Grav/Common/GPM/Remote/Themes.php +++ b/system/src/Grav/Common/GPM/Remote/Themes.php @@ -17,7 +17,7 @@ class Themes extends AbstractPackageCollection /** * Local Themes Constructor * @param bool $refresh - * @param null $callback + * @param callable $callback Either a function or callback in array notation */ public function __construct($refresh = false, $callback = null) { diff --git a/system/src/Grav/Common/GPM/Response.php b/system/src/Grav/Common/GPM/Response.php index 0df7e3876..d2b446b3b 100644 --- a/system/src/Grav/Common/GPM/Response.php +++ b/system/src/Grav/Common/GPM/Response.php @@ -67,7 +67,7 @@ class Response * Makes a request to the URL by using the preferred method * @param string $uri URL to call * @param array $options An array of parameters for both `curl` and `fopen` - * @param null $callback + * @param callable $callback Either a function or callback in array notation * @return string The response of the request */ public static function get($uri = '', $options = [], $callback = null)