Skip to content

Commit

Permalink
PresenterComponent β‡’ Component
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 25, 2016
1 parent d814c54 commit b9b8166
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/UI/ComponentReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


/**
* Helpers for Presenter & PresenterComponent.
* Helpers for Presenter & Component.
* @property-read string $name
* @property-read string $fileName
* @internal
Expand Down Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Application/UI/Control.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/Application/UI/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Application/UI/Multiplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* Component multiplier.
*/
class Multiplier extends PresenterComponent
class Multiplier extends Component
{
/** @var callable */
private $factory;
Expand Down
2 changes: 1 addition & 1 deletion src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Test: Nette\Application\UI\PresenterComponent::isLinkCurrent()
* Test: Nette\Application\UI\Component::isLinkCurrent()
*/

use Nette\Application;
Expand All @@ -16,7 +16,7 @@ function callIsLinkCurrent(Application\Request $request, $destination, array $ar

function callIsComponentLinkCurrent(
Application\UI\Presenter $presenter,
Application\UI\PresenterComponent $component,
Application\UI\Component $component,
Application\Request $request,
$destination,
array $args
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Test: Nette\Application\UI\PresenterComponent::isLinkCurrent()
* Test: Nette\Application\UI\Component::isLinkCurrent()
* @phpVersion 7
*/

Expand Down Expand Up @@ -40,4 +40,4 @@ class TestControl extends Application\UI\Control

}

require __DIR__ . '/PresenterComponent.isLinkCurrent().asserts.php';
require __DIR__ . '/Component.isLinkCurrent().asserts.php';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Test: Nette\Application\UI\PresenterComponent::isLinkCurrent()
* Test: Nette\Application\UI\Component::isLinkCurrent()
*/

use Nette\Application;
Expand Down Expand Up @@ -39,4 +39,4 @@ class TestControl extends Application\UI\Control

}

require __DIR__ . '/PresenterComponent.isLinkCurrent().asserts.php';
require __DIR__ . '/Component.isLinkCurrent().asserts.php';
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Test: Nette\Application\UI\PresenterComponent::redirect()
* Test: Nette\Application\UI\Component::redirect()
*/

use Nette\Http;
Expand Down

0 comments on commit b9b8166

Please sign in to comment.