|
9 | 9 | use Documents\User; |
10 | 10 | use MongoDB\BSON\ObjectId; |
11 | 11 | use MongoDB\BSON\UTCDateTime; |
12 | | -use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods; |
13 | | -use PhpBench\Benchmark\Metadata\Annotations\Warmup; |
| 12 | +use PhpBench\Attributes\BeforeMethods; |
| 13 | +use PhpBench\Attributes\Warmup; |
14 | 14 |
|
15 | | -/** @BeforeMethods({"init"}, extend=true) */ |
| 15 | +#[BeforeMethods(['init'])] |
16 | 16 | final class HydrateDocumentBench extends BaseBench |
17 | 17 | { |
18 | 18 | /** @var array<string, mixed> */ |
@@ -78,31 +78,31 @@ public function init(): void |
78 | 78 | ->getHydratorFor(User::class); |
79 | 79 | } |
80 | 80 |
|
81 | | - /** @Warmup(2) */ |
| 81 | + #[Warmup(2)] |
82 | 82 | public function benchHydrateDocument(): void |
83 | 83 | { |
84 | 84 | self::$hydrator->hydrate(new User(), self::$data); |
85 | 85 | } |
86 | 86 |
|
87 | | - /** @Warmup(2) */ |
| 87 | + #[Warmup(2)] |
88 | 88 | public function benchHydrateDocumentWithEmbedOne(): void |
89 | 89 | { |
90 | 90 | self::$hydrator->hydrate(new User(), self::$data + self::$embedOneData); |
91 | 91 | } |
92 | 92 |
|
93 | | - /** @Warmup(2) */ |
| 93 | + #[Warmup(2)] |
94 | 94 | public function benchHydrateDocumentWithEmbedMany(): void |
95 | 95 | { |
96 | 96 | self::$hydrator->hydrate(new User(), self::$data + self::$embedManyData); |
97 | 97 | } |
98 | 98 |
|
99 | | - /** @Warmup(2) */ |
| 99 | + #[Warmup(2)] |
100 | 100 | public function benchHydrateDocumentWithReferenceOne(): void |
101 | 101 | { |
102 | 102 | self::$hydrator->hydrate(new User(), self::$data + self::$referenceOneData); |
103 | 103 | } |
104 | 104 |
|
105 | | - /** @Warmup(2) */ |
| 105 | + #[Warmup(2)] |
106 | 106 | public function benchHydrateDocumentWithReferenceMany(): void |
107 | 107 | { |
108 | 108 | self::$hydrator->hydrate(new User(), self::$data + self::$referenceManyData); |
|
0 commit comments