Add missing public visibility on rest related interface methods

Change-Id: Id56beab0f187b8d9c1e4fca536fd0d0eb711e989
This commit is contained in:
Umherirrender 2020-05-09 12:46:02 +02:00
parent 06a884c9ee
commit 709fbb867d
5 changed files with 37 additions and 38 deletions

View file

@ -40,7 +40,6 @@
<exclude-pattern>includes/pager/</exclude-pattern>
<exclude-pattern>includes/parser/</exclude-pattern>
<exclude-pattern>includes/poolcounter/</exclude-pattern>
<exclude-pattern>includes/Rest/</exclude-pattern>
<exclude-pattern>includes/search/</exclude-pattern>
<exclude-pattern>includes/skins/</exclude-pattern>
<exclude-pattern>includes/specialpage/</exclude-pattern>

View file

@ -17,5 +17,5 @@ interface CopyableStreamInterface extends \Psr\Http\Message\StreamInterface {
*
* @param resource $stream Destination
*/
function copyToStream( $stream );
public function copyToStream( $stream );
}

View file

@ -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;
}

View file

@ -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();
}

View file

@ -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