Skip to content

Commit

Permalink
[HttpFoundation] Deprecated count() and \Countable
Browse files Browse the repository at this point in the history
  • Loading branch information
Drak committed Jan 7, 2013
1 parent 43d056f commit 0cf9fcb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpFoundation/CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@ CHANGELOG
* added Request::getRealMethod() to get the "real" HTTP method (getMethod() returns the "intended" HTTP method)
* disabled _method request parameter support by default (call Request::enableHttpMethodParameterOverride() to enable it)
* Request::splitHttpAcceptHeader() method is deprecated and will be removed in 2.3
* Deprecated Flashbag::count() and \Countable interface, will be removed in 2.3

2.1.0
-----
Expand Down
Expand Up @@ -181,6 +181,8 @@ public function getIterator()
*/
public function count()
{
trigger_error(sprintf('%s() is deprecated since 2.2 and will be removed in 2.3', __METHOD__), E_USER_DEPRECATED);

return count($this->flashes);
}
}
Expand Up @@ -135,6 +135,7 @@ public function testPeekAll()

/**
* @covers Symfony\Component\HttpFoundation\Session\Flash\FlashBag::count
* @expectedException \PHPUnit_Framework_Error_Deprecated
*/
public function testCount()
{
Expand Down Expand Up @@ -163,6 +164,6 @@ public function testGetIterator()
}

$this->assertEquals(count($flashes), $i);
$this->assertEquals(0, count($this->bag));
$this->assertEquals(0, count($this->bag->all()));
}
}

0 comments on commit 0cf9fcb

Please sign in to comment.