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