Skip to content

Commit

Permalink
uses Nette\SmartObject
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 11, 2016
1 parent 209e227 commit 52d68c0
Show file tree
Hide file tree
Showing 25 changed files with 66 additions and 28 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
],
"require": {
"php": ">=5.6.0",
"nette/component-model": "~2.2",
"nette/component-model": "~2.3",
"nette/http": "~2.2",
"nette/reflection": "~2.2",
"nette/security": "~2.2",
"nette/utils": "~2.2"
"nette/utils": "~2.4"
},
"suggest": {
"nette/forms": "Allows to use Nette\\Application\\UI\\Form",
Expand Down
4 changes: 3 additions & 1 deletion src/Application/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Front Controller.
*/
class Application extends Nette\Object
class Application
{
use Nette\SmartObject;

/** @var int */
public static $maxLoop = 20;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/ErrorPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
/**
* Default Error Presenter.
*/
class ErrorPresenter extends Nette\Object implements Application\IPresenter
class ErrorPresenter implements Application\IPresenter
{
use Nette\SmartObject;

/** @var ILogger|NULL */
private $logger;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/LinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Link generator.
*/
class LinkGenerator extends Nette\Object
class LinkGenerator
{
use Nette\SmartObject;

/** @var IRouter */
private $router;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/MicroPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
/**
* Micro presenter.
*/
class MicroPresenter extends Nette\Object implements Application\IPresenter
class MicroPresenter implements Application\IPresenter
{
use Nette\SmartObject;

/** @var Nette\DI\Container|NULL */
private $context;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/PresenterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Default presenter loader.
*/
class PresenterFactory extends Nette\Object implements IPresenterFactory
class PresenterFactory implements IPresenterFactory
{
use Nette\SmartObject;

/** @var array[] of module => splited mask */
private $mapping = [
'*' => ['', '*Module\\', '*Presenter'],
Expand Down
4 changes: 3 additions & 1 deletion src/Application/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
* @property array $files
* @property string|NULL $method
*/
class Request extends Nette\Object
class Request
{
use Nette\SmartObject;

/** method */
const FORWARD = 'FORWARD';

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Responses/CallbackResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Callback response.
*/
class CallbackResponse extends Nette\Object implements Nette\Application\IResponse
class CallbackResponse implements Nette\Application\IResponse
{
use Nette\SmartObject;

/** @var callable */
private $callback;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Responses/FileResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* File download response.
*/
class FileResponse extends Nette\Object implements Nette\Application\IResponse
class FileResponse implements Nette\Application\IResponse
{
use Nette\SmartObject;

/** @var string */
private $file;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Responses/ForwardResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Forwards to new request.
*/
class ForwardResponse extends Nette\Object implements Nette\Application\IResponse
class ForwardResponse implements Nette\Application\IResponse
{
use Nette\SmartObject;

/** @var Nette\Application\Request */
private $request;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Responses/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* JSON response used mainly for AJAX requests.
*/
class JsonResponse extends Nette\Object implements Nette\Application\IResponse
class JsonResponse implements Nette\Application\IResponse
{
use Nette\SmartObject;

/** @var array|\stdClass */
private $payload;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Responses/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* Redirects to new URI.
*/
class RedirectResponse extends Nette\Object implements Nette\Application\IResponse
class RedirectResponse implements Nette\Application\IResponse
{
use Nette\SmartObject;

/** @var string */
private $url;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Responses/TextResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* String output response.
*/
class TextResponse extends Nette\Object implements Nette\Application\IResponse
class TextResponse implements Nette\Application\IResponse
{
use Nette\SmartObject;

/** @var mixed */
private $source;

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Routers/CliRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* The unidirectional router for CLI. (experimental)
*/
class CliRouter extends Nette\Object implements Application\IRouter
class CliRouter implements Application\IRouter
{
use Nette\SmartObject;

const PRESENTER_KEY = 'action';

/** @var array */
Expand Down
4 changes: 3 additions & 1 deletion src/Application/Routers/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
* The bidirectional route is responsible for mapping
* HTTP request to a Request object for dispatch and vice-versa.
*/
class Route extends Nette\Object implements Application\IRouter
class Route implements Application\IRouter
{
use Nette\SmartObject;

const PRESENTER_KEY = 'presenter';
const MODULE_KEY = 'module';

Expand Down
4 changes: 3 additions & 1 deletion src/Application/Routers/SimpleRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* The bidirectional route for trivial routing via query parameters.
*/
class SimpleRouter extends Nette\Object implements Application\IRouter
class SimpleRouter implements Application\IRouter
{
use Nette\SmartObject;

const PRESENTER_KEY = 'presenter';
const MODULE_KEY = 'module';

Expand Down
4 changes: 3 additions & 1 deletion src/Application/UI/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* Lazy encapsulation of PresenterComponent::link().
* Do not instantiate directly, use PresenterComponent::lazyLink()
*/
class Link extends Nette\Object
class Link
{
use Nette\SmartObject;

/** @var PresenterComponent */
private $component;

Expand Down
4 changes: 3 additions & 1 deletion src/Bridges/ApplicationLatte/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* Latte powered template.
*/
class Template extends Nette\Object implements Nette\Application\UI\ITemplate
class Template implements Nette\Application\UI\ITemplate
{
use Nette\SmartObject;

/** @var Latte\Engine */
private $latte;

Expand Down
4 changes: 3 additions & 1 deletion src/Bridges/ApplicationLatte/TemplateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* Latte powered template factory.
*/
class TemplateFactory extends Nette\Object implements UI\ITemplateFactory
class TemplateFactory implements UI\ITemplateFactory
{
use Nette\SmartObject;

/** @var ILatteFactory */
private $latteFactory;

Expand Down
3 changes: 2 additions & 1 deletion src/Bridges/ApplicationLatte/UIRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* Runtime helpers for UI macros.
* @internal
*/
class UIRuntime extends Nette\Object
class UIRuntime
{
use Nette\StaticClass;

public static function renderSnippets(UI\Control $control, \stdClass $local = NULL, array $params = [])
{
Expand Down
4 changes: 3 additions & 1 deletion src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
/**
* Routing debugger for Debug Bar.
*/
class RoutingPanel extends Nette\Object implements Tracy\IBarPanel
class RoutingPanel implements Tracy\IBarPanel
{
use Nette\SmartObject;

/** @var Nette\Application\IRouter */
private $router;

Expand Down
2 changes: 1 addition & 1 deletion tests/Application/MicroPresenter.invoke.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Tester\Assert;
require __DIR__ . '/../bootstrap.php';


class Invokable extends Nette\Object
class Invokable
{
public function __invoke($page, $id, NetteModule\MicroPresenter $presenter)
{
Expand Down
5 changes: 2 additions & 3 deletions tests/Bridges.Latte/UIMacros.control.2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
* Test: {control ...}
*/

use Nette\Object;
use Nette\Bridges\ApplicationLatte\UIMacros;
use Tester\Assert;


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


class MockComponent extends Object
class MockComponent
{
function getComponent($name)
{
Expand All @@ -24,7 +23,7 @@ class MockComponent extends Object
}


class MockControl extends Object
class MockControl
{

function __call($name, $args)
Expand Down
2 changes: 1 addition & 1 deletion tests/UI/MockPresenterFactory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class MockPresenterFactory extends Nette\Object implements Nette\Application\IPresenterFactory
class MockPresenterFactory implements Nette\Application\IPresenterFactory
{
function getPresenterClass(& $name)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/UI/Presenter.storeRequest().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MockSession extends Http\Session
}
}

class MockSessionSection extends Nette\Object implements \ArrayAccess
class MockSessionSection implements \ArrayAccess
{
public $testedKeyExistence;
public $storedKey;
Expand Down

0 comments on commit 52d68c0

Please sign in to comment.