Skip to content

Commit 9ad7491

Browse files
committed
Style fix
1 parent 6bc6aae commit 9ad7491

16 files changed

+10
-39
lines changed

src/Identity/Request/CreateSessionRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
class CreateSessionRequest implements RequestInterface
1111
{
12-
#[Assert\NotBlank]
12+
#[Assert\NotBlank(normalizer: 'trim')]
1313
#[Assert\Type(type: 'string')]
1414
public string $loginName;
1515

16-
#[Assert\NotBlank]
16+
#[Assert\NotBlank(normalizer: 'trim')]
1717
#[Assert\Type(type: 'string')]
1818
public string $password;
1919

src/Identity/Request/UpdateAttributeDefinitionRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class UpdateAttributeDefinitionRequest implements RequestInterface
1212
{
13-
#[Assert\NotBlank]
13+
#[Assert\NotBlank(normalizer: 'trim')]
1414
public string $name;
1515

1616
public ?string $type = null;

src/Identity/Request/ValidateTokenRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class ValidateTokenRequest implements RequestInterface
1111
{
12-
#[Assert\NotBlank]
12+
#[Assert\NotBlank(normalizer: 'trim')]
1313
#[Assert\Type(type: 'string')]
1414
public string $token;
1515

src/Messaging/Request/CreateTemplateRequest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@
66

77
use PhpList\Core\Domain\Messaging\Model\Dto\CreateTemplateDto;
88
use PhpList\RestBundle\Common\Request\RequestInterface;
9+
use PhpList\RestBundle\Messaging\Validator\Constraint\ContainsPlaceholder;
910
use Symfony\Component\HttpFoundation\File\UploadedFile;
1011
use Symfony\Component\Validator\Constraints as Assert;
1112

1213
class CreateTemplateRequest implements RequestInterface
1314
{
14-
#[Assert\NotBlank]
15+
#[Assert\NotBlank(normalizer: 'trim')]
1516
#[Assert\NotNull]
1617
public string $title;
1718

1819
#[Assert\NotBlank]
19-
#[\PhpList\RestBundle\Messaging\Validator\Constraint\ContainsPlaceholder]
20+
#[ContainsPlaceholder]
2021
public string $content;
2122

22-
#[\PhpList\RestBundle\Messaging\Validator\Constraint\ContainsPlaceholder]
23+
#[ContainsPlaceholder]
2324
public ?string $text = null;
2425

2526
public ?UploadedFile $file = null;

src/Subscription/Controller/SubscriberImportController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function importSubscribers(Request $request): JsonResponse
147147
]);
148148
} catch (CouldNotReadUploadedFileException $exception) {
149149
return $this->json([
150-
'message' => 'Could not read uploaded file.' . $exception->getMessage()
150+
'message' => 'Could not read uploaded file. ' . $exception->getMessage()
151151
], Response::HTTP_BAD_REQUEST);
152152
} catch (Exception $e) {
153153
return $this->json([

src/Subscription/Request/SubscribePageRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class SubscribePageRequest implements RequestInterface
1111
{
1212
#[Assert\NotBlank]
13-
#[Assert\Email]
13+
#[Assert\Length(min: 1, max: 255)]
1414
public string $title;
1515

1616
#[Assert\Type(type: 'bool')]

tests/Integration/Identity/Fixtures/AdminAttributeDefinitionFixture.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public function load(ObjectManager $manager): void
3535
break;
3636
}
3737
$row = array_combine($headers, $data);
38-
if ($row === false) {
39-
throw new RuntimeException('Malformed CSV data: header/data length mismatch.');
40-
}
4138

4239
$definition = new AdminAttributeDefinition($row['name']);
4340
$this->setSubjectId($definition, (int)$row['id']);

tests/Integration/Identity/Fixtures/AdminAttributeValueFixture.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ public function load(ObjectManager $manager): void
4040
break;
4141
}
4242
$row = array_combine($headers, $data);
43-
if ($row === false) {
44-
throw new RuntimeException('Malformed CSV data: header/data length mismatch.');
45-
}
4643

4744
$admin = $adminRepository->find($row['admin_id']);
4845
if ($admin === null) {

tests/Integration/Identity/Fixtures/AdministratorFixture.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ public function load(ObjectManager $manager): void
3737
break;
3838
}
3939
$row = array_combine($headers, $data);
40-
if ($row === false) {
41-
throw new RuntimeException('Malformed CSV data: header/data length mismatch.');
42-
}
4340

4441
// Make fixture idempotent: skip if admin with this ID already exists
4542
$existing = $adminRepository->find($row['id']);

tests/Integration/Identity/Fixtures/AdministratorTokenFixture.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ public function load(ObjectManager $manager): void
3737
break;
3838
}
3939
$row = array_combine($headers, $data);
40-
if ($row === false) {
41-
throw new RuntimeException('Malformed CSV data: header/data length mismatch.');
42-
}
4340

4441
$admin = $adminRepository->find($row['adminid']);
4542
if ($admin === null) {

0 commit comments

Comments
 (0)