Merged in feature/MAW-855-import-code-into-aws (pull request #2)

code import from pantheon

* code import from pantheon
This commit is contained in:
Tony Volpe
2023-12-04 23:08:14 +00:00
parent 8c9b1312bc
commit 8f4b5efda6
4766 changed files with 185592 additions and 239967 deletions

View File

@@ -0,0 +1,10 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Client;
/**
* Every HTTP client related exception MUST implement this interface.
*/
interface ClientExceptionInterface extends \Throwable
{
}

View File

@@ -0,0 +1,19 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Client;
use YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
use YoastSEO_Vendor\Psr\Http\Message\ResponseInterface;
interface ClientInterface
{
/**
* Sends a PSR-7 request and returns a PSR-7 response.
*
* @param RequestInterface $request
*
* @return ResponseInterface
*
* @throws \Psr\Http\Client\ClientExceptionInterface If an error happens while processing the request.
*/
public function sendRequest(\YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request) : \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface;
}

View File

@@ -0,0 +1,23 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Client;
use YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
/**
* Thrown when the request cannot be completed because of network issues.
*
* There is no response object as this exception is thrown when no response has been received.
*
* Example: the target host name can not be resolved or the connection failed.
*/
interface NetworkExceptionInterface extends \YoastSEO_Vendor\Psr\Http\Client\ClientExceptionInterface
{
/**
* Returns the request.
*
* The request object MAY be a different object from the one passed to ClientInterface::sendRequest()
*
* @return RequestInterface
*/
public function getRequest() : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
}

View File

@@ -0,0 +1,23 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Client;
use YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
/**
* Exception for when a request failed.
*
* Examples:
* - Request is invalid (e.g. method is missing)
* - Runtime request errors (e.g. the body stream is not seekable)
*/
interface RequestExceptionInterface extends \YoastSEO_Vendor\Psr\Http\Client\ClientExceptionInterface
{
/**
* Returns the request.
*
* The request object MAY be a different object from the one passed to ClientInterface::sendRequest()
*
* @return RequestInterface
*/
public function getRequest() : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
}

View File

@@ -0,0 +1,18 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Message;
interface RequestFactoryInterface
{
/**
* Create a new request.
*
* @param string $method The HTTP method associated with the request.
* @param UriInterface|string $uri The URI associated with the request. If
* the value is a string, the factory MUST create a UriInterface
* instance based on it.
*
* @return RequestInterface
*/
public function createRequest(string $method, $uri) : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
}

View File

@@ -0,0 +1,18 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Message;
interface ResponseFactoryInterface
{
/**
* Create a new response.
*
* @param int $code HTTP status code; defaults to 200
* @param string $reasonPhrase Reason phrase to associate with status code
* in generated response; if none is provided implementations MAY use
* the defaults as suggested in the HTTP specification.
*
* @return ResponseInterface
*/
public function createResponse(int $code = 200, string $reasonPhrase = '') : \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface;
}

View File

@@ -0,0 +1,24 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Message;
interface ServerRequestFactoryInterface
{
/**
* Create a new server request.
*
* Note that server-params are taken precisely as given - no parsing/processing
* of the given values is performed, and, in particular, no attempt is made to
* determine the HTTP method or URI, which must be provided explicitly.
*
* @param string $method The HTTP method associated with the request.
* @param UriInterface|string $uri The URI associated with the request. If
* the value is a string, the factory MUST create a UriInterface
* instance based on it.
* @param array $serverParams Array of SAPI parameters with which to seed
* the generated request instance.
*
* @return ServerRequestInterface
*/
public function createServerRequest(string $method, $uri, array $serverParams = []) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
}

View File

@@ -0,0 +1,43 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Message;
interface StreamFactoryInterface
{
/**
* Create a new stream from a string.
*
* The stream SHOULD be created with a temporary resource.
*
* @param string $content String content with which to populate the stream.
*
* @return StreamInterface
*/
public function createStream(string $content = '') : \YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
/**
* Create a stream from an existing file.
*
* The file MUST be opened using the given mode, which may be any mode
* supported by the `fopen` function.
*
* The `$filename` MAY be any string supported by `fopen()`.
*
* @param string $filename Filename or stream URI to use as basis of stream.
* @param string $mode Mode with which to open the underlying filename/stream.
*
* @return StreamInterface
* @throws \RuntimeException If the file cannot be opened.
* @throws \InvalidArgumentException If the mode is invalid.
*/
public function createStreamFromFile(string $filename, string $mode = 'r') : \YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
/**
* Create a new stream from an existing resource.
*
* The stream MUST be readable and may be writable.
*
* @param resource $resource PHP resource to use as basis of stream.
*
* @return StreamInterface
*/
public function createStreamFromResource($resource) : \YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
}

View File

@@ -0,0 +1,28 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Message;
interface UploadedFileFactoryInterface
{
/**
* Create a new uploaded file.
*
* If a size is not provided it will be determined by checking the size of
* the file.
*
* @see http://php.net/manual/features.file-upload.post-method.php
* @see http://php.net/manual/features.file-upload.errors.php
*
* @param StreamInterface $stream Underlying stream representing the
* uploaded file content.
* @param int $size in bytes
* @param int $error PHP file upload error
* @param string $clientFilename Filename as provided by the client, if any.
* @param string $clientMediaType Media type as provided by the client, if any.
*
* @return UploadedFileInterface
*
* @throws \InvalidArgumentException If the file resource is not readable.
*/
public function createUploadedFile(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null) : \YoastSEO_Vendor\Psr\Http\Message\UploadedFileInterface;
}

View File

@@ -0,0 +1,17 @@
<?php
namespace YoastSEO_Vendor\Psr\Http\Message;
interface UriFactoryInterface
{
/**
* Create a new URI.
*
* @param string $uri
*
* @return UriInterface
*
* @throws \InvalidArgumentException If the given URI cannot be parsed.
*/
public function createUri(string $uri = '') : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
}

View File

@@ -23,7 +23,7 @@ interface MessageInterface
*
* @return string HTTP protocol version.
*/
public function getProtocolVersion();
public function getProtocolVersion() : string;
/**
* Return an instance with the specified HTTP protocol version.
*
@@ -37,7 +37,7 @@ interface MessageInterface
* @param string $version HTTP protocol version
* @return static
*/
public function withProtocolVersion($version);
public function withProtocolVersion(string $version) : \YoastSEO_Vendor\Psr\Http\Message\MessageInterface;
/**
* Retrieves all message header values.
*
@@ -63,7 +63,7 @@ interface MessageInterface
* key MUST be a header name, and each value MUST be an array of strings
* for that header.
*/
public function getHeaders();
public function getHeaders() : array;
/**
* Checks if a header exists by the given case-insensitive name.
*
@@ -72,7 +72,7 @@ interface MessageInterface
* name using a case-insensitive string comparison. Returns false if
* no matching header name is found in the message.
*/
public function hasHeader($name);
public function hasHeader(string $name) : bool;
/**
* Retrieves a message header value by the given case-insensitive name.
*
@@ -87,7 +87,7 @@ interface MessageInterface
* header. If the header does not appear in the message, this method MUST
* return an empty array.
*/
public function getHeader($name);
public function getHeader(string $name) : array;
/**
* Retrieves a comma-separated string of the values for a single header.
*
@@ -107,7 +107,7 @@ interface MessageInterface
* concatenated together using a comma. If the header does not appear in
* the message, this method MUST return an empty string.
*/
public function getHeaderLine($name);
public function getHeaderLine(string $name) : string;
/**
* Return an instance with the provided value replacing the specified header.
*
@@ -123,7 +123,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withHeader($name, $value);
public function withHeader(string $name, $value) : \YoastSEO_Vendor\Psr\Http\Message\MessageInterface;
/**
* Return an instance with the specified header appended with the given value.
*
@@ -140,7 +140,7 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withAddedHeader($name, $value);
public function withAddedHeader(string $name, $value) : \YoastSEO_Vendor\Psr\Http\Message\MessageInterface;
/**
* Return an instance without the specified header.
*
@@ -153,13 +153,13 @@ interface MessageInterface
* @param string $name Case-insensitive header field name to remove.
* @return static
*/
public function withoutHeader($name);
public function withoutHeader(string $name) : \YoastSEO_Vendor\Psr\Http\Message\MessageInterface;
/**
* Gets the body of the message.
*
* @return StreamInterface Returns the body as a stream.
*/
public function getBody();
public function getBody() : \YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
/**
* Return an instance with the specified message body.
*
@@ -173,5 +173,5 @@ interface MessageInterface
* @return static
* @throws \InvalidArgumentException When the body is not valid.
*/
public function withBody(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $body);
public function withBody(\YoastSEO_Vendor\Psr\Http\Message\StreamInterface $body) : \YoastSEO_Vendor\Psr\Http\Message\MessageInterface;
}

