Skip to content

Commit

Permalink
Fix other non-phpcbf CS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
samwilson authored and addshore committed Oct 3, 2017
1 parent 1d7e54a commit 6fb0381
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 43 deletions.
4 changes: 2 additions & 2 deletions src/ApiRequester.php
Expand Up @@ -13,7 +13,7 @@ interface ApiRequester {
/**
* @since 2.2
*
* @param Request $request
* @param Request $request The GET request to send.
*
* @return mixed Normally an array
*/
Expand All @@ -22,7 +22,7 @@ public function getRequest( Request $request );
/**
* @since 2.2
*
* @param Request $request
* @param Request $request The POST request to send.
*
* @return mixed Normally an array
*/
Expand Down
8 changes: 4 additions & 4 deletions src/ApiUser.php
Expand Up @@ -31,9 +31,9 @@ class ApiUser {
private $domain;

/**
* @param string $username
* @param string $password
* @param string|null $domain
* @param string $username The username.
* @param string $password The user's password.
* @param string|null $domain The domain (for authentication systems that support domains).
*
* @throws \InvalidArgumentException
*/
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getDomain() {

/**
* @since 0.1
* @param mixed $other
* @param mixed $other Another ApiUser object to compare with.
*
* @return bool
*/
Expand Down
4 changes: 2 additions & 2 deletions src/AsyncApiRequester.php
Expand Up @@ -15,7 +15,7 @@ interface AsyncApiRequester {
/**
* @since 2.2
*
* @param Request $request
* @param Request $request The GET request to send.
*
* @return PromiseInterface
* Normally promising an array, though can be mixed (json_decode result)
Expand All @@ -26,7 +26,7 @@ public function getRequestAsync( Request $request );
/**
* @since 2.2
*
* @param Request $request
* @param Request $request The POST request to send.
*
* @return PromiseInterface
* Normally promising an array, though can be mixed (json_decode result)
Expand Down
16 changes: 9 additions & 7 deletions src/FluentRequest.php
Expand Up @@ -49,7 +49,7 @@ public static function factory() {
/**
* @since 1.0
*
* @param string $action
* @param string $action The action name.
*
* @return $this
*/
Expand All @@ -63,7 +63,7 @@ public function setAction( $action ) {
*
* @since 1.0
*
* @param array $params
* @param array $params New parameters.
*
* @return $this
*/
Expand All @@ -77,7 +77,7 @@ public function setParams( array $params ) {
*
* @since 1.0
*
* @param array $params
* @param array $params Additional parameters.
*
* @return $this
*/
Expand All @@ -87,10 +87,12 @@ public function addParams( array $params ) {
}

/**
* Set a single parameter.
*
* @since 1.0
*
* @param string $param
* @param string $value
* @param string $param The parameter name.
* @param string $value The parameter value.
*
* @return $this
*/
Expand All @@ -100,11 +102,11 @@ public function setParam( $param, $value ) {
}

/**
* Totally overwrite any previously set params
* Totally overwrite any previously set HTTP headers.
*
* @since 1.0
*
* @param array $headers
* @param array $headers New headers.
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Guzzle/ClientFactory.php
Expand Up @@ -85,7 +85,7 @@ private function newClient() {
*
* @since 2.1
*
* @param LoggerInterface $logger
* @param LoggerInterface $logger The new Logger object.
*
* @return null
*/
Expand Down
3 changes: 3 additions & 0 deletions src/Guzzle/MiddlewareFactory.php
Expand Up @@ -27,6 +27,9 @@ public function __construct() {
$this->logger = new NullLogger();
}

/**
* @param LoggerInterface $logger The new Logger object.
*/
public function setLogger( LoggerInterface $logger ) {
$this->logger = $logger;
}
Expand Down
18 changes: 9 additions & 9 deletions src/MediawikiApi.php
Expand Up @@ -161,7 +161,7 @@ private function getClient() {
*
* @since 1.1
*
* @param LoggerInterface $logger
* @param LoggerInterface $logger The new Logger object.
*
* @return null
*/
Expand All @@ -173,7 +173,7 @@ public function setLogger( LoggerInterface $logger ) {
/**
* @since 2.0
*
* @param Request $request
* @param Request $request The GET request to send.
*
* @return PromiseInterface
* Normally promising an array, though can be mixed (json_decode result)
Expand All @@ -194,7 +194,7 @@ public function getRequestAsync( Request $request ) {
/**
* @since 2.0
*
* @param Request $request
* @param Request $request The POST request to send.
*
* @return PromiseInterface
* Normally promising an array, though can be mixed (json_decode result)
Expand All @@ -215,7 +215,7 @@ public function postRequestAsync( Request $request ) {
/**
* @since 0.2
*
* @param Request $request
* @param Request $request The GET request to send.
*
* @return mixed Normally an array
*/
Expand All @@ -232,7 +232,7 @@ public function getRequest( Request $request ) {
/**
* @since 0.2
*
* @param Request $request
* @param Request $request The POST request to send.
*
* @return mixed Normally an array
*/
Expand Down Expand Up @@ -374,7 +374,7 @@ public function isLoggedin() {
/**
* @since 0.1
*
* @param ApiUser $apiUser
* @param ApiUser $apiUser The ApiUser to log in as.
*
* @throws UsageException
* @return bool success
Expand Down Expand Up @@ -451,7 +451,7 @@ public function logout() {
/**
* @since 0.1
*
* @param string $type
* @param string $type The token type to get.
*
* @return string
*/
Expand All @@ -460,9 +460,9 @@ public function getToken( $type = 'csrf' ) {
}

/**
* @since 0.1
* Clear all tokens stored by the API.
*
* Clears all tokens stored by the api
* @since 0.1
*/
public function clearTokens() {
$this->session->clearTokens();
Expand Down
4 changes: 2 additions & 2 deletions src/MediawikiApiInterface.php
Expand Up @@ -20,7 +20,7 @@ public function isLoggedin();
/**
* @since 2.2
*
* @param ApiUser $apiUser
* @param ApiUser $apiUser The ApiUser to log in as.
*
* @throws UsageException
* @return bool success
Expand All @@ -37,7 +37,7 @@ public function logout();
/**
* @since 2.2
*
* @param string $type
* @param string $type The type of token to get.
*
* @return string
*/
Expand Down
6 changes: 3 additions & 3 deletions src/MediawikiSession.php
Expand Up @@ -35,7 +35,7 @@ class MediawikiSession implements LoggerAwareInterface {
private $logger;

/**
* @param MediawikiApi $api
* @param MediawikiApi $api The API object to use for this session.
*/
public function __construct( MediawikiApi $api ) {
$this->api = $api;
Expand All @@ -47,7 +47,7 @@ public function __construct( MediawikiApi $api ) {
*
* @since 1.1
*
* @param LoggerInterface $logger
* @param LoggerInterface $logger The new Logger object.
*
* @return null
*/
Expand All @@ -60,7 +60,7 @@ public function setLogger( LoggerInterface $logger ) {
*
* @since 0.1
*
* @param string $type
* @param string $type The type of token to get.
*
* @return string
*/
Expand Down
18 changes: 10 additions & 8 deletions src/SimpleRequest.php
Expand Up @@ -29,17 +29,13 @@ class SimpleRequest implements Request {
private $headers;

/**
* @param string $action
* @param array $params
* @param array $headers
* @param string $action The API action.
* @param array $params The parameters for the action.
* @param array $headers Any extra HTTP headers to send.
*
* @throws InvalidArgumentException
*/
public function __construct(
$action,
array $params = [],
array $headers = []
) {
public function __construct( $action, array $params = [], array $headers = [] ) {
if ( !is_string( $action ) ) {
throw new InvalidArgumentException( '$action must be string' );
}
Expand All @@ -48,10 +44,16 @@ public function __construct(
$this->headers = $headers;
}

/**
* @return string[]
*/
public function getParams() {
return array_merge( [ 'action' => $this->action ], $this->params );
}

/**
* @return string[]
*/
public function getHeaders() {
return $this->headers;
}
Expand Down
4 changes: 2 additions & 2 deletions src/UsageException.php
Expand Up @@ -31,8 +31,8 @@ class UsageException extends Exception {
/**
* @since 0.1
*
* @param string $apiCode
* @param string $message
* @param string $apiCode The API error code.
* @param string $message The API error message.
* @param array $result the result the exception was generated from
*/
public function __construct( $apiCode = '', $message = '', $result = [] ) {
Expand Down
10 changes: 8 additions & 2 deletions tests/Integration/TestEnvironment.php
Expand Up @@ -11,6 +11,12 @@
*/
class TestEnvironment {

/**
* Get a new TestEnvironment.
* This is identical to calling self::__construct() but is useful for fluent construction.
*
* @return TestEnvironment
*/
public static function newInstance() {
return new self();
}
Expand Down Expand Up @@ -71,8 +77,8 @@ public function getApi() {

/**
* Save a wiki page.
* @param string $title
* @param string $content
* @param string $title The title of the page.
* @param string $content The complete page text to save.
*/
public function savePage( $title, $content ) {
$params = [
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/MediawikiSessionTest.php
Expand Up @@ -57,7 +57,7 @@ public function testGetToken( $tokenType ) {
/**
* @dataProvider provideTokenTypes
*/
public function testGetToken_pre125( $tokenType ) {
public function testGetTokenPre125( $tokenType ) {
$mockApi = $this->getMockApi();
$mockApi->expects( $this->at( 0 ) )
->method( 'postRequest' )
Expand Down

0 comments on commit 6fb0381

Please sign in to comment.