Skip to content

Commit fb60dee

Browse files
committed
More specific PHPCS ignore
1 parent 620b4f1 commit fb60dee

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

phpcs.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
<exclude-pattern>tests/Hydrators*</exclude-pattern>
2121
<exclude-pattern>tests/PersistentCollections*</exclude-pattern>
2222

23-
<!-- Property Hooks aren't supported yet -->
24-
<exclude-pattern>tests/**/PropertyHooks*</exclude-pattern>
25-
2623
<rule ref="Doctrine">
2724
<!-- Traversable type hints often end up as mixed[], so we skip them for now -->
2825
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />

tests/Documents/PropertyHooks/User.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
namespace Documents\PropertyHooks;
3+
declare(strict_types=1);
44

5+
namespace Documents\PropertyHooks;
56

67
use Doctrine\ODM\MongoDB\Mapping\Annotations\Document;
78
use Doctrine\ODM\MongoDB\Mapping\Annotations\Field;
@@ -11,6 +12,7 @@
1112
#[Document(collection: 'property_hooks_user')]
1213
class User
1314
{
15+
// phpcs:disable
1416
#[Id]
1517
public ?string $id;
1618

@@ -51,4 +53,5 @@ class User
5153
$this->language = strtolower($value);
5254
}
5355
}
56+
// phpcs:enable
5457
}

tests/Tests/Functional/PropertyHooksTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function testMappingVirtualPropertyIsNotSupported(): void
102102
#[Document(collection: 'property_hooks_user')]
103103
class MappingVirtualProperty
104104
{
105+
// phpcs:disable
105106
#[Id]
106107
public ?string $id;
107108

@@ -118,4 +119,5 @@ class MappingVirtualProperty
118119
[$this->first, $this->last] = explode(' ', $value, 2);
119120
}
120121
}
122+
// phpcs:enable
121123
}

0 commit comments

Comments
 (0)