Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Scherer committed Feb 14, 2016
1 parent aa7fc55 commit 3eabedd
Show file tree
Hide file tree
Showing 27 changed files with 37 additions and 37 deletions.
35 changes: 21 additions & 14 deletions config/bootstrap.php
Expand Up @@ -82,24 +82,31 @@ function isEmpty($var = null) {
function returns($value) {
if ($value === null) {
return 'NULL';
} elseif (is_array($value)) {
}
if (is_array($value)) {
return '(array)' . '<pre>' . print_r($value, true) . '</pre>';
} elseif ($value === true) {
}
if ($value === true) {
return '(bool)TRUE';
} elseif ($value === false) {
}
if ($value === false) {
return '(bool)FALSE';
} elseif (is_numeric($value) && is_float($value)) {
}
if (is_numeric($value) && is_float($value)) {
return '(float)' . $value;
} elseif (is_numeric($value) && is_int($value)) {
}
if (is_numeric($value) && is_int($value)) {
return '(int)' . $value;
} elseif (is_string($value)) {
}
if (is_string($value)) {
return '(string)' . $value;
} elseif (is_object($value)) {
}
if (is_object($value)) {
return '(object)' . get_class($value) . '<pre>' . print_r($value, true) .
'</pre>';
} else {
return '(unknown)' . $value;
}

return '(unknown)' . $value;
}

/**
Expand All @@ -113,7 +120,7 @@ function returns($value) {
* @return string Converted text
*/
function ent($text) {
return (!empty($text) ? htmlentities($text, ENT_QUOTES, 'UTF-8') : '');
return !empty($text) ? htmlentities($text, ENT_QUOTES, 'UTF-8') : '';
}

/**
Expand All @@ -139,7 +146,7 @@ function entDec($text, $quoteStyle = ENT_QUOTES) {
if (is_array($text)) {
return array_map('entDec', $text);
}
return (!empty($text) ? trim(html_entity_decode($text, $quoteStyle, 'UTF-8')) : '');
return !empty($text) ? trim(html_entity_decode($text, $quoteStyle, 'UTF-8')) : '';
}

/**
Expand Down Expand Up @@ -280,7 +287,7 @@ function pre($var, $collapsedAndExpandable = false, $options = []) {
*/
function contains($haystack, $needle, $caseSensitive = false) {
$result = !$caseSensitive ? stripos($haystack, $needle) : strpos($haystack, $needle);
return ($result !== false);
return $result !== false;
}

/**
Expand All @@ -292,9 +299,9 @@ function contains($haystack, $needle, $caseSensitive = false) {
*/
function startsWith($haystack, $needle, $caseSensitive = false) {
if ($caseSensitive) {
return (mb_strpos($haystack, $needle) === 0);
return mb_strpos($haystack, $needle) === 0;
}
return (mb_stripos($haystack, $needle) === 0);
return mb_stripos($haystack, $needle) === 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixture/AfterTreesFixture.php
Expand Up @@ -5,7 +5,6 @@

/**
* AfterTreeFixture class
*
*/
class AfterTreesFixture extends TestFixture {

Expand Down Expand Up @@ -37,4 +36,5 @@ class AfterTreesFixture extends TestFixture {
['parent_id' => null, 'lft' => 10, 'rght' => 11, 'name' => 'Six'],
['parent_id' => null, 'lft' => 13, 'rght' => 14, 'name' => 'Seven']
];

}
1 change: 0 additions & 1 deletion tests/Fixture/BitmaskedCommentsFixture.php
Expand Up @@ -5,7 +5,6 @@

/**
* For BitmaskedBehaviorTest
*
*/
class BitmaskedCommentsFixture extends TestFixture {

Expand Down
1 change: 1 addition & 0 deletions tests/Fixture/JsonableCommentsFixture.php
Expand Up @@ -16,4 +16,5 @@ class JsonableCommentsFixture extends TestFixture {

public $records = [
];

}
1 change: 0 additions & 1 deletion tests/Fixture/RolesFixture.php
Expand Up @@ -5,7 +5,6 @@

/**
* RoleFixture
*
*/
class RolesFixture extends TestFixture {

Expand Down
1 change: 0 additions & 1 deletion tests/Fixture/StoriesFixture.php
Expand Up @@ -5,7 +5,6 @@

/**
* RoleFixture
*
*/
class StoriesFixture extends TestFixture {

Expand Down
1 change: 1 addition & 0 deletions tests/Fixture/StringCommentsFixture.php
Expand Up @@ -15,4 +15,5 @@ class StringCommentsFixture extends TestFixture {

public $records = [
];

}
2 changes: 1 addition & 1 deletion tests/Fixture/TokensFixture.php
Expand Up @@ -5,7 +5,6 @@

/**
* TokenFixture
*
*/
class TokensFixture extends TestFixture {

Expand Down Expand Up @@ -133,4 +132,5 @@ class TokensFixture extends TestFixture {
'modified' => '2011-08-02 18:01:54'
],
];

}
1 change: 0 additions & 1 deletion tests/TestApp/Controller/Component/AppleComponent.php
Expand Up @@ -7,7 +7,6 @@

/**
* AppleComponent class
*
*/
class AppleComponent extends Component {

Expand Down
1 change: 0 additions & 1 deletion tests/TestApp/Controller/Component/BananaComponent.php
Expand Up @@ -7,7 +7,6 @@

/**
* BananaComponent class
*
*/
class BananaComponent extends Component {

Expand Down
1 change: 1 addition & 0 deletions tests/TestApp/Model/Entity/BitmaskedComment.php
Expand Up @@ -22,4 +22,5 @@ public static function statuses($value = null) {
const STATUS_PUBLISHED = 2;
const STATUS_APPROVED = 4;
const STATUS_FLAGGED = 8;

}
2 changes: 2 additions & 0 deletions tests/TestApp/Model/Entity/SluggedArticle.php
Expand Up @@ -5,6 +5,7 @@
use Cake\ORM\Entity;

class SluggedArticle extends Entity {

/**
* Virtual field
*
Expand All @@ -13,4 +14,5 @@ class SluggedArticle extends Entity {
protected function _getSpecial() {
return 'dereuromark';
}

}
1 change: 0 additions & 1 deletion tests/TestCase/BootstrapTest.php
Expand Up @@ -10,7 +10,6 @@

/**
* RssViewTest
*
*/
class BootstrapTest extends TestCase {

Expand Down
Expand Up @@ -11,7 +11,6 @@

/**
* AuthUserComponent class
*
*/
class AuthUserComponentTest extends TestCase {

Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Controller/Component/FlashComponentTest.php
Expand Up @@ -137,4 +137,5 @@ public function redirect($url, $status = null, $exit = true) {
public function header($status) {
$this->testHeaders[] = $status;
}

}
1 change: 0 additions & 1 deletion tests/TestCase/Mailer/EmailTest.php
Expand Up @@ -10,7 +10,6 @@

/**
* Help to test Email
*
*/
class TestEmail extends Email {

Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Model/Behavior/JsonableBehaviorTest.php
Expand Up @@ -340,4 +340,5 @@ public function testDecodeParams() {
$expected = ['x' => ['y' => 'z']];
$this->assertEquals($expected, $res['details']);
}

}
4 changes: 2 additions & 2 deletions tests/TestCase/Model/Behavior/SluggedBehaviorTest.php
Expand Up @@ -373,8 +373,8 @@ public function testDuplicateWithLengthRestriction() {
* TestTruncateMultibyte method
*
* Ensure that the first test doesn't cut a multibyte character The test string is:
* 17 chars
* 51 bytes UTF-8 encoded
* 17 chars
* 51 bytes UTF-8 encoded
*
* @return void
*/
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/Utility/L10nTest.php
Expand Up @@ -6,7 +6,6 @@

/**
* L10nTest class
*
*/
class L10nTest extends TestCase {

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Utility/TextTest.php
Expand Up @@ -32,7 +32,7 @@ public function testReadTab() {

/**
* @return void
*/
*/
public function testReadWithPattern() {
$data = <<<TXT
some random data
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/View/Helper/AuthUserHelperTest.php
Expand Up @@ -8,7 +8,6 @@

/**
* AuthUserHelper class
*
*/
class AuthUserHelperTest extends TestCase {

Expand Down
5 changes: 3 additions & 2 deletions tests/TestCase/View/Helper/GravatarHelperTest.php
Expand Up @@ -8,7 +8,6 @@

/**
* Gravatar Test Case
*
*/
class GravatarHelperTest extends TestCase {

Expand Down Expand Up @@ -87,7 +86,9 @@ public function testImages() {
$this->assertTrue(!empty($is));
}

/** BASE TEST CASES **/
/**
* BASE TEST CASES
**/

/**
* TestBaseUrlGeneration
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/View/Helper/HtmlHelperTest.php
Expand Up @@ -12,7 +12,6 @@

/**
* Datetime Test Case
*
*/
class HtmlHelperTest extends TestCase {

Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/View/Helper/NumberHelperTest.php
Expand Up @@ -118,4 +118,5 @@ public function tearDown() {

unset($this->Number);
}

}
1 change: 0 additions & 1 deletion tests/TestCase/View/Helper/TimeHelperTest.php
Expand Up @@ -9,7 +9,6 @@

/**
* Datetime Test Case
*
*/
class TimeHelperTest extends TestCase {

Expand Down
3 changes: 0 additions & 3 deletions tests/TestCase/View/Helper/TreeHelperTest.php
Expand Up @@ -31,7 +31,6 @@ class TreeHelperTest extends TestCase {
* - Three
* - Four
* -- Four-SubA
*
*/
public function setUp() {
parent::setUp();
Expand Down Expand Up @@ -370,7 +369,6 @@ public function testGenerateWithAutoPath() {
}

/**
*
* - One
* -- One-SubA
* - Two
Expand Down Expand Up @@ -431,7 +429,6 @@ public function testGenerateWithAutoPathAndHideUnrelated() {
}

/**
*
* - One
* -- One-SubA
* - Two
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/View/Helper/UrlHelperTest.php
Expand Up @@ -11,7 +11,6 @@

/**
* Datetime Test Case
*
*/
class UrlHelperTest extends TestCase {

Expand Down

0 comments on commit 3eabedd

Please sign in to comment.