Skip to content

Commit 52d68c0

Browse files
committed
uses Nette\SmartObject
1 parent 209e227 commit 52d68c0

25 files changed

+66
-28
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
],
1616
"require": {
1717
"php": ">=5.6.0",
18-
"nette/component-model": "~2.2",
18+
"nette/component-model": "~2.3",
1919
"nette/http": "~2.2",
2020
"nette/reflection": "~2.2",
2121
"nette/security": "~2.2",
22-
"nette/utils": "~2.2"
22+
"nette/utils": "~2.4"
2323
},
2424
"suggest": {
2525
"nette/forms": "Allows to use Nette\\Application\\UI\\Form",

src/Application/Application.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* Front Controller.
1515
*/
16-
class Application extends Nette\Object
16+
class Application
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var int */
1921
public static $maxLoop = 20;
2022

src/Application/ErrorPresenter.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
/**
1616
* Default Error Presenter.
1717
*/
18-
class ErrorPresenter extends Nette\Object implements Application\IPresenter
18+
class ErrorPresenter implements Application\IPresenter
1919
{
20+
use Nette\SmartObject;
21+
2022
/** @var ILogger|NULL */
2123
private $logger;
2224

src/Application/LinkGenerator.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* Link generator.
1515
*/
16-
class LinkGenerator extends Nette\Object
16+
class LinkGenerator
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var IRouter */
1921
private $router;
2022

src/Application/MicroPresenter.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
/**
1818
* Micro presenter.
1919
*/
20-
class MicroPresenter extends Nette\Object implements Application\IPresenter
20+
class MicroPresenter implements Application\IPresenter
2121
{
22+
use Nette\SmartObject;
23+
2224
/** @var Nette\DI\Container|NULL */
2325
private $context;
2426

src/Application/PresenterFactory.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* Default presenter loader.
1515
*/
16-
class PresenterFactory extends Nette\Object implements IPresenterFactory
16+
class PresenterFactory implements IPresenterFactory
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var array[] of module => splited mask */
1921
private $mapping = [
2022
'*' => ['', '*Module\\', '*Presenter'],

src/Application/Request.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
* @property array $files
1919
* @property string|NULL $method
2020
*/
21-
class Request extends Nette\Object
21+
class Request
2222
{
23+
use Nette\SmartObject;
24+
2325
/** method */
2426
const FORWARD = 'FORWARD';
2527

src/Application/Responses/CallbackResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* Callback response.
1515
*/
16-
class CallbackResponse extends Nette\Object implements Nette\Application\IResponse
16+
class CallbackResponse implements Nette\Application\IResponse
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var callable */
1921
private $callback;
2022

src/Application/Responses/FileResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* File download response.
1515
*/
16-
class FileResponse extends Nette\Object implements Nette\Application\IResponse
16+
class FileResponse implements Nette\Application\IResponse
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var string */
1921
private $file;
2022

src/Application/Responses/ForwardResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* Forwards to new request.
1515
*/
16-
class ForwardResponse extends Nette\Object implements Nette\Application\IResponse
16+
class ForwardResponse implements Nette\Application\IResponse
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var Nette\Application\Request */
1921
private $request;
2022

src/Application/Responses/JsonResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* JSON response used mainly for AJAX requests.
1515
*/
16-
class JsonResponse extends Nette\Object implements Nette\Application\IResponse
16+
class JsonResponse implements Nette\Application\IResponse
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var array|\stdClass */
1921
private $payload;
2022

src/Application/Responses/RedirectResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/**
1515
* Redirects to new URI.
1616
*/
17-
class RedirectResponse extends Nette\Object implements Nette\Application\IResponse
17+
class RedirectResponse implements Nette\Application\IResponse
1818
{
19+
use Nette\SmartObject;
20+
1921
/** @var string */
2022
private $url;
2123

src/Application/Responses/TextResponse.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
/**
1414
* String output response.
1515
*/
16-
class TextResponse extends Nette\Object implements Nette\Application\IResponse
16+
class TextResponse implements Nette\Application\IResponse
1717
{
18+
use Nette\SmartObject;
19+
1820
/** @var mixed */
1921
private $source;
2022

src/Application/Routers/CliRouter.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/**
1515
* The unidirectional router for CLI. (experimental)
1616
*/
17-
class CliRouter extends Nette\Object implements Application\IRouter
17+
class CliRouter implements Application\IRouter
1818
{
19+
use Nette\SmartObject;
20+
1921
const PRESENTER_KEY = 'action';
2022

2123
/** @var array */

src/Application/Routers/Route.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
* The bidirectional route is responsible for mapping
1717
* HTTP request to a Request object for dispatch and vice-versa.
1818
*/
19-
class Route extends Nette\Object implements Application\IRouter
19+
class Route implements Application\IRouter
2020
{
21+
use Nette\SmartObject;
22+
2123
const PRESENTER_KEY = 'presenter';
2224
const MODULE_KEY = 'module';
2325

src/Application/Routers/SimpleRouter.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/**
1515
* The bidirectional route for trivial routing via query parameters.
1616
*/
17-
class SimpleRouter extends Nette\Object implements Application\IRouter
17+
class SimpleRouter implements Application\IRouter
1818
{
19+
use Nette\SmartObject;
20+
1921
const PRESENTER_KEY = 'presenter';
2022
const MODULE_KEY = 'module';
2123

src/Application/UI/Link.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
* Lazy encapsulation of PresenterComponent::link().
1515
* Do not instantiate directly, use PresenterComponent::lazyLink()
1616
*/
17-
class Link extends Nette\Object
17+
class Link
1818
{
19+
use Nette\SmartObject;
20+
1921
/** @var PresenterComponent */
2022
private $component;
2123

src/Bridges/ApplicationLatte/Template.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/**
1515
* Latte powered template.
1616
*/
17-
class Template extends Nette\Object implements Nette\Application\UI\ITemplate
17+
class Template implements Nette\Application\UI\ITemplate
1818
{
19+
use Nette\SmartObject;
20+
1921
/** @var Latte\Engine */
2022
private $latte;
2123

src/Bridges/ApplicationLatte/TemplateFactory.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
/**
1515
* Latte powered template factory.
1616
*/
17-
class TemplateFactory extends Nette\Object implements UI\ITemplateFactory
17+
class TemplateFactory implements UI\ITemplateFactory
1818
{
19+
use Nette\SmartObject;
20+
1921
/** @var ILatteFactory */
2022
private $latteFactory;
2123

src/Bridges/ApplicationLatte/UIRuntime.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
* Runtime helpers for UI macros.
1616
* @internal
1717
*/
18-
class UIRuntime extends Nette\Object
18+
class UIRuntime
1919
{
20+
use Nette\StaticClass;
2021

2122
public static function renderSnippets(UI\Control $control, \stdClass $local = NULL, array $params = [])
2223
{

src/Bridges/ApplicationTracy/RoutingPanel.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
/**
1818
* Routing debugger for Debug Bar.
1919
*/
20-
class RoutingPanel extends Nette\Object implements Tracy\IBarPanel
20+
class RoutingPanel implements Tracy\IBarPanel
2121
{
22+
use Nette\SmartObject;
23+
2224
/** @var Nette\Application\IRouter */
2325
private $router;
2426

tests/Application/MicroPresenter.invoke.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use Tester\Assert;
1111
require __DIR__ . '/../bootstrap.php';
1212

1313

14-
class Invokable extends Nette\Object
14+
class Invokable
1515
{
1616
public function __invoke($page, $id, NetteModule\MicroPresenter $presenter)
1717
{

tests/Bridges.Latte/UIMacros.control.2.phpt

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
* Test: {control ...}
55
*/
66

7-
use Nette\Object;
87
use Nette\Bridges\ApplicationLatte\UIMacros;
98
use Tester\Assert;
109

1110

1211
require __DIR__ . '/../bootstrap.php';
1312

1413

15-
class MockComponent extends Object
14+
class MockComponent
1615
{
1716
function getComponent($name)
1817
{
@@ -24,7 +23,7 @@ class MockComponent extends Object
2423
}
2524

2625

27-
class MockControl extends Object
26+
class MockControl
2827
{
2928

3029
function __call($name, $args)

tests/UI/MockPresenterFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
class MockPresenterFactory extends Nette\Object implements Nette\Application\IPresenterFactory
3+
class MockPresenterFactory implements Nette\Application\IPresenterFactory
44
{
55
function getPresenterClass(& $name)
66
{

tests/UI/Presenter.storeRequest().phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MockSession extends Http\Session
3131
}
3232
}
3333

34-
class MockSessionSection extends Nette\Object implements \ArrayAccess
34+
class MockSessionSection implements \ArrayAccess
3535
{
3636
public $testedKeyExistence;
3737
public $storedKey;

0 commit comments

Comments
 (0)