Skip to content

Commit 122ecff

Browse files
committed
Add #[Override] attribute to Validation namespace
1 parent 924f21e commit 122ecff

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

src/Validation/DatabasePresenceVerifier.php

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,16 @@
55
namespace MongoDB\Laravel\Validation;
66

77
use MongoDB\BSON\Regex;
8+
use Override;
89

910
use function array_map;
1011
use function implode;
1112
use function preg_quote;
1213

1314
class DatabasePresenceVerifier extends \Illuminate\Validation\DatabasePresenceVerifier
1415
{
15-
/**
16-
* Count the number of objects in a collection having the given value.
17-
*
18-
* @param string $collection
19-
* @param string $column
20-
* @param string $value
21-
* @param int $excludeId
22-
* @param string $idColumn
23-
*
24-
* @return int
25-
*/
16+
/** Count the number of objects in a collection having the given value. */
17+
#[Override]
2618
public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = [])
2719
{
2820
$query = $this->table($collection)->where($column, new Regex('^' . preg_quote($value) . '$', '/i'));
@@ -38,16 +30,8 @@ public function getCount($collection, $column, $value, $excludeId = null, $idCol
3830
return $query->count();
3931
}
4032

41-
/**
42-
* Count the number of objects in a collection with the given values.
43-
*
44-
* @param string $collection
45-
* @param string $column
46-
* @param array $values
47-
* @param array $extra
48-
*
49-
* @return int
50-
*/
33+
/** Count the number of objects in a collection with the given values. */
34+
#[Override]
5135
public function getMultiCount($collection, $column, array $values, array $extra = [])
5236
{
5337
// Nothing can match an empty array. Return early to avoid matching an empty string.

src/Validation/ValidationServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
namespace MongoDB\Laravel\Validation;
66

77
use Illuminate\Validation\ValidationServiceProvider as BaseProvider;
8+
use Override;
89

910
class ValidationServiceProvider extends BaseProvider
1011
{
12+
#[Override]
1113
protected function registerPresenceVerifier()
1214
{
1315
$this->app->singleton('validation.presence', function ($app) {

0 commit comments

Comments
 (0)