Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better PHPDoc #862

Merged
merged 4 commits into from
Feb 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable more PHP-CS-Fixer rules for PHPDoc (#864)
* Use phpdoc_order rule

* Use phpdoc_to_comment rule

* Use align_multiline_comment rule

* Use no_blank_lines_after_phpdoc rule

* Use no_empty_phpdoc rule
  • Loading branch information
ob-stripe committed Feb 10, 2020
commit 4ee75f6a1dc58d89374469e1c1a5097b020f9ec8
4 changes: 4 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -55,7 +55,9 @@ return PhpCsFixer\Config::create()
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_homoglyph_names' => true,
@@ -91,10 +93,12 @@ return PhpCsFixer\Config::create()
'phpdoc_no_alias_tag' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_to_comment' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true,
16 changes: 8 additions & 8 deletions lib/ApiRequestor.php
Original file line number Diff line number Diff line change
@@ -104,9 +104,9 @@ private static function _encodeObjects($d)
* @param array|null $params
* @param array|null $headers
*
* @return array tuple containing (ApiReponse, API key)
*
* @throws Exception\ApiErrorException
*
* @return array tuple containing (ApiReponse, API key)
*/
public function request($method, $url, $params = null, $headers = null)
{
@@ -295,10 +295,10 @@ private static function _defaultHeaders($apiKey, $clientInfo = null)
* @param array $params
* @param array $headers
*
* @return array
*
* @throws Exception\AuthenticationException
* @throws Exception\ApiConnectionException
*
* @return array
*/
private function _requestRaw($method, $url, $params, $headers)
{
@@ -384,9 +384,9 @@ private function _requestRaw($method, $url, $params, $headers)
/**
* @param resource $resource
*
* @return \CURLFile|string
*
* @throws Exception\InvalidArgumentException
*
* @return \CURLFile|string
*/
private function _processResourceParam($resource)
{
@@ -412,10 +412,10 @@ private function _processResourceParam($resource)
* @param int $rcode
* @param array $rheaders
*
* @return array
*
* @throws Exception\UnexpectedValueException
* @throws Exception\ApiErrorException
*
* @return array
*/
private function _interpretResponse($rbody, $rcode, $rheaders)
{
4 changes: 2 additions & 2 deletions lib/ApiResource.php
Original file line number Diff line number Diff line change
@@ -48,9 +48,9 @@ public function __set($k, $v)
}

/**
* @return ApiResource The refreshed resource.
*
* @throws Exception\ApiErrorException
*
* @return ApiResource The refreshed resource.
*/
public function refresh()
{
4 changes: 2 additions & 2 deletions lib/Webhook.php
Original file line number Diff line number Diff line change
@@ -19,10 +19,10 @@ abstract class Webhook
* @param int $tolerance maximum difference allowed between the header's
* timestamp and the current time
*
* @return Event the Event instance
*
* @throws Exception\UnexpectedValueException if the payload is not valid JSON,
* @throws Exception\SignatureVerificationException if the verification fails.
*
* @return Event the Event instance
*/
public static function constructEvent($payload, $sigHeader, $secret, $tolerance = self::DEFAULT_TOLERANCE)
{