Skip to content

Commit 49dcaf3

Browse files
committed
removed deprecated stuff
1 parent 932f822 commit 49dcaf3

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

src/ComponentModel/Component.php

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Nette\ComponentModel;
1111

1212
use Nette;
13-
use function func_num_args, in_array, substr;
13+
use function in_array, substr;
1414

1515

1616
/**
@@ -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 IComponent[] $components
2018
*/
2119
class Container extends Component implements IContainer
2220
{

0 commit comments

Comments
 (0)