Skip to content

Commit 8593c50

Browse files
committed
Application::$maxLoop changed to non-static
1 parent ae6e0bc commit 8593c50

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Application/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Application
2020
use Nette\SmartObject;
2121

2222
/** @var int */
23-
public static $maxLoop = 20;
23+
public $maxLoop = 20;
2424

2525
/** @var bool enable fault barrier? */
2626
public $catchExceptions;
@@ -128,7 +128,7 @@ public function createInitialRequest(): Request
128128
public function processRequest(Request $request): void
129129
{
130130
process:
131-
if (count($this->requests) > self::$maxLoop) {
131+
if (count($this->requests) > $this->maxLoop) {
132132
throw new ApplicationException('Too many loops detected in application life cycle.');
133133
}
134134

tests/Application/Application.run.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ Assert::noError(function () use ($httpRequest, $httpResponse) {
331331
Assert::count(21, $app1->getRequests());
332332

333333
// Redefine maxLoop
334-
Application::$maxLoop = 2;
335334
$app2 = clone $app;
335+
$app2->maxLoop = 2;
336336
Assert::exception(function () use ($app2) {
337337
$app2->run();
338338
}, ApplicationException::class, 'Too many loops detected in application life cycle.');

0 commit comments

Comments
 (0)