View File

@@ -39,7 +39,7 @@ interface RequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInte
*
* @return string
*/
public function getRequestTarget();
public function getRequestTarget() : string;
/**
* Return an instance with the specific request-target.
*
@@ -54,16 +54,16 @@ interface RequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInte
*
* @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various
* request-target forms allowed in request messages)
* @param mixed $requestTarget
* @param string $requestTarget
* @return static
*/
public function withRequestTarget($requestTarget);
public function withRequestTarget(string $requestTarget) : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
/**
* Retrieves the HTTP method of the request.
*
* @return string Returns the request method.
*/
public function getMethod();
public function getMethod() : string;
/**
* Return an instance with the provided HTTP method.
*
@@ -79,7 +79,7 @@ interface RequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInte
* @return static
* @throws \InvalidArgumentException for invalid HTTP methods.
*/
public function withMethod($method);
public function withMethod(string $method) : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
/**
* Retrieves the URI instance.
*
@@ -89,7 +89,7 @@ interface RequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInte
* @return UriInterface Returns a UriInterface instance
* representing the URI of the request.
*/
public function getUri();
public function getUri() : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Returns an instance with the provided URI.
*
@@ -120,5 +120,5 @@ interface RequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInte
* @param bool $preserveHost Preserve the original state of the Host header.
* @return static
*/
public function withUri(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri, $preserveHost = \false);
public function withUri(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri, bool $preserveHost = \false) : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface;
}

