chore: update link in user agent #323
Annotations
7 warnings
Code Quality:
src/Client/RestClient.php#L70
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
*/
public function authenticate(): self
{
- $this->authorisationMiddleware->resetToken();
+
$options = ['username' => $this->configuration->getUsername(), 'password' => $this->configuration->getPassword(), 'lifetime' => $this->configuration->getLifetime()];
try {
$response = $this->request('POST', 'application/tokens', $options);
|
Code Quality:
src/Client/RestClient.php#L131
Escaped Mutant for Mutator "UnwrapLtrim":
@@ @@
if (!\is_array($data)) {
throw new RestClientException(\sprintf('data must be an array, "%s" given', \get_debug_type($data)), 1578233543);
}
- $resource = \ltrim($resource, '/');
+ $resource = $resource;
$contentType = $this->routeContentTypeMapper->getRequestContentTypeForRoute($method, $resource);
try {
if ($contentType === 'multipart/form-data') {
|
Code Quality:
src/Middleware/AuthorisationMiddleware.php#L44
Escaped Mutant for Mutator "FunctionCall":
@@ @@
if ($this->token) {
$request = $request->withHeader('X-Jobrouter-Authorization', 'Bearer ' . $this->token);
}
- return $next($request);
+ $next($request);
+ return null;
}
public function handleResponse(RequestInterface $request, ResponseInterface $response, callable $next): ?ResponseInterface
{
|
Code Quality:
src/Middleware/AuthorisationMiddleware.php#L49
Escaped Mutant for Mutator "FunctionCall":
@@ @@
}
public function handleResponse(RequestInterface $request, ResponseInterface $response, callable $next): ?ResponseInterface
{
- return $next($request, $response);
+ $next($request, $response);
+ return null;
}
}
|
Code Quality:
src/Middleware/UserAgentMiddleware.php#L31
Escaped Mutant for Mutator "UnwrapRtrim":
@@ @@
private readonly string $userAgent;
public function __construct(string $userAgentAddition = '')
{
- $this->userAgent = \rtrim(\sprintf(self::USER_AGENT_TEMPLATE, (new Version())->getVersion(), $userAgentAddition));
+ $this->userAgent = \sprintf(self::USER_AGENT_TEMPLATE, (new Version())->getVersion(), $userAgentAddition);
}
public function handleRequest(RequestInterface $request, callable $next): ?RequestInterface
{
|
Code Quality:
src/Middleware/UserAgentMiddleware.php#L44
Escaped Mutant for Mutator "FunctionCall":
@@ @@
public function handleRequest(RequestInterface $request, callable $next): ?RequestInterface
{
$request = $request->withHeader('User-Agent', $this->userAgent);
- return $next($request);
+ $next($request);
+ return null;
}
public function handleResponse(RequestInterface $request, ResponseInterface $response, callable $next): ?ResponseInterface
{
|
Code Quality:
src/Middleware/UserAgentMiddleware.php#L49
Escaped Mutant for Mutator "FunctionCall":
@@ @@
}
public function handleResponse(RequestInterface $request, ResponseInterface $response, callable $next): ?ResponseInterface
{
- return $next($request, $response);
+ $next($request, $response);
+ return null;
}
}
|