diff --git a/system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php b/system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php index 8b5954c11..2e97f0c47 100644 --- a/system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php +++ b/system/src/Grav/Common/Assets/Traits/LegacyAssetsTrait.php @@ -82,12 +82,13 @@ trait LegacyAssetsTrait * @param bool $pipeline * @param string $group name of the group * - * @deprecated Please use dynamic method with ['loading' => 'async'] - * * @return \Grav\Common\Assets + * @deprecated Please use dynamic method with ['loading' => 'async']. */ public function addAsyncJs($asset, $priority = 10, $pipeline = true, $group = 'head') { + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6, use dynamic method with [\'loading\' => \'async\']', E_USER_DEPRECATED); + return $this->addJs($asset, $priority, $pipeline, 'async', $group); } @@ -99,12 +100,13 @@ trait LegacyAssetsTrait * @param bool $pipeline * @param string $group name of the group * - * @deprecated Please use dynamic method with ['loading' => 'defer'] - * * @return \Grav\Common\Assets + * @deprecated Please use dynamic method with ['loading' => 'defer']. */ public function addDeferJs($asset, $priority = 10, $pipeline = true, $group = 'head') { + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6, use dynamic method with [\'loading\' => \'defer\']', E_USER_DEPRECATED); + return $this->addJs($asset, $priority, $pipeline, 'defer', $group); } diff --git a/system/src/Grav/Common/Config/Config.php b/system/src/Grav/Common/Config/Config.php index 1635bd382..9eaf57abd 100644 --- a/system/src/Grav/Common/Config/Config.php +++ b/system/src/Grav/Common/Config/Config.php @@ -116,7 +116,7 @@ class Config extends Data /** * @return mixed - * @deprecated + * @deprecated 1.5 Use Grav::instance()['languages'] instead. */ public function getLanguages() { diff --git a/system/src/Grav/Common/Form/FormFlash.php b/system/src/Grav/Common/Form/FormFlash.php index 26c9a6ab3..abd4565f6 100644 --- a/system/src/Grav/Common/Form/FormFlash.php +++ b/system/src/Grav/Common/Form/FormFlash.php @@ -60,7 +60,7 @@ class FormFlash extends \Grav\Framework\Form\FormFlash /** * @return array - * @deprecated 1.6 For backwards compatibility only, do not use. + * @deprecated 1.6 For backwards compatibility only, do not use */ public function getLegacyFiles(): array { @@ -85,7 +85,7 @@ class FormFlash extends \Grav\Framework\Form\FormFlash * @param string $filename * @param array $upload * @return bool - * @deprecated 1.6 For backwards compatibility only, do not use. + * @deprecated 1.6 For backwards compatibility only, do not use */ public function uploadFile(string $field, string $filename, array $upload): bool { @@ -114,7 +114,7 @@ class FormFlash extends \Grav\Framework\Form\FormFlash * @param array $upload * @param array $crop * @return bool - * @deprecated 1.6 For backwards compatibility only, do not use. + * @deprecated 1.6 For backwards compatibility only, do not use */ public function cropFile(string $field, string $filename, array $upload, array $crop): bool { diff --git a/system/src/Grav/Common/GravTrait.php b/system/src/Grav/Common/GravTrait.php index 790dc79a2..a82c23a9e 100644 --- a/system/src/Grav/Common/GravTrait.php +++ b/system/src/Grav/Common/GravTrait.php @@ -10,7 +10,7 @@ namespace Grav\Common; /** - * @deprecated 1.4 Use Grav::instance() instead + * @deprecated 1.4 Use Grav::instance() instead. */ trait GravTrait { @@ -18,15 +18,16 @@ trait GravTrait /** * @return Grav + * @deprecated 1.4 Use Grav::instance() instead. */ public static function getGrav() { + user_error(__TRAIT__ . ' is deprecated since Grav 1.4, use Grav::instance() instead', E_USER_DEPRECATED); + if (!self::$grav) { self::$grav = Grav::instance(); } - user_error(__TRAIT__ . ' is deprecated since Grav 1.4, use Grav::instance() instead', E_USER_DEPRECATED); - return self::$grav; } } diff --git a/system/src/Grav/Common/Language/Language.php b/system/src/Grav/Common/Language/Language.php index 82e14ccdd..40ab6355a 100644 --- a/system/src/Grav/Common/Language/Language.php +++ b/system/src/Grav/Common/Language/Language.php @@ -473,10 +473,9 @@ class Language /** * Get the browser accepted languages * - * @deprecated 1.6.0 no longer used - using content negotiation - * * @param array $accept_langs * @return array + * @deprecated 1.6 No longer used - using content negotiation. */ public function getBrowserLanguages($accept_langs = []) { diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index e8dbad252..16c1dcc36 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2186,10 +2186,12 @@ class Page implements PageInterface * @param string $var the order, either "asc" or "desc" * * @return string the order, either "asc" or "desc" - * @deprecated + * @deprecated 1.6 */ public function orderDir($var = null) { + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED); + if ($var !== null) { $this->order_dir = $var; } @@ -2212,10 +2214,12 @@ class Page implements PageInterface * @param string $var supported options include "default", "title", "date", and "folder" * * @return string supported options include "default", "title", "date", and "folder" - * @deprecated + * @deprecated 1.6 */ public function orderBy($var = null) { + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED); + if ($var !== null) { $this->order_by = $var; } @@ -2229,10 +2233,12 @@ class Page implements PageInterface * @param string $var supported options include "default", "title", "date", and "folder" * * @return array - * @deprecated + * @deprecated 1.6 */ public function orderManual($var = null) { + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED); + if ($var !== null) { $this->order_manual = $var; } @@ -2247,10 +2253,12 @@ class Page implements PageInterface * @param int $var the maximum number of sub-pages * * @return int the maximum number of sub-pages - * @deprecated + * @deprecated 1.6 */ public function maxCount($var = null) { + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.6', E_USER_DEPRECATED); + if ($var !== null) { $this->max_count = (int)$var; } diff --git a/system/src/Grav/Common/Session.php b/system/src/Grav/Common/Session.php index 3464400dd..cd9b2c175 100644 --- a/system/src/Grav/Common/Session.php +++ b/system/src/Grav/Common/Session.php @@ -18,11 +18,11 @@ class Session extends \Grav\Framework\Session\Session /** * @return \Grav\Framework\Session\Session - * @deprecated 1.5 Use getInstance() method instead + * @deprecated 1.5 Use ->getInstance() method instead. */ public static function instance() { - user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use getInstance() method instead', E_USER_DEPRECATED); + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use ->getInstance() method instead', E_USER_DEPRECATED); return static::getInstance(); } @@ -56,11 +56,11 @@ class Session extends \Grav\Framework\Session\Session * Returns attributes. * * @return array Attributes - * @deprecated 1.5 Use getAll() method instead + * @deprecated 1.5 Use ->getAll() method instead. */ public function all() { - user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use getAll() method instead', E_USER_DEPRECATED); + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use ->getAll() method instead', E_USER_DEPRECATED); return $this->getAll(); } @@ -69,11 +69,11 @@ class Session extends \Grav\Framework\Session\Session * Checks if the session was started. * * @return Boolean - * @deprecated 1.5 Use isStarted() method instead + * @deprecated 1.5 Use ->isStarted() method instead. */ public function started() { - user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use isStarted() method instead', E_USER_DEPRECATED); + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use ->isStarted() method instead', E_USER_DEPRECATED); return $this->isStarted(); } diff --git a/system/src/Grav/Common/Twig/Twig.php b/system/src/Grav/Common/Twig/Twig.php index d08792007..3b9fd44c8 100644 --- a/system/src/Grav/Common/Twig/Twig.php +++ b/system/src/Grav/Common/Twig/Twig.php @@ -438,7 +438,7 @@ class Twig * Overrides the autoescape setting * * @param boolean $state - * @deprecated 1.5 + * @deprecated 1.5 Auto-escape should always be turned on to protect against XSS issues (can be disabled per template file). */ public function setAutoescape($state) { diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index 62a7dc2ce..d074db14d 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -949,11 +949,11 @@ abstract class Utils * @param null $default * @return mixed * - * @deprecated Use getDotNotation() method instead + * @deprecated 1.5 Use ->getDotNotation() method instead. */ public static function resolve(array $array, $path, $default = null) { - user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use getDotNotation() method instead', E_USER_DEPRECATED); + user_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated since Grav 1.5, use ->getDotNotation() method instead', E_USER_DEPRECATED); return static::getDotNotation($array, $path, $default); } diff --git a/system/src/Grav/Framework/Flex/FlexObject.php b/system/src/Grav/Framework/Flex/FlexObject.php index c04ca55c3..24a4bef42 100644 --- a/system/src/Grav/Framework/Flex/FlexObject.php +++ b/system/src/Grav/Framework/Flex/FlexObject.php @@ -216,7 +216,7 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface * Alias of getBlueprint() * * @return Blueprint - * @deprecated Admin compatibility + * @deprecated 1.6 Admin compatibility */ public function blueprints() { diff --git a/system/src/Grav/Framework/Psr7/AbstractUri.php b/system/src/Grav/Framework/Psr7/AbstractUri.php index 942dc8e7e..e0d46b660 100644 --- a/system/src/Grav/Framework/Psr7/AbstractUri.php +++ b/system/src/Grav/Framework/Psr7/AbstractUri.php @@ -16,7 +16,7 @@ use Psr\Http\Message\UriInterface; * Bare minimum PSR7 implementation. * * @package Grav\Framework\Uri\Psr7 - * @deprecated 1.6 + * @deprecated 1.6 Using message PSR-7 decorators instead. */ abstract class AbstractUri implements UriInterface { diff --git a/system/src/Grav/Framework/Route/Route.php b/system/src/Grav/Framework/Route/Route.php index 1186036e5..5a625945a 100644 --- a/system/src/Grav/Framework/Route/Route.php +++ b/system/src/Grav/Framework/Route/Route.php @@ -275,7 +275,7 @@ class Route /** * @return string - * @deprecated 1.6 + * @deprecated 1.6 Use ->toString(true) or ->getUri() instead. */ public function __toString() {