Skip to content

Commit

Permalink
Fix CS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Jul 12, 2018
1 parent 56aac62 commit 3807be5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion 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).
5 changes: 2 additions & 3 deletions src/Controller/Component/CommonComponent.php
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Component/MobileComponent.php
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/TestSuite/IntegrationTestCase.php
Expand Up @@ -23,8 +23,7 @@ abstract class IntegrationTestCase extends CakeIntegrationTestCase {
/**
* @return void
*/
public function setUp()
{
public function setUp() {
parent::setUp();

if (!$this->disableErrorHandlerMiddleware) {
Expand Down
11 changes: 6 additions & 5 deletions src/View/Helper/CommonHelper.php
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
*/
Expand All @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down
9 changes: 9 additions & 0 deletions tests/TestCase/Controller/Component/CommonComponentTest.php
Expand Up @@ -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
*/
Expand Down

0 comments on commit 3807be5

Please sign in to comment.