src/Prismic/Exception/RequestFailureException.php
Checking instanceof against undeclared class \GuzzleHttp\Exception\RequestException
Open
Open
if ($e instanceof RequestException) {
- Exclude checks
Checking instanceof against undeclared class \GuzzleHttp\Exception\RequestException
Open
Open
if (! $this->guzzleException instanceof RequestException) {
- Exclude checks
Return type of getRequest()
is undeclared type ?\Psr\Http\Message\RequestInterface
Open
Open
public function getRequest() :? RequestInterface
- Exclude checks
Call to method getResponse
from undeclared class \GuzzleHttp\Exception\RequestException
Open
Open
$response = $e->getResponse();
- Exclude checks
Argument 3 (previous)
is \GuzzleHttp\Exception\GuzzleException
but \Prismic\Exception\RequestFailureException::__construct()
takes ?\RuntimeException|?\Throwable
Open
Open
$exception = new static('Api Request Failed', 500, $e);
- Exclude checks
Return type of getResponse()
is undeclared type ?\Psr\Http\Message\ResponseInterface
Open
Open
public function getResponse() :? ResponseInterface
- Exclude checks
Assigning \GuzzleHttp\Exception\RequestException
to property but \Prismic\Exception\RequestFailureException->guzzleException
is \GuzzleHttp\Exception\GuzzleException|null
Open
Open
$exception->guzzleException = $e;
- Exclude checks
Argument 3 (previous)
is \GuzzleHttp\Exception\RequestException
but \Prismic\Exception\RequestFailureException::__construct()
takes ?\RuntimeException|?\Throwable
Open
Open
$exception = new static($message, $code, $e);
- Exclude checks
Parameter $e
has undeclared type \GuzzleHttp\Exception\RequestException
Open
Open
protected static function fromGuzzleRequestException(RequestException $e) : self
- Exclude checks
Call to method getRequest
from undeclared class \GuzzleHttp\Exception\RequestException
Open
Open
$request = $e->getRequest();
- Exclude checks
Property \Prismic\Exception\RequestFailureException->guzzleException
has undeclared type \GuzzleHttp\Exception\GuzzleException
Open
Open
protected $guzzleException;
- Exclude checks
Call to method getRequest
from undeclared class \GuzzleHttp\Exception\GuzzleException
Open
Open
return $this->guzzleException->getRequest();
- Exclude checks
Call to method getResponse
from undeclared class \GuzzleHttp\Exception\GuzzleException
Open
Open
return $this->guzzleException->getResponse();
- Exclude checks
Checking instanceof against undeclared class \GuzzleHttp\Exception\RequestException
Open
Open
if (! $this->guzzleException instanceof RequestException) {
- Exclude checks
Parameter $e
has undeclared type \GuzzleHttp\Exception\GuzzleException
Open
Open
public static function fromGuzzleException(GuzzleException $e) : self
- Exclude checks
Avoid variables with short names like $e. Configured minimum length is 3. Open
Open
protected static function fromGuzzleRequestException(RequestException $e) : self
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $e. Configured minimum length is 3. Open
Open
public static function fromGuzzleException(GuzzleException $e) : self
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}