summaryrefslogtreecommitdiffstats
path: root/Csrf
diff options
context:
space:
mode:
Diffstat (limited to 'Csrf')
-rw-r--r--Csrf/README.md2
-rw-r--r--Csrf/Tests/TokenGenerator/UriSafeTokenGeneratorTest.php6
-rw-r--r--Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php4
-rw-r--r--Csrf/TokenGenerator/UriSafeTokenGenerator.php10
-rw-r--r--Csrf/TokenStorage/NativeSessionTokenStorage.php6
-rw-r--r--Csrf/composer.json10
6 files changed, 8 insertions, 30 deletions
diff --git a/Csrf/README.md b/Csrf/README.md
index 10f4784..d331d3c 100644
--- a/Csrf/README.md
+++ b/Csrf/README.md
@@ -9,7 +9,7 @@ Resources
Documentation:
-https://symfony.com/doc/2.8/book/security.html
+https://symfony.com/doc/3.0/book/security.html
Tests
-----
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 0039deb..ef49f2f 100644
--- a/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php
+++ b/Csrf/Tests/TokenStorage/NativeSessionTokenStorageTest.php
@@ -52,10 +52,6 @@ class NativeSessionTokenStorageTest extends \PHPUnit_Framework_TestCase
public function testStoreTokenInClosedSessionWithExistingSessionId()
{
- if (PHP_VERSION_ID < 50400) {
- $this->markTestSkipped('This test requires PHP 5.4 or later.');
- }
-
session_id('foobar');
$this->assertSame(PHP_SESSION_NONE, session_status());
diff --git a/Csrf/TokenGenerator/UriSafeTokenGenerator.php b/Csrf/TokenGenerator/UriSafeTokenGenerator.php
index fa5a722..f331803 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.
*
@@ -36,13 +34,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 2620156..a237b55 100644
--- a/Csrf/TokenStorage/NativeSessionTokenStorage.php
+++ b/Csrf/TokenStorage/NativeSessionTokenStorage.php
@@ -110,11 +110,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 95b1c59..41dc21c 100644
--- a/Csrf/composer.json
+++ b/Csrf/composer.json
@@ -16,13 +16,13 @@
}
],
"require": {
- "php": ">=5.3.9",
- "symfony/security-core": "~2.4|~3.0.0",
+ "php": ">=5.5.9",
+ "symfony/security-core": "~2.8|~3.0",
"paragonie/random_compat" : "~1.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7|~3.0.0",
- "symfony/http-foundation": "~2.1|~3.0.0"
+ "symfony/phpunit-bridge": "~2.8|~3.0",
+ "symfony/http-foundation": "~2.8|~3.0"
},
"suggest": {
"symfony/http-foundation": "For using the class SessionTokenStorage."
@@ -33,7 +33,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "2.8-dev"
+ "dev-master": "3.0-dev"
}
}
}