Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove deprecated loggedIn

remove deprecated String feature
  • Loading branch information...
commit 7ee1084b3beaba67d523eabafefd34ab6d767162 1 parent 9efdb25
@dereuromark dereuromark authored
View
11 Cake/Controller/Component/AuthComponent.php
@@ -606,7 +606,7 @@ public function login($user = null) {
$this->Session->renew();
$this->Session->write(static::$sessionKey, $user);
}
- return $this->loggedIn();
+ return (bool)$this->user();
}
/**
@@ -782,15 +782,6 @@ public function constructAuthenticate() {
}
/**
- * Check whether or not the current user has data in the session, and is considered logged in.
- *
- * @return boolean true if the user is logged in, false otherwise
- */
- public function loggedIn() {
- return (bool)$this->user();
- }
-
-/**
* Set a flash message. Uses the Session component, and values from AuthComponent::$flash.
*
* @param string $message The message to set.
View
6 Cake/Utility/String.php
@@ -505,7 +505,7 @@ public static function tail($text, $length = 100, $options = array()) {
*
* ### Options:
*
- * - `ellipsis` Will be used as Ending and appended to the trimmed string (`ending` is deprecated)
+ * - `ellipsis` Will be used as ending and appended to the trimmed string
* - `exact` If false, $text will not be cut mid-word
* - `html` If true, HTML tags would be handled correctly
*
@@ -519,9 +519,7 @@ public static function truncate($text, $length = 100, $options = array()) {
$default = array(
'ellipsis' => '...', 'exact' => true, 'html' => false
);
- if (isset($options['ending'])) {
- $default['ellipsis'] = $options['ending'];
- } elseif (!empty($options['html']) && Configure::read('App.encoding') === 'UTF-8') {
+ if (!empty($options['html']) && Configure::read('App.encoding') === 'UTF-8') {
$default['ellipsis'] = "\xe2\x80\xa6";
}
$options = array_merge($default, $options);
View
1  Cake/Validation/Validation.php
@@ -634,7 +634,6 @@ public static function phone($check, $regex = null, $country = 'all') {
switch ($country) {
case 'us':
case 'ca':
- case 'can': // deprecated three-letter-code
case 'all':
// includes all NANPA members.
// see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories
View
6 Test/TestCase/Controller/Component/AuthComponentTest.php
@@ -177,7 +177,7 @@ class_alias('AuthLoginFormAuthenticate', 'Cake\Controller\Component\Auth\AuthLog
$result = $this->Auth->login();
$this->assertTrue($result);
- $this->assertTrue($this->Auth->loggedIn());
+ $this->assertTrue((bool)$this->Auth->user());
$this->assertEquals($user, $this->Auth->user());
}
@@ -1075,7 +1075,7 @@ class_alias('RequestLoginMockAuthenticate', 'Cake\Controller\Component\Auth\Requ
* @return void
*/
public function testLoginWithUserData() {
- $this->assertFalse($this->Auth->loggedIn());
+ $this->assertFalse((bool)$this->Auth->user());
$user = array(
'username' => 'mariano',
@@ -1084,7 +1084,7 @@ public function testLoginWithUserData() {
'updated' => new \DateTime('2007-03-17 01:18:31')
);
$this->assertTrue($this->Auth->login($user));
- $this->assertTrue($this->Auth->loggedIn());
+ $this->assertTrue((bool)$this->Auth->user());
$this->assertEquals($user['username'], $this->Auth->user('username'));
}
View
16 Test/TestCase/Utility/StringTest.php
@@ -504,22 +504,6 @@ public function testTruncate() {
podeís adquirirla.</span></p>
<p><span style="font-size: medium;"><a>... </a></span></p>';
$this->assertEquals($expected, $result);
-
- // test deprecated `ending` (`ellipsis` taking precedence if both are defined)
- $result = $this->Text->truncate($text1, 31, array(
- 'ending' => '.',
- 'exact' => false,
- ));
- $expected = 'The quick brown fox jumps.';
- $this->assertEquals($expected, $result);
-
- $result = $this->Text->truncate($text1, 31, array(
- 'ellipsis' => '..',
- 'ending' => '.',
- 'exact' => false,
- ));
- $expected = 'The quick brown fox jumps..';
- $this->assertEquals($expected, $result);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.