Skip to content

Commit 6212beb

Browse files
committed
ISSUE-345: use Constraint directory
1 parent 57df92e commit 6212beb

18 files changed

+29
-29
lines changed

config/services/validators.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ services:
44
autoconfigure: true
55
public: false
66

7-
PhpList\RestBundle\Validator\UniqueEmailValidator:
7+
PhpList\RestBundle\Validator\Constraint\UniqueEmailValidator:
88
autowire: true
99
autoconfigure: true
1010
tags: [ 'validator.constraint_validator' ]
1111

12-
PhpList\RestBundle\Validator\EmailExistsValidator:
12+
PhpList\RestBundle\Validator\Constraint\EmailExistsValidator:
1313
autowire: true
1414
autoconfigure: true
1515
tags: [ 'validator.constraint_validator' ]
1616

17-
PhpList\RestBundle\Validator\TemplateExistsValidator:
17+
PhpList\RestBundle\Validator\Constraint\TemplateExistsValidator:
1818
autowire: true
1919
autoconfigure: true
2020
tags: [ 'validator.constraint_validator' ]
@@ -27,5 +27,5 @@ services:
2727
autowire: true
2828
autoconfigure: true
2929

30-
PhpList\RestBundle\Validator\ContainsPlaceholderValidator:
30+
PhpList\RestBundle\Validator\Constraint\ContainsPlaceholderValidator:
3131
tags: ['validator.constraint_validator']

src/Entity/Request/CreateMessageRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use PhpList\RestBundle\Entity\Request\Message\MessageMetadataRequest;
1010
use PhpList\RestBundle\Entity\Request\Message\MessageOptionsRequest;
1111
use PhpList\RestBundle\Entity\Request\Message\MessageScheduleRequest;
12+
use PhpList\RestBundle\Validator\Constraint as CustomAssert;
1213
use Symfony\Component\Validator\Constraints as Assert;
13-
use PhpList\RestBundle\Validator as CustomAssert;
1414

