Skip to content

Commit

Permalink
Merge 3d22f31 into 5fa2a39
Browse files Browse the repository at this point in the history
  • Loading branch information
nbayramberdiyev committed Dec 18, 2021
2 parents 5fa2a39 + 3d22f31 commit 2811cca
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.3, 7.4, 8.0, 8.1]
php: [7.4, 8.0, 8.1]
experimental: [false]
include:
- php: 8.1
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -28,7 +28,7 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"php": "^7.4 || ^8.0",
"fig/http-message-util": "^1.1.5",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
Expand Down
12 changes: 3 additions & 9 deletions src/Cookies.php
Expand Up @@ -31,24 +31,18 @@ class Cookies
{
/**
* Cookies from HTTP request
*
* @var array
*/
protected $requestCookies = [];
protected array $requestCookies = [];

/**
* Cookies for HTTP response
*
* @var array
*/
protected $responseCookies = [];
protected array $responseCookies = [];

/**
* Default cookie properties
*
* @var array
*/
protected $defaults = [
protected array $defaults = [
'value' => '',
'domain' => null,
'hostonly' => null,
Expand Down
10 changes: 2 additions & 8 deletions src/Message.php
Expand Up @@ -23,15 +23,9 @@

abstract class Message implements MessageInterface
{
/**
* @var string
*/
protected $protocolVersion = '1.1';
protected string $protocolVersion = '1.1';

/**
* @var array
*/
protected static $validProtocolVersions = [
protected static array $validProtocolVersions = [
'1.0' => true,
'1.1' => true,
'2.0' => true,
Expand Down
15 changes: 3 additions & 12 deletions src/Response.php
Expand Up @@ -24,20 +24,11 @@

class Response extends Message implements ResponseInterface
{
/**
* @var int
*/
protected $status = StatusCodeInterface::STATUS_OK;
protected int $status = StatusCodeInterface::STATUS_OK;

/**
* @var string
*/
protected $reasonPhrase = '';
protected string $reasonPhrase = '';

/**
* @var array
*/
protected static $messages = [
protected static array $messages = [
// Informational 1xx
StatusCodeInterface::STATUS_CONTINUE => 'Continue',
StatusCodeInterface::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols',
Expand Down
5 changes: 1 addition & 4 deletions src/Stream.php
Expand Up @@ -78,10 +78,7 @@ class Stream implements StreamInterface
*/
protected $isPipe;

/**
* @var bool
*/
protected $finished = false;
protected bool $finished = false;

/**
* @var StreamInterface | null
Expand Down
12 changes: 3 additions & 9 deletions src/UploadedFile.php
Expand Up @@ -60,17 +60,13 @@ class UploadedFile implements UploadedFileInterface

/**
* A valid PHP UPLOAD_ERR_xxx code for the file upload.
*
* @var int
*/
protected $error = UPLOAD_ERR_OK;
protected int $error = UPLOAD_ERR_OK;

/**
* Indicates if the upload is from a SAPI environment.
*
* @var bool
*/
protected $sapi = false;
protected bool $sapi = false;

/**
* @var StreamInterface|null
Expand All @@ -79,10 +75,8 @@ class UploadedFile implements UploadedFileInterface

/**
* Indicates if the uploaded file has already been moved.
*
* @var bool
*/
protected $moved = false;
protected bool $moved = false;

/**
* @param string|StreamInterface $fileNameOrStream The full path to the uploaded file provided by the client,
Expand Down
32 changes: 7 additions & 25 deletions src/Uri.php
Expand Up @@ -38,49 +38,31 @@ class Uri implements UriInterface

/**
* Uri scheme (without "://" suffix)
*
* @var string
*/
protected $scheme = '';
protected string $scheme = '';

/**
* @var string
*/
protected $user = '';
protected string $user = '';

/**
* @var string
*/
protected $password = '';
protected string $password = '';

/**
* @var string
*/
protected $host = '';
protected string $host = '';

/**
* @var null|int
*/
protected $port;

/**
* @var string
*/
protected $path = '';
protected string $path = '';

/**
* Uri query string (without "?" prefix)
*
* @var string
*/
protected $query = '';
protected string $query = '';

/**
* Uri fragment string (without "#" prefix)
*
* @var string
*/
protected $fragment = '';
protected string $fragment = '';

/**
* @param string $scheme Uri scheme.
Expand Down
5 changes: 1 addition & 4 deletions tests/Assets/HeaderStack.php
Expand Up @@ -31,10 +31,7 @@

class HeaderStack
{
/**
* @var string[][]
*/
private static $data = [];
private static array $data = [];

/**
* Reset state
Expand Down
5 changes: 1 addition & 4 deletions tests/BodyTest.php
Expand Up @@ -32,10 +32,7 @@
class BodyTest extends TestCase
{
// @codingStandardsIgnoreStart
/**
* @var string
*/
protected $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
protected string $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
// @codingStandardsIgnoreEnd

/**
Expand Down
4 changes: 1 addition & 3 deletions tests/Mocks/MessageStub.php
Expand Up @@ -18,10 +18,8 @@ class MessageStub extends Message
{
/**
* Protocol version
*
* @var string
*/
public $protocolVersion;
public string $protocolVersion;

/**
* Headers
Expand Down
4 changes: 2 additions & 2 deletions tests/UploadedFileTest.php
Expand Up @@ -47,9 +47,9 @@ class UploadedFileTest extends TestCase
{
use ProphecyTrait;

private static $filename = './phpUxcOty';
private static string $filename = './phpUxcOty';

private static $tmpFiles = ['./phpUxcOty'];
private static array $tmpFiles = ['./phpUxcOty'];

public static function setUpBeforeClass(): void
{
Expand Down

0 comments on commit 2811cca

Please sign in to comment.