Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Feb 7, 2025
1 parent dda774c commit 88b0442
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/Test/AbstractFormHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function equalToErrors(): Constraint
}

throw new AssertionFailedError(
sprintf("Method 'addError' was not expected to be called with message '%s'", $error->getMessage())
\sprintf("Method 'addError' was not expected to be called with message '%s'", $error->getMessage())
);
}

Expand Down Expand Up @@ -193,7 +193,7 @@ private function checkUncalledErrors(): void
foreach ($this->errors as $data) {
if (0 === $data['count']) {
throw new AssertionFailedError(
sprintf("Method 'addError' was expected to be called with message '%s' actually was not called", $data['message'])
\sprintf("Method 'addError' was expected to be called with message '%s' actually was not called", $data['message'])
);
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/Validator/Constraints/BatchTimeAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ final class BatchTimeAfter extends Constraint
*/
public function __construct(
array $options = [],
string $firstField = null,
string $secondField = null,
string $message = null,
string $emptyMessage = null,
bool $required = null,
array $groups = null,
?string $firstField = null,
?string $secondField = null,
?string $message = null,
?string $emptyMessage = null,
?bool $required = null,
?array $groups = null,
mixed $payload = null,
) {
if (null !== $firstField) {
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Constraints/BatchTimeAfterValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function validate($value, Constraint $constraint): void
}

if (!\is_object($value)) {
throw new InvalidArgumentException(sprintf('Could not validate "%s"', \gettype($value)));
throw new InvalidArgumentException(\sprintf('Could not validate "%s"', \gettype($value)));
}

$firstDate = $this->getFieldValue($value, $constraint->firstField);
Expand Down
12 changes: 6 additions & 6 deletions src/Validator/Constraints/DateAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ final class DateAfter extends Constraint
*/
public function __construct(
array $options = [],
string $firstField = null,
string $secondField = null,
string $message = null,
string $emptyMessage = null,
bool $required = null,
array $groups = null,
?string $firstField = null,
?string $secondField = null,
?string $message = null,
?string $emptyMessage = null,
?bool $required = null,
?array $groups = null,
mixed $payload = null,
) {
if (null !== $firstField) {
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Constraints/DateAfterValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function validate($value, Constraint $constraint): void
}

if (!\is_object($value)) {
throw new InvalidArgumentException(sprintf('Could not validate "%s"', \gettype($value)));
throw new InvalidArgumentException(\sprintf('Could not validate "%s"', \gettype($value)));
}

$firstFieldName = $constraint->firstField;
Expand Down
4 changes: 2 additions & 2 deletions tests/Validator/Constraints/BatchTimeAfterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class BatchTimeAfterTest extends TestCase
public function testItIsNotInstantiableWithMissingFirstField(): void
{
$this->expectException(MissingOptionsException::class);
$this->expectExceptionMessageMatches(sprintf('#^%s#', preg_quote('The options "firstField" must be set for constraint', '#')));
$this->expectExceptionMessageMatches(\sprintf('#^%s#', preg_quote('The options "firstField" must be set for constraint', '#')));

new BatchTimeAfter([
'secondField' => 'first',
Expand All @@ -31,7 +31,7 @@ public function testItIsNotInstantiableWithMissingFirstField(): void
public function testItIsNotInstantiableWithMissingSecondField(): void
{
$this->expectException(MissingOptionsException::class);
$this->expectExceptionMessageMatches(sprintf('#^%s#', preg_quote('The options "secondField" must be set for constraint', '#')));
$this->expectExceptionMessageMatches(\sprintf('#^%s#', preg_quote('The options "secondField" must be set for constraint', '#')));

new BatchTimeAfter([
'firstField' => 'first',
Expand Down
4 changes: 2 additions & 2 deletions tests/Validator/Constraints/DateAfterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class DateAfterTest extends TestCase
public function testItIsNotInstantiableWithMissingFirstField(): void
{
$this->expectException(MissingOptionsException::class);
$this->expectExceptionMessageMatches(sprintf('#^%s#', preg_quote('The options "firstField" must be set for constraint', '#')));
$this->expectExceptionMessageMatches(\sprintf('#^%s#', preg_quote('The options "firstField" must be set for constraint', '#')));

new DateAfter([
'secondField' => 'first',
Expand All @@ -31,7 +31,7 @@ public function testItIsNotInstantiableWithMissingFirstField(): void
public function testItIsNotInstantiableWithMissingSecondField(): void
{
$this->expectException(MissingOptionsException::class);
$this->expectExceptionMessageMatches(sprintf('#^%s#', preg_quote('The options "secondField" must be set for constraint', '#')));
$this->expectExceptionMessageMatches(\sprintf('#^%s#', preg_quote('The options "secondField" must be set for constraint', '#')));

new DateAfter([
'firstField' => 'first',
Expand Down

0 comments on commit 88b0442

Please sign in to comment.