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
$class = (new \ReflectionMethod($this, 'attached'))->getDeclaringClass()->getName();
97
-
trigger_error(__METHOD__ . "(): Methods $class::attached() and $class::detached() are deprecated, use monitor(\$type, [attached], [detached])", E_USER_DEPRECATED);
98
-
$attached = [$this, 'attached'];
99
-
$detached = [$this, 'detached'];
95
+
if (!$attached && !$detached) {
96
+
thrownewNette\InvalidStateException('At least one handler is required.');
100
97
}
101
98
102
99
if (
@@ -120,26 +117,6 @@ final public function unmonitor(string $type): void
120
117
}
121
118
122
119
123
-
/**
124
-
* This method will be called when the component (or component's parent)
125
-
* becomes attached to a monitored object. Do not call this method yourself.
126
-
* @deprecated use monitor($type, $attached)
127
-
*/
128
-
protectedfunctionattached(IComponent$obj): void
129
-
{
130
-
}
131
-
132
-
133
-
/**
134
-
* This method will be called before the component (or component's parent)
135
-
* becomes detached from a monitored object. Do not call this method yourself.
0 commit comments