Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 587
phpstan level 6 fixes#897
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d2d0fa6d6ab64aca3a663843f04fac70da0File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,6 +9,11 @@ | ||
| */ | ||
| class MissingArgumentException extends ErrorException | ||
| { | ||
| /** | ||
| * @param string|array $required | ||
| * @param int $code | ||
| * @param \Throwable|null $previous | ||
acrobat marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| */ | ||
| public function __construct($required, $code = 0, $previous = null) | ||
| { | ||
| if (is_string($required)) { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,14 +4,23 @@ | ||
| class TwoFactorAuthenticationRequiredException extends RuntimeException | ||
| { | ||
| /** @var string */ | ||
| private $type; | ||
| /** | ||
| * @param string $type | ||
| * @param int $code | ||
| * @param \Throwable|null $previous | ||
acrobat marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| */ | ||
| public function __construct($type, $code = 0, $previous = null) | ||
| { | ||
| $this->type = $type; | ||
| parent::__construct('Two factor authentication is enabled on this account', $code, $previous); | ||
| } | ||
| /** | ||
| * @return string | ||
| */ | ||
| public function getType() | ||
| { | ||
| return $this->type; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -56,13 +56,19 @@ public static function getPagination(ResponseInterface $response) | ||
| */ | ||
| public static function getApiLimit(ResponseInterface $response) | ||
| { | ||
| $remainingCalls = self::getHeader($response, 'X-RateLimit-Remaining'); | ||
| $remainingCallsHeader = self::getHeader($response, 'X-RateLimit-Remaining'); | ||
| if (null !== $remainingCalls && 1 > $remainingCalls) { | ||
| if (null === $remainingCallsHeader) { | ||
| return null; | ||
| } | ||
| $remainingCalls = (int) $remainingCallsHeader; | ||
| if (1 > $remainingCalls) { | ||
| throw new ApiLimitExceedException($remainingCalls); | ||
| } | ||
| return $remainingCalls; | ||
| return $remainingCallsHeader; | ||
acrobat marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| /** | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,15 @@ | ||
| parameters: | ||
| level: 4 | ||
| checkMissingIterableValueType: false | ||
| level: 6 | ||
| paths: | ||
| - lib | ||
| ignoreErrors: | ||
| # Ignore typehint errors on api classes | ||
| - | ||
| message: '#Method (.*) with no typehint specified\.#' | ||
| path: lib/Github/Api | ||
| - | ||
| message: '#Method (.*) has no return typehint specified\.#' | ||
| path: lib/Github/Api |
Uh oh!
There was an error while loading. Please reload this page.