View File

@@ -27,7 +27,7 @@ interface ResponseInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInt
*
* @return int Status code.
*/
public function getStatusCode();
public function getStatusCode() : int;
/**
* Return an instance with the specified status code and, optionally, reason phrase.
*
@@ -48,7 +48,7 @@ interface ResponseInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInt
* @return static
* @throws \InvalidArgumentException For invalid status code arguments.
*/
public function withStatus($code, $reasonPhrase = '');
public function withStatus(int $code, string $reasonPhrase = '') : \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface;
/**
* Gets the response reason phrase associated with the status code.
*
@@ -62,5 +62,5 @@ interface ResponseInterface extends \YoastSEO_Vendor\Psr\Http\Message\MessageInt
* @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
* @return string Reason phrase; must return an empty string if none present.
*/
public function getReasonPhrase();
public function getReasonPhrase() : string;
}

View File

@@ -51,7 +51,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
*
* @return array
*/
public function getServerParams();
public function getServerParams() : array;
/**
* Retrieve cookies.
*
@@ -62,7 +62,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
*
* @return array
*/
public function getCookieParams();
public function getCookieParams() : array;
/**
* Return an instance with the specified cookies.
*
@@ -80,7 +80,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @param array $cookies Array of key/value pairs representing cookies.
* @return static
*/
public function withCookieParams(array $cookies);
public function withCookieParams(array $cookies) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
/**
* Retrieve query string arguments.
*
@@ -93,7 +93,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
*
* @return array
*/
public function getQueryParams();
public function getQueryParams() : array;
/**
* Return an instance with the specified query string arguments.
*
@@ -116,7 +116,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* $_GET.
* @return static
*/
public function withQueryParams(array $query);
public function withQueryParams(array $query) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
/**
* Retrieve normalized file upload data.
*
@@ -129,7 +129,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @return array An array tree of UploadedFileInterface instances; an empty
* array MUST be returned if no data is present.
*/
public function getUploadedFiles();
public function getUploadedFiles() : array;
/**
* Create a new instance with the specified uploaded files.
*
@@ -141,7 +141,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @return static
* @throws \InvalidArgumentException if an invalid structure is provided.
*/
public function withUploadedFiles(array $uploadedFiles);
public function withUploadedFiles(array $uploadedFiles) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
/**
* Retrieve any parameters provided in the request body.
*
@@ -186,7 +186,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @throws \InvalidArgumentException if an unsupported argument type is
* provided.
*/
public function withParsedBody($data);
public function withParsedBody($data) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
/**
* Retrieve attributes derived from the request.
*
@@ -198,7 +198,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
*
* @return array Attributes derived from the request.
*/
public function getAttributes();
public function getAttributes() : array;
/**
* Retrieve a single derived request attribute.
*
@@ -214,7 +214,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @param mixed $default Default value to return if the attribute does not exist.
* @return mixed
*/
public function getAttribute($name, $default = null);
public function getAttribute(string $name, $default = null);
/**
* Return an instance with the specified derived request attribute.
*
@@ -230,7 +230,7 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @param mixed $value The value of the attribute.
* @return static
*/
public function withAttribute($name, $value);
public function withAttribute(string $name, $value) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
/**
* Return an instance that removes the specified derived request attribute.
*
@@ -245,5 +245,5 @@ interface ServerRequestInterface extends \YoastSEO_Vendor\Psr\Http\Message\Reque
* @param string $name The attribute name.
* @return static
*/
public function withoutAttribute($name);
public function withoutAttribute(string $name) : \YoastSEO_Vendor\Psr\Http\Message\ServerRequestInterface;
}

