File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ public function getEnabler(): DebugModeEnabler
27
27
28
28
public function isDebugMode (): bool
29
29
{
30
- return $ this ->isDebugModeByEnabler () ?? $ this ->isDebugModeByEnv () ?? $ this ->isDebugModeByIp () ?? false ;
30
+ return $ this ->isDebugModeByEnabler ()
31
+ ?? $ this ->isDebugModeByEnv ()
32
+ ?? $ this ->isDebugModeByIp ()
33
+ ?? false ;
31
34
}
32
35
33
36
/**
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ class DebugModeEnabler
27
27
/** @var string */
28
28
private $ tempDir ;
29
29
30
+ /** @var bool|null */
31
+ private $ override ;
32
+
30
33
public function __construct (string $ tempDir )
31
34
{
32
35
$ this ->tempDir = $ tempDir ;
@@ -51,6 +54,8 @@ public function activate(bool $isDebug): void
51
54
'samesite ' => 'Strict ' ,
52
55
]
53
56
);
57
+
58
+ $ this ->override = $ isDebug ;
54
59
}
55
60
56
61
@@ -72,9 +77,27 @@ public function deactivate(): void
72
77
'samesite ' => 'Strict ' ,
73
78
]
74
79
);
80
+
81
+ $ this ->override = null ;
82
+ }
83
+
84
+ public function override (bool $ isDebug ): void
85
+ {
86
+ $ this ->override = $ isDebug ;
75
87
}
76
88
77
89
public function isDebug (): ?bool
90
+ {
91
+ return $ this ->isDebugByOverride ()
92
+ ?? $ this ->isDebugByToken ();
93
+ }
94
+
95
+ private function isDebugByOverride (): ?bool
96
+ {
97
+ return $ this ->override ;
98
+ }
99
+
100
+ private function isDebugByToken (): ?bool
78
101
{
79
102
$ tokenName = $ this ->getTokenName ();
80
103
You can’t perform that action at this time.
0 commit comments