Skip to content

Commit

Permalink
[Syntax] Using php <= 7.3 syntaxes
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Sep 26, 2021
1 parent 0c26ef1 commit db725b3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/AbstractSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
abstract class AbstractSerializer
{
const CR = "\r";
const EOL = "\r\n";
const LF = "\n";
public const CR = "\r";
public const EOL = "\r\n";
public const LF = "\n";

/**
* Retrieve a single line from the stream.
Expand Down
4 changes: 2 additions & 2 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Response implements ResponseInterface
{
use MessageTrait;

const MIN_STATUS_CODE_VALUE = 100;
const MAX_STATUS_CODE_VALUE = 599;
public const MIN_STATUS_CODE_VALUE = 100;
public const MAX_STATUS_CODE_VALUE = 599;

/**
* Map of standard HTTP status code/reason phrases
Expand Down
2 changes: 1 addition & 1 deletion src/Response/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class JsonResponse extends Response
*
* @const int
*/
const DEFAULT_JSON_FLAGS = 79;
public const DEFAULT_JSON_FLAGS = 79;

/**
* @var mixed
Expand Down
2 changes: 1 addition & 1 deletion src/Response/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ private static function getStatusLine(StreamInterface $stream) : array
throw Exception\SerializationException::forInvalidStatusLine();
}

return [$matches['version'], (int) $matches['status'], isset($matches['reason']) ? $matches['reason'] : ''];
return [$matches['version'], (int) $matches['status'], $matches['reason'] ?? ''];
}
}
2 changes: 1 addition & 1 deletion src/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class UploadedFile implements UploadedFileInterface
{
const ERROR_MESSAGES = [
public const ERROR_MESSAGES = [
UPLOAD_ERR_OK => 'There is no error, the file uploaded with success',
UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was '
Expand Down
6 changes: 3 additions & 3 deletions src/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ class Uri implements UriInterface
*
* @const string
*/
const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
public const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';

/**
* Unreserved characters used in user info, paths, query strings, and fragments.
*
* @const string
*/
const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL';
public const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL';

/**
* @var int[] Array indexed by valid scheme names to their corresponding ports.
Expand Down Expand Up @@ -457,7 +457,7 @@ private function parseUri(string $uri) : void
$this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';
$this->userInfo = isset($parts['user']) ? $this->filterUserInfoPart($parts['user']) : '';
$this->host = isset($parts['host']) ? strtolower($parts['host']) : '';
$this->port = isset($parts['port']) ? $parts['port'] : null;
$this->port = $parts['port'] ?? null;
$this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : '';
$this->query = isset($parts['query']) ? $this->filterQuery($parts['query']) : '';
$this->fragment = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : '';
Expand Down

0 comments on commit db725b3

Please sign in to comment.