View File

@@ -25,13 +25,13 @@ interface StreamInterface
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
* @return string
*/
public function __toString();
public function __toString() : string;
/**
* Closes the stream and any underlying resources.
*
* @return void
*/
public function close();
public function close() : void;
/**
* Separates any underlying resources from the stream.
*
@@ -45,26 +45,26 @@ interface StreamInterface
*
* @return int|null Returns the size in bytes if known, or null if unknown.
*/
public function getSize();
public function getSize() : ?int;
/**
* Returns the current position of the file read/write pointer
*
* @return int Position of the file pointer
* @throws \RuntimeException on error.
*/
public function tell();
public function tell() : int;
/**
* Returns true if the stream is at the end of the stream.
*
* @return bool
*/
public function eof();
public function eof() : bool;
/**
* Returns whether or not the stream is seekable.
*
* @return bool
*/
public function isSeekable();
public function isSeekable() : bool;
/**
* Seek to a position in the stream.
*
@@ -77,7 +77,7 @@ interface StreamInterface
* SEEK_END: Set position to end-of-stream plus offset.
* @throws \RuntimeException on failure.
*/
public function seek($offset, $whence = \SEEK_SET);
public function seek(int $offset, int $whence = \SEEK_SET) : void;
/**
* Seek to the beginning of the stream.
*
@@ -88,13 +88,13 @@ interface StreamInterface
* @link http://www.php.net/manual/en/function.fseek.php
* @throws \RuntimeException on failure.
*/
public function rewind();
public function rewind() : void;
/**
* Returns whether or not the stream is writable.
*
* @return bool
*/
public function isWritable();
public function isWritable() : bool;
/**
* Write data to the stream.
*
@@ -102,13 +102,13 @@ interface StreamInterface
* @return int Returns the number of bytes written to the stream.
* @throws \RuntimeException on failure.
*/
public function write($string);
public function write(string $string) : int;
/**
* Returns whether or not the stream is readable.
*
* @return bool
*/
public function isReadable();
public function isReadable() : bool;
/**
* Read data from the stream.
*
@@ -119,7 +119,7 @@ interface StreamInterface
* if no bytes are available.
* @throws \RuntimeException if an error occurs.
*/
public function read($length);
public function read(int $length) : string;
/**
* Returns the remaining contents in a string
*
@@ -127,7 +127,7 @@ interface StreamInterface
* @throws \RuntimeException if unable to read or an error occurs while
* reading.
*/
public function getContents();
public function getContents() : string;
/**
* Get stream metadata as an associative array or retrieve a specific key.
*
@@ -135,10 +135,10 @@ interface StreamInterface
* stream_get_meta_data() function.
*
* @link http://php.net/manual/en/function.stream-get-meta-data.php
* @param string $key Specific metadata to retrieve.
* @param string|null $key Specific metadata to retrieve.
* @return array|mixed|null Returns an associative array if no key is
* provided. Returns a specific key value if a key is provided and the
* value is found, or null if the key is not found.
*/
public function getMetadata($key = null);
public function getMetadata(?string $key = null);
}

