Skip to content

Commit 5496409

Browse files
committed
Merge branch '11.x'
2 parents a31393e + 100c20e commit 5496409

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

billing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ You may pass an array of prices to the `previewInvoice` method in order to previ
18821882

18831883
Before generating invoice PDFs, you should use Composer to install the Dompdf library, which is the default invoice renderer for Cashier:
18841884

1885-
```php
1885+
```shell
18861886
composer require dompdf/dompdf
18871887
```
18881888

helpers.md

+20
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Lottery](#lottery)
1010
- [Pipeline](#pipeline)
1111
- [Sleep](#sleep)
12+
- [Timebox](#timebox)
1213

1314
<a name="introduction"></a>
1415
## Introduction
@@ -2769,3 +2770,22 @@ $start->diffForHumans(); // 1 second ago
27692770
```
27702771

27712772
Laravel uses the `Sleep` class internally whenever it is pausing execution. For example, the [`retry`](#method-retry) helper uses the `Sleep` class when sleeping, allowing for improved testability when using that helper.
2773+
2774+
<a name="timebox"></a>
2775+
### Timebox
2776+
2777+
Laravel's `Timebox` class ensures that the given callback always takes a fixed amount of time to execute, even if its actual execution completes sooner. This is particularly useful for cryptographic operations and user authentication checks, where attackers might exploit variations in execution time to infer sensitive information.
2778+
2779+
If the execution exceeds the fixed duration, `Timebox` has no effect. It is up to the developer to choose a sufficiently long time as the fixed duration to account for worst-case scenarios.
2780+
2781+
The call method accepts a closure and a time limit in microseconds, and then executes the closure and waits until the time limit is reached:
2782+
2783+
```php
2784+
use Illuminate\Support\Timebox;
2785+
2786+
(new Timebox)->call(function ($timebox) {
2787+
// ...
2788+
}, microseconds: 10000);
2789+
```
2790+
2791+
If an exception is thrown within the closure, this class will respect the defined delay and re-throw the exception after the delay.

http-tests.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class ExampleTest extends TestCase
303303
}
304304
```
305305

306-
Alternatively, you may use the `dd`, `ddHeaders`, and `ddSession` methods to dump information about the response and then stop execution:
306+
Alternatively, you may use the `dd`, `ddHeaders`, `ddSession`, and `ddJson` methods to dump information about the response and then stop execution:
307307

308308
```php tab=Pest
309309
<?php
@@ -312,9 +312,8 @@ test('basic test', function () {
312312
$response = $this->get('/');
313313

314314
$response->ddHeaders();
315-
316315
$response->ddSession();
317-
316+
$response->ddJson();
318317
$response->dd();
319318
});
320319
```

0 commit comments

Comments
 (0)