diff --git a/src/Application/UI/PresenterComponent.php b/src/Application/UI/Component.php similarity index 98% rename from src/Application/UI/PresenterComponent.php rename to src/Application/UI/Component.php index b280da505..21203abf9 100644 --- a/src/Application/UI/PresenterComponent.php +++ b/src/Application/UI/Component.php @@ -11,7 +11,7 @@ /** - * PresenterComponent is the base class for all Presenter components. + * Component is the base class for all Presenter components. * * Components are persistent objects located on a presenter. They have ability to own * other child components, and interact with user. Components have properties @@ -20,7 +20,7 @@ * @property-read Presenter $presenter * @property-read bool $linkCurrent */ -abstract class PresenterComponent extends Nette\ComponentModel\Container implements ISignalReceiver, IStatePersistent, \ArrayAccess +abstract class Component extends Nette\ComponentModel\Container implements ISignalReceiver, IStatePersistent, \ArrayAccess { /** @var callable[] function (self $sender); Occurs when component is attached to presenter */ public $onAnchor; diff --git a/src/Application/UI/ComponentReflection.php b/src/Application/UI/ComponentReflection.php index ecd701d21..3471e798b 100644 --- a/src/Application/UI/ComponentReflection.php +++ b/src/Application/UI/ComponentReflection.php @@ -13,7 +13,7 @@ /** - * Helpers for Presenter & PresenterComponent. + * Helpers for Presenter & Component. * @property-read string $name * @property-read string $fileName * @internal @@ -44,7 +44,7 @@ public function getPersistentParams($class = NULL) return $params; } $params = []; - if (is_subclass_of($class, PresenterComponent::class)) { + if (is_subclass_of($class, Component::class)) { $defaults = get_class_vars($class); foreach ($class::getPersistentParams() as $name => $default) { if (is_int($name)) { diff --git a/src/Application/UI/Control.php b/src/Application/UI/Control.php index c5f814d64..1964b600b 100644 --- a/src/Application/UI/Control.php +++ b/src/Application/UI/Control.php @@ -15,7 +15,7 @@ * * @property-read ITemplate $template */ -abstract class Control extends PresenterComponent implements IRenderable +abstract class Control extends Component implements IRenderable { /** @var ITemplateFactory */ private $templateFactory; diff --git a/src/Application/UI/Link.php b/src/Application/UI/Link.php index c5244211f..07cb6a829 100644 --- a/src/Application/UI/Link.php +++ b/src/Application/UI/Link.php @@ -11,14 +11,14 @@ /** - * Lazy encapsulation of PresenterComponent::link(). - * Do not instantiate directly, use PresenterComponent::lazyLink() + * Lazy encapsulation of Component::link(). + * Do not instantiate directly, use Component::lazyLink() */ class Link { use Nette\SmartObject; - /** @var PresenterComponent */ + /** @var Component */ private $component; /** @var string */ @@ -31,7 +31,7 @@ class Link /** * Link specification. */ - public function __construct(PresenterComponent $component, $destination, array $params = []) + public function __construct(Component $component, $destination, array $params = []) { $this->component = $component; $this->destination = $destination; diff --git a/src/Application/UI/Multiplier.php b/src/Application/UI/Multiplier.php index 95496ab17..007f0ee2b 100644 --- a/src/Application/UI/Multiplier.php +++ b/src/Application/UI/Multiplier.php @@ -13,7 +13,7 @@ /** * Component multiplier. */ -class Multiplier extends PresenterComponent +class Multiplier extends Component { /** @var callable */ private $factory; diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index ef0e694d9..1eb1b56ea 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -769,7 +769,7 @@ public function lastModified($lastModified, $etag = NULL, $expire = NULL) /** * Request/URL factory. - * @param PresenterComponent base + * @param Component base * @param string destination in format "[//] [[[module:]presenter:]action | signal! | this] [#fragment]" * @param array array of arguments * @param string forward|redirect|link diff --git a/src/compatibility.php b/src/compatibility.php index 5dcfc0ff8..49f2ebc5d 100644 --- a/src/compatibility.php +++ b/src/compatibility.php @@ -5,4 +5,5 @@ * Copyright (c) 2004 David Grudl (https://davidgrudl.com) */ +class_alias('Nette\Application\UI\Component', 'Nette\Application\UI\PresenterComponent'); class_alias('Nette\Application\UI\ComponentReflection', 'Nette\Application\UI\PresenterComponentReflection'); diff --git a/tests/UI/PresenterComponent.isLinkCurrent().asserts.php b/tests/UI/Component.isLinkCurrent().asserts.php similarity index 98% rename from tests/UI/PresenterComponent.isLinkCurrent().asserts.php rename to tests/UI/Component.isLinkCurrent().asserts.php index d880a36c1..be3258c3d 100644 --- a/tests/UI/PresenterComponent.isLinkCurrent().asserts.php +++ b/tests/UI/Component.isLinkCurrent().asserts.php @@ -1,7 +1,7 @@