View File

@@ -28,7 +28,7 @@ interface UploadedFileInterface
* @throws \RuntimeException in cases when no stream is available or can be
* created.
*/
public function getStream();
public function getStream() : \YoastSEO_Vendor\Psr\Http\Message\StreamInterface;
/**
* Move the uploaded file to a new location.
*
@@ -61,7 +61,7 @@ interface UploadedFileInterface
* @throws \RuntimeException on any error during the move operation, or on
* the second or subsequent call to the method.
*/
public function moveTo($targetPath);
public function moveTo(string $targetPath) : void;
/**
* Retrieve the file size.
*
@@ -71,7 +71,7 @@ interface UploadedFileInterface
*
* @return int|null The file size in bytes or null if unknown.
*/
public function getSize();
public function getSize() : ?int;
/**
* Retrieve the error associated with the uploaded file.
*
@@ -86,7 +86,7 @@ interface UploadedFileInterface
* @see http://php.net/manual/en/features.file-upload.errors.php
* @return int One of PHP's UPLOAD_ERR_XXX constants.
*/
public function getError();
public function getError() : int;
/**
* Retrieve the filename sent by the client.
*
@@ -100,7 +100,7 @@ interface UploadedFileInterface
* @return string|null The filename sent by the client or null if none
* was provided.
*/
public function getClientFilename();
public function getClientFilename() : ?string;
/**
* Retrieve the media type sent by the client.
*
@@ -114,5 +114,5 @@ interface UploadedFileInterface
* @return string|null The media type sent by the client or null if none
* was provided.
*/
public function getClientMediaType();
public function getClientMediaType() : ?string;
}

View File

