Merge branch '5.0'

* 5.0:
  [Bridge/PhpUnit] fix parse error on PHP5
  Replace 403 with 401 in onAuthenticationFailure method
This commit is contained in:
Nicolas Grekas 2020-02-05 19:24:38 +01:00
commit 32f2374426
3 changed files with 10 additions and 10 deletions

View File

@ -206,7 +206,7 @@ class Deprecation
return self::TYPE_DIRECT;
}
private function getOriginalFilesStack(): array
private function getOriginalFilesStack()
{
if (null === $this->originalFilesStack) {
$this->originalFilesStack = [];

View File

@ -21,7 +21,7 @@ class DeprecationTest extends TestCase
{
private static $vendorDir;
private static function getVendorDir(): string
private static function getVendorDir()
{
if (null !== self::$vendorDir) {
return self::$vendorDir;
@ -148,7 +148,7 @@ class DeprecationTest extends TestCase
$this->assertTrue($deprecation->isMuted());
}
public function providerGetTypeDetectsSelf(): array
public function providerGetTypeDetectsSelf()
{
foreach (get_declared_classes() as $class) {
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
@ -187,7 +187,7 @@ class DeprecationTest extends TestCase
/**
* @dataProvider providerGetTypeDetectsSelf
*/
public function testGetTypeDetectsSelf(string $expectedType, string $message, string $traceClass, string $file): void
public function testGetTypeDetectsSelf(string $expectedType, string $message, string $traceClass, string $file)
{
$trace = [
['class' => 'MyClass1', 'function' => 'myMethod'],
@ -197,7 +197,7 @@ class DeprecationTest extends TestCase
$this->assertSame($expectedType, $deprecation->getType());
}
public function providerGetTypeUsesRightTrace(): array
public function providerGetTypeUsesRightTrace()
{
$vendorDir = self::getVendorDir();
@ -243,7 +243,7 @@ class DeprecationTest extends TestCase
/**
* @dataProvider providerGetTypeUsesRightTrace
*/
public function testGetTypeUsesRightTrace(string $expectedType, string $message, array $trace): void
public function testGetTypeUsesRightTrace(string $expectedType, string $message, array $trace)
{
$deprecation = new Deprecation(
$message,
@ -257,12 +257,12 @@ class DeprecationTest extends TestCase
* This method is here to simulate the extra level from the piece of code
* triggering an error to the error handler.
*/
public function debugBacktrace(): array
public function debugBacktrace()
{
return debug_backtrace();
}
private static function removeDir($dir): void
private static function removeDir($dir)
{
$files = glob($dir.'/*');
foreach ($files as $file) {
@ -275,7 +275,7 @@ class DeprecationTest extends TestCase
rmdir($dir);
}
public static function tearDownAfterClass(): void
public static function tearDownAfterClass()
{
self::removeDir(self::getVendorDir().'/myfakevendor');
}

View File

@ -113,7 +113,7 @@ interface AuthenticatorInterface extends AuthenticationEntryPointInterface
* Called when authentication executed, but failed (e.g. wrong username password).
*
* This should return the Response sent back to the user, like a
* RedirectResponse to the login page or a 403 response.
* RedirectResponse to the login page or a 401 response.
*
* If you return null, the request will continue, but the user will
* not be authenticated. This is probably not what you want to do.