diff --git a/.phpcs.xml b/.phpcs.xml index ea75b74c4af..b724371c463 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -40,7 +40,6 @@ includes/pager/ includes/parser/ includes/poolcounter/ - includes/Rest/ includes/search/ includes/skins/ includes/specialpage/ diff --git a/includes/Rest/CopyableStreamInterface.php b/includes/Rest/CopyableStreamInterface.php index 3e18e165f22..37479426b25 100644 --- a/includes/Rest/CopyableStreamInterface.php +++ b/includes/Rest/CopyableStreamInterface.php @@ -17,5 +17,5 @@ interface CopyableStreamInterface extends \Psr\Http\Message\StreamInterface { * * @param resource $stream Destination */ - function copyToStream( $stream ); + public function copyToStream( $stream ); } diff --git a/includes/Rest/Entity/SearchResultPageIdentity.php b/includes/Rest/Entity/SearchResultPageIdentity.php index a811d20d9e4..5673ea37699 100644 --- a/includes/Rest/Entity/SearchResultPageIdentity.php +++ b/includes/Rest/Entity/SearchResultPageIdentity.php @@ -16,7 +16,7 @@ interface SearchResultPageIdentity { * * @return int */ - function getId(): int; + public function getId(): int; /** * Returns the page's namespace number. @@ -25,7 +25,7 @@ interface SearchResultPageIdentity { * * @return int */ - function getNamespace(): int; + public function getNamespace(): int; /** * Get the page title in DB key form. @@ -34,5 +34,5 @@ interface SearchResultPageIdentity { * * @return string */ - function getDBkey(): string; + public function getDBkey(): string; } diff --git a/includes/Rest/RequestInterface.php b/includes/Rest/RequestInterface.php index eba389a7818..675ee2e86f5 100644 --- a/includes/Rest/RequestInterface.php +++ b/includes/Rest/RequestInterface.php @@ -44,7 +44,7 @@ interface RequestInterface { * * @return string Returns the request method. */ - function getMethod(); + public function getMethod(); /** * Retrieves the URI instance. @@ -55,7 +55,7 @@ interface RequestInterface { * @return UriInterface Returns a UriInterface instance * representing the URI of the request. */ - function getUri(); + public function getUri(); // MessageInterface @@ -66,7 +66,7 @@ interface RequestInterface { * * @return string HTTP protocol version. */ - function getProtocolVersion(); + public function getProtocolVersion(); /** * Retrieves all message header values. @@ -97,7 +97,7 @@ interface RequestInterface { * key MUST be a header name, and each value MUST be an array of strings * for that header. */ - function getHeaders(); + public function getHeaders(); /** * Retrieves a message header value by the given case-insensitive name. @@ -117,7 +117,7 @@ interface RequestInterface { * header. If the header does not appear in the message, this method MUST * return an empty array. */ - function getHeader( $name ); + public function getHeader( $name ); /** * Checks if a header exists by the given case-insensitive name. @@ -127,7 +127,7 @@ interface RequestInterface { * name using a case-insensitive string comparison. Returns false if * no matching header name is found in the message. */ - function hasHeader( $name ); + public function hasHeader( $name ); /** * Retrieves a comma-separated string of the values for a single header. @@ -148,14 +148,14 @@ interface RequestInterface { * concatenated together using a comma. If the header does not appear in * the message, this method MUST return an empty string. */ - function getHeaderLine( $name ); + public function getHeaderLine( $name ); /** * Gets the body of the message. * * @return StreamInterface Returns the body as a stream. */ - function getBody(); + public function getBody(); // ServerRequestInterface @@ -168,7 +168,7 @@ interface RequestInterface { * * @return array */ - function getServerParams(); + public function getServerParams(); /** * Retrieve cookies. @@ -180,7 +180,7 @@ interface RequestInterface { * * @return array */ - function getCookieParams(); + public function getCookieParams(); /** * Retrieve query string arguments. @@ -194,7 +194,7 @@ interface RequestInterface { * * @return array */ - function getQueryParams(); + public function getQueryParams(); /** * Retrieve normalized file upload data. @@ -205,7 +205,7 @@ interface RequestInterface { * @return array An array tree of UploadedFileInterface instances; an empty * array MUST be returned if no data is present. */ - function getUploadedFiles(); + public function getUploadedFiles(); // MediaWiki extensions to PSR-7 @@ -214,7 +214,7 @@ interface RequestInterface { * * @return string[] */ - function getPathParams(); + public function getPathParams(); /** * Retrieve a single path parameter. @@ -226,7 +226,7 @@ interface RequestInterface { * @param string $name The parameter name. * @return string|null */ - function getPathParam( $name ); + public function getPathParam( $name ); /** * Erase all path parameters from the object and set the parameter array @@ -234,14 +234,14 @@ interface RequestInterface { * * @param string[] $params */ - function setPathParams( $params ); + public function setPathParams( $params ); /** * Get the current cookie prefix * * @return string */ - function getCookiePrefix(); + public function getCookiePrefix(); /** * Add the cookie prefix to a specified cookie name and get the value of @@ -252,7 +252,7 @@ interface RequestInterface { * @param mixed|null $default * @return mixed The cookie value as a string, or $default */ - function getCookie( $name, $default = null ); + public function getCookie( $name, $default = null ); /** * Retrieve POST form parameters. @@ -261,5 +261,5 @@ interface RequestInterface { * * @return array The deserialized POST parameters */ - function getPostParams(); + public function getPostParams(); } diff --git a/includes/Rest/ResponseInterface.php b/includes/Rest/ResponseInterface.php index 130c6e65e74..126c348c736 100644 --- a/includes/Rest/ResponseInterface.php +++ b/includes/Rest/ResponseInterface.php @@ -47,7 +47,7 @@ interface ResponseInterface { * * @return int Status code. */ - function getStatusCode(); + public function getStatusCode(); /** * Gets the response reason phrase associated with the status code. @@ -62,7 +62,7 @@ interface ResponseInterface { * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml * @return string Reason phrase; must return an empty string if none present. */ - function getReasonPhrase(); + public function getReasonPhrase(); // ResponseInterface mutation @@ -81,7 +81,7 @@ interface ResponseInterface { * use the defaults as suggested in the HTTP specification. * @throws \InvalidArgumentException For invalid status code arguments. */ - function setStatus( $code, $reasonPhrase = '' ); + public function setStatus( $code, $reasonPhrase = '' ); // MessageInterface @@ -92,7 +92,7 @@ interface ResponseInterface { * * @return string HTTP protocol version. */ - function getProtocolVersion(); + public function getProtocolVersion(); /** * Retrieves all message header values. @@ -119,7 +119,7 @@ interface ResponseInterface { * Each key MUST be a header name, and each value MUST be an array of * strings for that header. */ - function getHeaders(); + public function getHeaders(); /** * Checks if a header exists by the given case-insensitive name. @@ -129,7 +129,7 @@ interface ResponseInterface { * name using a case-insensitive string comparison. Returns false if * no matching header name is found in the message. */ - function hasHeader( $name ); + public function hasHeader( $name ); /** * Retrieves a message header value by the given case-insensitive name. @@ -145,7 +145,7 @@ interface ResponseInterface { * header. If the header does not appear in the message, this method MUST * return an empty array. */ - function getHeader( $name ); + public function getHeader( $name ); /** * Retrieves a comma-separated string of the values for a single header. @@ -166,14 +166,14 @@ interface ResponseInterface { * concatenated together using a comma. If the header does not appear in * the message, this method MUST return an empty string. */ - function getHeaderLine( $name ); + public function getHeaderLine( $name ); /** * Gets the body of the message. * * @return StreamInterface Returns the body as a stream. */ - function getBody(); + public function getBody(); // MessageInterface mutation @@ -185,7 +185,7 @@ interface ResponseInterface { * * @param string $version HTTP protocol version */ - function setProtocolVersion( $version ); + public function setProtocolVersion( $version ); /** * Set or replace the specified header. @@ -197,7 +197,7 @@ interface ResponseInterface { * @param string|string[] $value Header value(s). * @throws \InvalidArgumentException for invalid header names or values. */ - function setHeader( $name, $value ); + public function setHeader( $name, $value ); /** * Append the given value to the specified header. @@ -211,7 +211,7 @@ interface ResponseInterface { * @throws \InvalidArgumentException for invalid header names. * @throws \InvalidArgumentException for invalid header values. */ - function addHeader( $name, $value ); + public function addHeader( $name, $value ); /** * Remove the specified header. @@ -220,7 +220,7 @@ interface ResponseInterface { * * @param string $name Case-insensitive header field name to remove. */ - function removeHeader( $name ); + public function removeHeader( $name ); /** * Set the message body @@ -230,7 +230,7 @@ interface ResponseInterface { * @param StreamInterface $body Body. * @throws \InvalidArgumentException When the body is not valid. */ - function setBody( StreamInterface $body ); + public function setBody( StreamInterface $body ); // MediaWiki extensions to PSR-7 @@ -240,7 +240,7 @@ interface ResponseInterface { * * @return string[] */ - function getRawHeaderLines(); + public function getRawHeaderLines(); /** * Set a cookie