1515
class CreateMessageRequest implements RequestInterface
1616
{

src/Entity/Request/CreateSubscriberRequest.php

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

55
namespace PhpList\RestBundle\Entity\Request;
66

7-
use PhpList\RestBundle\Validator as CustomAssert;
7+
use PhpList\RestBundle\Validator\Constraint as CustomAssert;
88
use Symfony\Component\Validator\Constraints as Assert;
99

1010
class CreateSubscriberRequest implements RequestInterface

src/Entity/Request/CreateTemplateRequest.php

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

55
namespace PhpList\RestBundle\Entity\Request;
66

7+
use PhpList\RestBundle\Validator\Constraint as CustomAssert;
78
use Symfony\Component\HttpFoundation\File\UploadedFile;
89
use Symfony\Component\Validator\Constraints as Assert;
9-
use PhpList\RestBundle\Validator as CustomAssert;
1010

1111
class CreateTemplateRequest
1212
{

src/Entity/Request/SubscriptionRequest.php

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

55
namespace PhpList\RestBundle\Entity\Request;
66

7-
use PhpList\RestBundle\Validator\EmailExists;
7+
use PhpList\RestBundle\Validator\Constraint\EmailExists;
88
use Symfony\Component\Validator\Constraints as Assert;
99

1010
class SubscriptionRequest implements RequestInterface

src/Entity/Request/UpdateMessageRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use PhpList\RestBundle\Entity\Request\Message\MessageFormatRequest;
99
use PhpList\RestBundle\Entity\Request\Message\MessageOptionsRequest;
1010
use PhpList\RestBundle\Entity\Request\Message\MessageScheduleRequest;
11+
use PhpList\RestBundle\Validator\Constraint as CustomAssert;
1112
use Symfony\Component\Validator\Constraints as Assert;
12-
use PhpList\RestBundle\Validator as CustomAssert;
1313

1414
class UpdateMessageRequest extends CreateMessageRequest
1515
{

src/Entity/Request/UpdateSubscriberRequest.php

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

55
namespace PhpList\RestBundle\Entity\Request;
66

7-
use PhpList\RestBundle\Validator as CustomAssert;
7+
use PhpList\RestBundle\Validator\Constraint as CustomAssert;
88
use Symfony\Component\Validator\Constraints as Assert;
99

1010
class UpdateSubscriberRequest implements RequestInterface

src/Validator/ContainsPlaceholder.php renamed to src/Validator/Constraint/ContainsPlaceholder.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use Symfony\Component\Validator\Constraint;
88

src/Validator/ContainsPlaceholderValidator.php renamed to src/Validator/Constraint/ContainsPlaceholderValidator.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use InvalidArgumentException;
88
use Symfony\Component\Validator\Constraint;

src/Validator/EmailExists.php renamed to src/Validator/Constraint/EmailExists.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use Symfony\Component\Validator\Constraint;
88

src/Validator/EmailExistsValidator.php renamed to src/Validator/Constraint/EmailExistsValidator.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use PhpList\Core\Domain\Repository\Subscription\SubscriberRepository;
88
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

src/Validator/TemplateExists.php renamed to src/Validator/Constraint/TemplateExists.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use Symfony\Component\Validator\Constraint;
88

src/Validator/TemplateExistsValidator.php renamed to src/Validator/Constraint/TemplateExistsValidator.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use PhpList\Core\Domain\Repository\Messaging\TemplateRepository;
88
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;

src/Validator/UniqueEmail.php renamed to src/Validator/Constraint/UniqueEmail.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use Symfony\Component\Validator\Constraint;
88

src/Validator/UniqueEmailValidator.php renamed to src/Validator/Constraint/UniqueEmailValidator.php

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

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Validator;
5+
namespace PhpList\RestBundle\Validator\Constraint;
66

77
use PhpList\Core\Domain\Repository\Subscription\SubscriberRepository;
88
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;

tests/Unit/Validator/EmailExistsValidatorTest.php renamed to tests/Unit/Validator/Constraint/EmailExistsValidatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Tests\Unit\Validator;
5+
namespace PhpList\RestBundle\Tests\Unit\Validator\Constraint;
66

77
use PhpList\Core\Domain\Model\Subscription\Subscriber;
88
use PhpList\Core\Domain\Repository\Subscription\SubscriberRepository;
9-
use PhpList\RestBundle\Validator\EmailExists;
10-
use PhpList\RestBundle\Validator\EmailExistsValidator;
9+
use PhpList\RestBundle\Validator\Constraint\EmailExists;
10+
use PhpList\RestBundle\Validator\Constraint\EmailExistsValidator;
1111
use PHPUnit\Framework\MockObject\MockObject;
1212
use PHPUnit\Framework\TestCase;
13+
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1314
use Symfony\Component\Validator\Constraint;
1415
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1516
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
1617
use Symfony\Component\Validator\Exception\UnexpectedValueException;
17-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1818

1919
class EmailExistsValidatorTest extends TestCase
2020
{

tests/Unit/Validator/TemplateExistsValidatorTest.php renamed to tests/Unit/Validator/Constraint/TemplateExistsValidatorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Tests\Unit\Validator;
5+
namespace PhpList\RestBundle\Tests\Unit\Validator\Constraint;
66

77
use PhpList\Core\Domain\Model\Messaging\Template;
88
use PhpList\Core\Domain\Repository\Messaging\TemplateRepository;
9-
use PhpList\RestBundle\Validator\TemplateExists;
10-
use PhpList\RestBundle\Validator\TemplateExistsValidator;
9+
use PhpList\RestBundle\Validator\Constraint\TemplateExists;
10+
use PhpList\RestBundle\Validator\Constraint\TemplateExistsValidator;
1111
use PHPUnit\Framework\MockObject\MockObject;
1212
use PHPUnit\Framework\TestCase;
13+
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
1314
use Symfony\Component\Validator\Constraint;
1415
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1516
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
1617
use Symfony\Component\Validator\Exception\UnexpectedValueException;
17-
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
1818

1919
class TemplateExistsValidatorTest extends TestCase
2020
{

tests/Unit/Validator/UniqueEmailValidatorTest.php renamed to tests/Unit/Validator/Constraint/UniqueEmailValidatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpList\RestBundle\Tests\Unit\Validator;
5+
namespace PhpList\RestBundle\Tests\Unit\Validator\Constraint;
66

77
use PhpList\Core\Domain\Model\Subscription\Subscriber;
88
use PhpList\Core\Domain\Repository\Subscription\SubscriberRepository;
9-
use PhpList\RestBundle\Validator\UniqueEmail;
10-
use PhpList\RestBundle\Validator\UniqueEmailValidator;
9+
use PhpList\RestBundle\Validator\Constraint\UniqueEmail;
10+
use PhpList\RestBundle\Validator\Constraint\UniqueEmailValidator;
1111
use PHPUnit\Framework\MockObject\MockObject;
1212
use PHPUnit\Framework\TestCase;
1313
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;

0 commit comments

Comments
 (0)