You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blog/collider.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Here's my reasoning:
29
29
30
30
> The array solution should be slower than the `for` loop, since extra resources go into computing hashes for the hash table when creating the array, and more memory is needed for intermediate values.
31
31
32
-
Let's verify this: we'll write the functions and add the `#[Bench]` attribute to one of them.
32
+
Let's verify this: we'll write the functions and add the <attr>\Testo\Bench</attr> attribute to one of them.
33
33
34
34
```php
35
35
#[Bench(
@@ -56,7 +56,7 @@ public static function sumInArray(int $a, int $b): int
56
56
}
57
57
```
58
58
59
-
With the `#[Bench]` attribute, we're telling Testo that:
59
+
With the <attr>\Testo\Bench</attr> attribute, we're telling Testo that:
60
60
- we want to compare the performance of the current function (`sumInCycle`) with another function (`sumInArray`);
61
61
- both functions will receive the same arguments: `1` and `5_000`;
62
62
- to measure execution time, each function will be called 100 times in a row (`calls: 100`).
@@ -94,7 +94,7 @@ Statistics comes to the rescue with the [coefficient of variation](https://en.wi
94
94
The smaller this coefficient, the more stable the results.
95
95
96
96
All we need to do is collect more data spread over time — that is, rerun the benchmarks multiple times.
97
-
The `#[Bench]` attribute has an `iterations` parameter responsible for the number of benchmark reruns.
97
+
The <attr>\Testo\Bench</attr> attribute has an `iterations` parameter responsible for the number of benchmark reruns.
Copy file name to clipboardExpand all lines: docs/getting-started.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ To learn more about configuration, visit the [Configuration](configuration.md) s
55
55
56
56
## Writing Your First Test
57
57
58
-
Create a test class in the configured directory (e.g., `tests/Unit/MyFirstTest.php`) and add a method with the `#[Test]` attribute:
58
+
Create a test class in the configured directory (e.g., `tests/Unit/MyFirstTest.php`) and add a method with the <attr>\Testo\Test</attr> attribute:
59
59
60
60
```php
61
61
final class MyFirstTest
@@ -71,7 +71,7 @@ final class MyFirstTest
71
71
}
72
72
```
73
73
74
-
The `#[Test]` attribute marks the method as a test, and the <class>\Testo\Assert</class> facade checks assertions. More about test approaches, attributes, and conventions — in [Writing Tests](writing-tests.md).
74
+
The <attr>\Testo\Test</attr> attribute marks the method as a test, and the <class>\Testo\Assert</class> facade checks assertions. More about test approaches, attributes, and conventions — in [Writing Tests](writing-tests.md).
<short>Validates the JSON structure against a Psalm type.</short>
315
315
<description>Accepts an extended Psalm type annotation — for example, `'array{foo: bool, bar?: non-empty-string}'` or `'list<array{id: positive-int}>'`.</description>
0 commit comments