mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 02:51:04 +00:00
Fixed phpstan
This commit is contained in:
parent
e1fef1e625
commit
a7814c8129
2 changed files with 7 additions and 4 deletions
|
@ -798,9 +798,12 @@ class EntryRestController extends WallabagRestController
|
|||
|
||||
$errors = $validator->validate($entry);
|
||||
if (\count($errors) > 0) {
|
||||
$errorsString = (string) $errors;
|
||||
$errorsString = '';
|
||||
foreach ($errors as $error) {
|
||||
$errorsString .= $error->getMessage() . "\n";
|
||||
}
|
||||
|
||||
return $this->sendResponse($errorsString);
|
||||
throw new BadRequestHttpException($errorsString);
|
||||
}
|
||||
|
||||
$this->entityManager->persist($entry);
|
||||
|
|
|
@ -614,10 +614,10 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
|||
'public' => 1,
|
||||
]);
|
||||
|
||||
$this->assertSame(200, $this->client->getResponse()->getStatusCode());
|
||||
$this->assertSame(400, $this->client->getResponse()->getStatusCode());
|
||||
|
||||
$content = json_decode($this->client->getResponse()->getContent(), true);
|
||||
$this->assertStringContainsString('The url \'"wallabagIsAwesome"\' is not a valid url', $content);
|
||||
$this->assertStringContainsString('The url \'"wallabagIsAwesome"\' is not a valid url', $content['message']);
|
||||
}
|
||||
|
||||
public function testPostEntry()
|
||||
|
|
Loading…
Reference in a new issue