Skip to content

Commit 7c34cd9

Browse files
Add some missing return types to internal/final classes
1 parent d59c4dd commit 7c34cd9

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

DataCollector/ValidatorDataCollector.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,25 @@ public function lateCollect()
6565
}, 0);
6666
}
6767

68-
/**
69-
* @return Data
70-
*/
71-
public function getCalls()
68+
public function getCalls(): Data
7269
{
7370
return $this->data['calls'];
7471
}
7572

76-
/**
77-
* @return int
78-
*/
79-
public function getViolationsCount()
73+
public function getViolationsCount(): int
8074
{
8175
return $this->data['violations_count'];
8276
}
8377

8478
/**
8579
* {@inheritdoc}
8680
*/
87-
public function getName()
81+
public function getName(): string
8882
{
8983
return 'validator';
9084
}
9185

92-
protected function getCasters()
86+
protected function getCasters(): array
9387
{
9488
return parent::getCasters() + [
9589
\Exception::class => function (\Exception $e, array $a, Stub $s) {

Test/ConstraintValidatorTestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Symfony\Component\Validator\ConstraintViolation;
2626
use Symfony\Component\Validator\ConstraintViolationInterface;
2727
use Symfony\Component\Validator\ConstraintViolationList;
28+
use Symfony\Component\Validator\ConstraintViolationListInterface;
2829
use Symfony\Component\Validator\Context\ExecutionContext;
2930
use Symfony\Component\Validator\Context\ExecutionContextInterface;
3031
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -503,7 +504,7 @@ public function doValidatePropertyValue($objectOrClass, string $propertyName, $v
503504
return $this;
504505
}
505506

506-
public function getViolations()
507+
public function getViolations(): ConstraintViolationListInterface
507508
{
508509
}
509510

0 commit comments

Comments
 (0)