summaryrefslogtreecommitdiffstats
path: root/Csrf
diff options
context:
space:
mode:
Diffstat (limited to 'Csrf')
-rw-r--r--Csrf/Tests/TokenGenerator/UriSafeTokenGeneratorTest.php6
-rw-r--r--Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php3
-rw-r--r--Csrf/TokenGenerator/UriSafeTokenGenerator.php10
-rw-r--r--Csrf/TokenStorage/NativeSessionTokenStorage.php6
-rw-r--r--Csrf/composer.json8
5 files changed, 6 insertions, 27 deletions
diff --git a/Csrf/Tests/TokenGenerator/UriSafeTokenGeneratorTest.php b/Csrf/Tests/TokenGenerator/UriSafeTokenGeneratorTest.php
index e4ea80c..320dfc8 100644
--- a/Csrf/Tests/TokenGenerator/UriSafeTokenGeneratorTest.php
+++ b/Csrf/Tests/TokenGenerator/UriSafeTokenGeneratorTest.php
@@ -28,11 +28,6 @@ class UriSafeTokenGeneratorTest extends \PHPUnit_Framework_TestCase
private static $bytes;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject
- */
- private $random;
-
- /**
* @var UriSafeTokenGenerator
*/
private $generator;
@@ -49,7 +44,6 @@ class UriSafeTokenGeneratorTest extends \PHPUnit_Framework_TestCase
protected function tearDown()
{
- $this->random = null;
$this->generator = null;
}
diff --git a/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php b/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php
index 7d3a537..ef49f2f 100644
--- a/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php
+++ b/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php
@@ -50,9 +50,6 @@ class NativeSessionTokenStorageTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array(self::SESSION_NAMESPACE => array('token_id' => 'TOKEN')), $_SESSION);
}
- /**
- * @requires PHP 5.4
- */
public function testStoreTokenInClosedSessionWithExistingSessionId()
{
session_id('foobar');
diff --git a/Csrf/TokenGenerator/UriSafeTokenGenerator.php b/Csrf/TokenGenerator/UriSafeTokenGenerator.php
index 432adf2..fb3f7e8 100644
--- a/Csrf/TokenGenerator/UriSafeTokenGenerator.php
+++ b/Csrf/TokenGenerator/UriSafeTokenGenerator.php
@@ -11,8 +11,6 @@
namespace Symfony\Component\Security\Csrf\TokenGenerator;
-use Symfony\Component\Security\Core\Util\SecureRandomInterface;
-
/**
* Generates CSRF tokens.
*
@@ -34,13 +32,7 @@ class UriSafeTokenGenerator implements TokenGeneratorInterface
*/
public function __construct($entropy = 256)
{
- if ($entropy instanceof SecureRandomInterface || func_num_args() === 2) {
- @trigger_error('The '.__METHOD__.' method now requires the entropy to be given as the first argument. The SecureRandomInterface will be removed in 3.0.', E_USER_DEPRECATED);
-
- $this->entropy = func_num_args() === 2 ? func_get_arg(1) : 256;
- } else {
- $this->entropy = $entropy;
- }
+ $this->entropy = $entropy;
}
/**
diff --git a/Csrf/TokenStorage/NativeSessionTokenStorage.php b/Csrf/TokenStorage/NativeSessionTokenStorage.php
index 71151fa..5ce2774 100644
--- a/Csrf/TokenStorage/NativeSessionTokenStorage.php
+++ b/Csrf/TokenStorage/NativeSessionTokenStorage.php
@@ -108,11 +108,7 @@ class NativeSessionTokenStorage implements TokenStorageInterface
private function startSession()
{
- if (PHP_VERSION_ID >= 50400) {
- if (PHP_SESSION_NONE === session_status()) {
- session_start();
- }
- } elseif (!session_id()) {
+ if (PHP_SESSION_NONE === session_status()) {
session_start();
}
diff --git a/Csrf/composer.json b/Csrf/composer.json
index 4afc7ca..d111fa1 100644
--- a/Csrf/composer.json
+++ b/Csrf/composer.json
@@ -16,13 +16,13 @@
}
],
"require": {
- "php": ">=5.3.9",
+ "php": ">=5.5.9",
"symfony/polyfill-php56": "~1.0",
"symfony/polyfill-php70": "~1.0",
- "symfony/security-core": "~2.4|~3.0.0"
+ "symfony/security-core": "~2.8|~3.0"
},
"require-dev": {
- "symfony/http-foundation": "~2.1|~3.0.0"
+ "symfony/http-foundation": "~2.8|~3.0"
},
"suggest": {
"symfony/http-foundation": "For using the class SessionTokenStorage."
@@ -36,7 +36,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.1-dev"
}
}
}