Skip to content

Commit 817f883

Browse files
committed
Refactoring and updating composer
1 parent bf6fa91 commit 817f883

File tree

101 files changed

+2148
-1995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2148
-1995
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"ext-json": "*",
2424
"ext-redis": "*",
2525
"ext-pdo": "*",
26+
"ext-psr": "^0.7|1.0",
2627
"ext-xml": "^7.2",
2728
"pds/skeleton": "@dev",
2829
"psr/container": "^1.0",

composer.lock

Lines changed: 374 additions & 307 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Http/Message/Exception/InvalidArgumentException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
namespace Phalcon\Http\Message\Exception;
1515

16-
use Throwable;
17-
18-
class InvalidArgumentException extends \InvalidArgumentException implements Throwable
16+
class InvalidArgumentException extends \InvalidArgumentException
1917
{
2018
}

src/Http/Message/Request.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* file that was distributed with this source code.
1010
*
1111
* Implementation of this file has been influenced by Zend Diactoros
12+
*
1213
* @link https://github.com/zendframework/zend-diactoros
1314
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md
1415
*/
@@ -18,15 +19,22 @@
1819
namespace Phalcon\Http\Message;
1920

2021
use Phalcon\Http\Message\Stream\Input;
22+
use Phalcon\Http\Message\Traits\CommonTrait;
23+
use Phalcon\Http\Message\Traits\MessageTrait;
24+
use Phalcon\Http\Message\Traits\RequestTrait;
2125
use Psr\Http\Message\RequestInterface;
2226
use Psr\Http\Message\StreamInterface;
2327
use Psr\Http\Message\UriInterface;
2428

2529
/**
2630
* PSR-7 Request
2731
*/
28-
final class Request extends AbstractRequest implements RequestInterface
32+
final class Request implements RequestInterface
2933
{
34+
use CommonTrait;
35+
use MessageTrait;
36+
use RequestTrait;
37+
3038
/**
3139
* Request constructor.
3240
*

src/Http/Message/RequestFactory.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* file that was distributed with this source code.
1010
*
1111
* Implementation of this file has been influenced by Zend Diactoros
12+
*
1213
* @link https://github.com/zendframework/zend-diactoros
1314
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md
1415
*/
@@ -17,8 +18,8 @@
1718

1819
namespace Phalcon\Http\Message;
1920

20-
use Psr\Http\Message\RequestInterface;
2121
use Psr\Http\Message\RequestFactoryInterface;
22+
use Psr\Http\Message\RequestInterface;
2223
use Psr\Http\Message\UriInterface;
2324

2425
/**

src/Http/Message/Response.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* file that was distributed with this source code.
1010
*
1111
* Implementation of this file has been influenced by Zend Diactoros
12+
*
1213
* @link https://github.com/zendframework/zend-diactoros
1314
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md
1415
*/
@@ -19,6 +20,9 @@
1920

2021
use Phalcon\Helper\Number;
2122
use Phalcon\Http\Message\Exception\InvalidArgumentException;
23+
use Phalcon\Http\Message\Traits\CommonTrait;
24+
use Phalcon\Http\Message\Traits\MessageTrait;
25+
use Phalcon\Http\Message\Traits\ResponseTrait;
2226
use Psr\Http\Message\ResponseInterface;
2327

2428
use function is_int;
@@ -30,8 +34,12 @@
3034
* @property string $reasonPhrase
3135
* @property int $statusCode
3236
*/
33-
final class Response extends AbstractMessage implements ResponseInterface
37+
final class Response implements ResponseInterface
3438
{
39+
use CommonTrait;
40+
use MessageTrait;
41+
use ResponseTrait;
42+
3543
/**
3644
* Gets the response reason phrase associated with the status code.
3745
*
@@ -47,7 +55,7 @@ final class Response extends AbstractMessage implements ResponseInterface
4755
*
4856
* @var string
4957
*/
50-
protected $reasonPhrase = "";
58+
private $reasonPhrase = '';
5159

5260
/**
5361
* Gets the response status code.
@@ -57,7 +65,7 @@ final class Response extends AbstractMessage implements ResponseInterface
5765
*
5866
* @var int
5967
*/
60-
protected $statusCode = 200;
68+
private $statusCode = 200;
6169

6270
/**
6371
* Response constructor.
@@ -78,6 +86,8 @@ public function __construct(
7886
}
7987

8088
/**
89+
* Returns the reason phrase
90+
*
8191
* @return string
8292
*/
8393
public function getReasonPhrase(): string
@@ -86,6 +96,8 @@ public function getReasonPhrase(): string
8696
}
8797

8898
/**
99+
* Returns the status code
100+
*
89101
* @return int
90102
*/
91103
public function getStatusCode()

src/Http/Message/ResponseFactory.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* file that was distributed with this source code.
1010
*
1111
* Implementation of this file has been influenced by Zend Diactoros
12+
*
1213
* @link https://github.com/zendframework/zend-diactoros
1314
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md
1415
*/
@@ -17,8 +18,8 @@
1718

1819
namespace Phalcon\Http\Message;
1920

20-
use Psr\Http\Message\ResponseInterface;
2121
use Psr\Http\Message\ResponseFactoryInterface;
22+
use Psr\Http\Message\ResponseInterface;
2223

2324
/**
2425
* PSR-17 ResponseFactory
@@ -29,10 +30,11 @@ final class ResponseFactory implements ResponseFactoryInterface
2930
* Create a new response.
3031
*
3132
* @param int $code The HTTP status code. Defaults to 200.
32-
* @param string $reasonPhrase The reason phrase to associate with the status
33-
* code in the generated response. If none is
34-
* provided, implementations MAY use the defaults
35-
* as suggested in the HTTP specification.
33+
* @param string $reasonPhrase The reason phrase to associate with the
34+
* status code in the generated response. If
35+
* none is provided, implementations MAY use
36+
* the defaults as suggested in the HTTP
37+
* specification.
3638
*
3739
* @return ResponseInterface
3840
*/

0 commit comments

Comments
 (0)