diff --git a/docs/View/Rss.md b/docs/View/Rss.md index b9c567de0..987093ab3 100644 --- a/docs/View/Rss.md +++ b/docs/View/Rss.md @@ -1,3 +1,3 @@ # Rss View -This has been moved to https://github.com/dereuromark/cakephp-feed \ No newline at end of file +This has been moved to [cakephp-feed plugin](https://github.com/dereuromark/cakephp-feed). diff --git a/src/Controller/Component/CommonComponent.php b/src/Controller/Component/CommonComponent.php index 46b3d73b6..b35d5b710 100644 --- a/src/Controller/Component/CommonComponent.php +++ b/src/Controller/Component/CommonComponent.php @@ -12,7 +12,6 @@ * A component included in every app to take care of common stuff. * * @author Mark Scherer - * @copyright 2012 Mark Scherer * @license MIT */ class CommonComponent extends Component { @@ -52,7 +51,7 @@ public function startup(Event $event) { * @return string|array */ public function getSafeRedirectUrl($default, $data = null, $key = 'redirect') { - $redirectUrl = $data ?: ($this->Controller->getRequest()->getData($key) ?: $this->Controller->getRequest()->getQuery($key)); + $redirectUrl = $data ?: ($this->Controller->request->getData($key) ?: $this->Controller->request->getQuery($key)); if ($redirectUrl && (substr($redirectUrl, 0, 1) !== '/' || substr($redirectUrl, 0, 2) === '//')) { $redirectUrl = null; } @@ -243,7 +242,7 @@ public function autoPostRedirect($whereTo, $conditionalAutoRedirect = true, $sta if (empty($controller) && $refererController !== $this->Controller->request->params['controller']) { continue; } - if (!in_array($referer['action'], $this->Controller->autoRedirectActions, true)) { + if (!in_array($referer['action'], (array)$this->Controller->autoRedirectActions, true)) { continue; } return $this->autoRedirect($whereTo, true, $status); diff --git a/src/Controller/Component/MobileComponent.php b/src/Controller/Component/MobileComponent.php index e9bc8fc4d..39173c4d1 100644 --- a/src/Controller/Component/MobileComponent.php +++ b/src/Controller/Component/MobileComponent.php @@ -194,6 +194,7 @@ public function isMobile() { * https://github.com/cakephp/cakephp/issues/2546 * * @return bool Success + * @throws \RuntimeException */ public function detect() { // Deprecated - the vendor libs are far more accurate and up to date diff --git a/src/TestSuite/IntegrationTestCase.php b/src/TestSuite/IntegrationTestCase.php index 19b71cda2..4abdd9bfb 100644 --- a/src/TestSuite/IntegrationTestCase.php +++ b/src/TestSuite/IntegrationTestCase.php @@ -23,8 +23,7 @@ abstract class IntegrationTestCase extends CakeIntegrationTestCase { /** * @return void */ - public function setUp() - { + public function setUp() { parent::setUp(); if (!$this->disableErrorHandlerMiddleware) { diff --git a/src/View/Helper/CommonHelper.php b/src/View/Helper/CommonHelper.php index 17ac27b48..094f07ca5 100644 --- a/src/View/Helper/CommonHelper.php +++ b/src/View/Helper/CommonHelper.php @@ -28,6 +28,7 @@ class CommonHelper extends Helper { * @param int $count * @param bool $autoTranslate * @return string "member" or "members" OR "Mitglied"/"Mitglieder" if autoTranslate TRUE + * @deprecated Use explicit form directly via sp() */ public function asp($singular, $count, $autoTranslate = false) { if ((int)$count !== 1) { @@ -88,7 +89,7 @@ public function metaRobots($type = null) { * Convenience method for clean meta name tags * * @param string|null $name Author, date, generator, revisit-after, language - * @param mixed|null $content If array, it will be separated by commas + * @param string|array|null $content If array, it will be separated by commas * @return string HTML Markup */ public function metaName($name = null, $content = null) { @@ -148,7 +149,7 @@ public function metaKeywords($keywords = null, $language = null, $escape = true) /** * Convenience function for "canonical" SEO links * - * @param mixed $url + * @param string|array|null $url * @param bool $full * @return string HTML Markup */ @@ -161,8 +162,8 @@ public function metaCanonical($url = null, $full = false) { /** * Convenience method for "alternate" SEO links * - * @param mixed $url - * @param mixed $lang (lang(iso2) or array of langs) + * @param string|array $url + * @param string|array $lang (lang(iso2) or array of langs) * lang: language (in ISO 6391-1 format) + optionally the region (in ISO 3166-1 Alpha 2 format) * - de * - de-ch @@ -195,7 +196,7 @@ public function metaAlternate($url, $lang, $full = false) { /** * Convenience method for META Tags * - * @param mixed $url + * @param string|array $url * @param string|null $title * @return string HTML Markup */ diff --git a/tests/TestCase/Controller/Component/CommonComponentTest.php b/tests/TestCase/Controller/Component/CommonComponentTest.php index ed8924d78..6cfbcb322 100644 --- a/tests/TestCase/Controller/Component/CommonComponentTest.php +++ b/tests/TestCase/Controller/Component/CommonComponentTest.php @@ -188,6 +188,15 @@ public function testAutoPostRedirectReferer() { $this->assertSame(302, $this->Controller->response->statusCode()); } + /** + * @return void + */ + public function testListActions() + { + $actions = $this->Controller->Common->listActions(); + $this->assertSame([], $actions); + } + /** * @return void */