mscherer 7 years ago
parent
commit
3807be552e

+ 1 - 1
docs/View/Rss.md

@@ -1,3 +1,3 @@
 # Rss View
 
-This has been moved to https://github.com/dereuromark/cakephp-feed
+This has been moved to [cakephp-feed plugin](https://github.com/dereuromark/cakephp-feed).

+ 2 - 3
src/Controller/Component/CommonComponent.php

@@ -12,7 +12,6 @@ use Tools\Utility\Utility;
  * 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 @@ class CommonComponent extends Component {
 	 * @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 @@ class CommonComponent extends Component {
 				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);

+ 1 - 0
src/Controller/Component/MobileComponent.php

@@ -194,6 +194,7 @@ class MobileComponent extends Component {
 	 * 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

+ 1 - 2
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) {

+ 6 - 5
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 @@ class CommonHelper extends Helper {
 	 * 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 @@ class CommonHelper extends Helper {
 	/**
 	 * 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 @@ class CommonHelper extends Helper {
 	/**
 	 * 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 @@ class CommonHelper extends Helper {
 	/**
 	 * Convenience method for META Tags
 	 *
-	 * @param mixed $url
+	 * @param string|array $url
 	 * @param string|null $title
 	 * @return string HTML Markup
 	 */

+ 9 - 0
tests/TestCase/Controller/Component/CommonComponentTest.php

@@ -191,6 +191,15 @@ class CommonComponentTest extends TestCase {
 	/**
 	 * @return void
 	 */
+	public function testListActions()
+	{
+		$actions = $this->Controller->Common->listActions();
+		$this->assertSame([], $actions);
+	}
+
+	/**
+	 * @return void
+	 */
 	public function testAutoPostRedirectRefererNotWhitelisted() {
 		$this->request->env('HTTP_REFERER', 'http://localhost/my_controller/wrong');