Skip to content

Commit dee7f75

Browse files
committed
removed deprecated stuff
1 parent 932e8e2 commit dee7f75

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

src/ComponentModel/Component.php

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,8 @@ final public function lookupPath(?string $type = null, bool $throw = true): ?str
9292
*/
9393
final public function monitor(string $type, ?callable $attached = null, ?callable $detached = null): void
9494
{
95-
if (func_num_args() === 1) {
96-
$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+
throw new Nette\InvalidStateException('At least one handler is required.');
10097
}
10198

10299
if (
@@ -120,26 +117,6 @@ final public function unmonitor(string $type): void
120117
}
121118

122119

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-
protected function attached(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.
136-
* @deprecated use monitor($type, null, $detached)
137-
*/
138-
protected function detached(IComponent $obj): void
139-
{
140-
}
141-
142-
143120
/********************* interface IComponent ****************d*g**/
144121

145122

src/ComponentModel/Container.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
/**
1717
* Manages a collection of child components.
18-
*
19-
* @property-deprecated T[] $components
2018
*/
2119
class Container extends Component implements IContainer
2220
{

0 commit comments

Comments
 (0)