Skip to content

Commit f6334df

Browse files
committed
[HttpKernel] Add Http Status 423 LockedHttpException
1 parent 879eeba commit f6334df

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

Exception/LockedHttpException.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\HttpKernel\Exception;
13+
14+
/**
15+
* @author Peter Dietrich <xosofox@gmail.com>
16+
*/
17+
class LockedHttpException extends HttpException
18+
{
19+
public function __construct(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = [])
20+
{
21+
parent::__construct(423, $message, $previous, $headers, $code);
22+
}
23+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Symfony\Component\HttpKernel\Tests\Exception;
4+
5+
use Symfony\Component\HttpKernel\Exception\HttpException;
6+
use Symfony\Component\HttpKernel\Exception\LengthRequiredHttpException;
7+
use Symfony\Component\HttpKernel\Exception\LockedHttpException;
8+
9+
class LockedHttpExceptionTest extends HttpExceptionTest
10+
{
11+
protected function createException(string $message = '', \Throwable $previous = null, int $code = 0, array $headers = []): HttpException
12+
{
13+
return new LockedHttpException($message, $previous, $code, $headers);
14+
}
15+
}

0 commit comments

Comments
 (0)