@@ -38,7 +38,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.1
* @return string The URI scheme.
*/
public function getScheme();
public function getScheme() : string;
/**
* Retrieve the authority component of the URI.
*
@@ -57,7 +57,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.2
* @return string The URI authority, in "[user-info@]host[:port]" format.
*/
public function getAuthority();
public function getAuthority() : string;
/**
* Retrieve the user information component of the URI.
*
@@ -73,7 +73,7 @@ interface UriInterface
*
* @return string The URI user information, in "username[:password]" format.
*/
public function getUserInfo();
public function getUserInfo() : string;
/**
* Retrieve the host component of the URI.
*
@@ -85,7 +85,7 @@ interface UriInterface
* @see http://tools.ietf.org/html/rfc3986#section-3.2.2
* @return string The URI host.
*/
public function getHost();
public function getHost() : string;
/**
* Retrieve the port component of the URI.
*
@@ -101,7 +101,7 @@ interface UriInterface
*
* @return null|int The URI port.
*/
public function getPort();
public function getPort() : ?int;
/**
* Retrieve the path component of the URI.
*
@@ -127,7 +127,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.3
* @return string The URI path.
*/
public function getPath();
public function getPath() : string;
/**
* Retrieve the query string of the URI.
*
@@ -148,7 +148,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.4
* @return string The URI query string.
*/
public function getQuery();
public function getQuery() : string;
/**
* Retrieve the fragment component of the URI.
*
@@ -165,7 +165,7 @@ interface UriInterface
* @see https://tools.ietf.org/html/rfc3986#section-3.5
* @return string The URI fragment.
*/
public function getFragment();
public function getFragment() : string;
/**
* Return an instance with the specified scheme.
*
@@ -181,7 +181,7 @@ interface UriInterface
* @return static A new instance with the specified scheme.
* @throws \InvalidArgumentException for invalid or unsupported schemes.
*/
public function withScheme($scheme);
public function withScheme(string $scheme) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return an instance with the specified user information.
*
@@ -196,7 +196,7 @@ interface UriInterface
* @param null|string $password The password associated with $user.
* @return static A new instance with the specified user information.
*/
public function withUserInfo($user, $password = null);
public function withUserInfo(string $user, ?string $password = null) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return an instance with the specified host.
*
@@ -209,7 +209,7 @@ interface UriInterface
* @return static A new instance with the specified host.
* @throws \InvalidArgumentException for invalid hostnames.
*/
public function withHost($host);
public function withHost(string $host) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return an instance with the specified port.
*
@@ -227,7 +227,7 @@ interface UriInterface
* @return static A new instance with the specified port.
* @throws \InvalidArgumentException for invalid ports.
*/
public function withPort($port);
public function withPort(?int $port) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return an instance with the specified path.
*
@@ -250,7 +250,7 @@ interface UriInterface
* @return static A new instance with the specified path.
* @throws \InvalidArgumentException for invalid paths.
*/
public function withPath($path);
public function withPath(string $path) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return an instance with the specified query string.
*
@@ -266,7 +266,7 @@ interface UriInterface
* @return static A new instance with the specified query string.
* @throws \InvalidArgumentException for invalid query strings.
*/
public function withQuery($query);
public function withQuery(string $query) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return an instance with the specified URI fragment.
*
@@ -281,7 +281,7 @@ interface UriInterface
* @param string $fragment The fragment to use with the new instance.
* @return static A new instance with the specified fragment.
*/
public function withFragment($fragment);
public function withFragment(string $fragment) : \YoastSEO_Vendor\Psr\Http\Message\UriInterface;
/**
* Return the string representation as a URI reference.
*
@@ -305,5 +305,5 @@ interface UriInterface
* @see http://tools.ietf.org/html/rfc3986#section-4.1
* @return string
*/
public function __toString();
public function __toString() : string;
}

View File

@@ -14,8 +14,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
/**
* System is unusable.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -29,8 +29,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -43,8 +43,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
*
* Example: Application component unavailable, unexpected exception.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -56,8 +56,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -71,8 +71,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -83,8 +83,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
/**
* Normal but significant events.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -97,8 +97,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
*
* Example: User logs in, SQL logs.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -109,8 +109,8 @@ abstract class AbstractLogger implements \YoastSEO_Vendor\Psr\Log\LoggerInterfac
/**
* Detailed debug information.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/

View File

@@ -10,7 +10,7 @@ trait LoggerAwareTrait
/**
* The logger instance.
*
* @var LoggerInterface
* @var LoggerInterface|null
*/
protected $logger;
/**

View File

@@ -22,8 +22,8 @@ interface LoggerInterface
/**
* System is unusable.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -34,8 +34,8 @@ interface LoggerInterface
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -45,8 +45,8 @@ interface LoggerInterface
*
* Example: Application component unavailable, unexpected exception.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -55,8 +55,8 @@ interface LoggerInterface
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -67,8 +67,8 @@ interface LoggerInterface
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -76,8 +76,8 @@ interface LoggerInterface
/**
* Normal but significant events.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -87,8 +87,8 @@ interface LoggerInterface
*
* Example: User logs in, SQL logs.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -96,8 +96,8 @@ interface LoggerInterface
/**
* Detailed debug information.
*
* @param string $message
* @param array $context
* @param string $message
* @param mixed[] $context
*
* @return void
*/
@@ -105,11 +105,13 @@ interface LoggerInterface
/**
* Logs with an arbitrary level.
*
* @param mixed $level
* @param string $message
* @param array $context
* @param mixed $level
* @param string $message
* @param mixed[] $context
*
* @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, $message, array $context = array());
}

View File

@@ -127,6 +127,8 @@ trait LoggerTrait
* @param array $context
*
* @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/
public abstract function log($level, $message, array $context = array());
}

View File

@@ -20,6 +20,8 @@ class NullLogger extends \YoastSEO_Vendor\Psr\Log\AbstractLogger
* @param array $context
*
* @return void
*
* @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, $message, array $context = array())
{