Skip to content

Commit

Permalink
uses Nette\SmartObject & StrictClass
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 11, 2016
1 parent c3a9a20 commit 51568f8
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"require": {
"php": ">=5.6.0",
"nette/utils": "^2.2.2"
"nette/utils": "^2.4"
},
"require-dev": {
"nette/di": "^2.3",
Expand Down
3 changes: 2 additions & 1 deletion src/Bridges/HttpTracy/SessionPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
/**
* Session panel for Debugger Bar.
*/
class SessionPanel extends Nette\Object implements Tracy\IBarPanel
class SessionPanel implements Tracy\IBarPanel
{
use Nette\SmartObject;

/**
* Renders tab.
Expand Down
4 changes: 3 additions & 1 deletion src/Http/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* HTTP-specific tasks.
*/
class Context extends Nette\Object
class Context
{
use Nette\SmartObject;

/** @var IRequest */
private $request;

Expand Down
4 changes: 3 additions & 1 deletion src/Http/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
* @property-read bool $ok
* @property-read string|NULL $contents
*/
class FileUpload extends Nette\Object
class FileUpload
{
use Nette\SmartObject;

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

Expand Down
1 change: 1 addition & 0 deletions src/Http/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
class Helpers
{
use Nette\StaticClass;

/**
* Returns HTTP valid date format.
Expand Down
4 changes: 3 additions & 1 deletion src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
* @property-read string|NULL $remoteHost
* @property-read string|NULL $rawBody
*/
class Request extends Nette\Object implements IRequest
class Request implements IRequest
{
use Nette\SmartObject;

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

Expand Down
4 changes: 3 additions & 1 deletion src/Http/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* Current HTTP request factory.
*/
class RequestFactory extends Nette\Object
class RequestFactory
{
use Nette\SmartObject;

/** @internal */
const CHARS = '\x09\x0A\x0D\x20-\x7E\xA0-\x{10FFFF}';

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

/** @var bool Send invisible garbage for IE 6? */
private static $fixIE = TRUE;

Expand Down
4 changes: 3 additions & 1 deletion src/Http/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Provides access to session sections as well as session settings and management methods.
*/
class Session extends Nette\Object
class Session
{
use Nette\SmartObject;

/** Default file lifetime */
const DEFAULT_FILE_LIFETIME = 3 * Nette\Utils\DateTime::HOUR;

Expand Down
4 changes: 3 additions & 1 deletion src/Http/SessionSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
/**
* Session section.
*/
class SessionSection extends Nette\Object implements \IteratorAggregate, \ArrayAccess
class SessionSection implements \IteratorAggregate, \ArrayAccess
{
use Nette\SmartObject;

/** @var Session */
private $session;

Expand Down
4 changes: 3 additions & 1 deletion src/Http/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
* @property-read string $relativeUrl
* @property-read array $queryParameters
*/
class Url extends Nette\Object implements \JsonSerializable
class Url implements \JsonSerializable
{
use Nette\SmartObject;

/** @var array */
public static $defaultPorts = [
'http' => 80,
Expand Down
4 changes: 3 additions & 1 deletion src/Http/UserStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/**
* Session storage for user object.
*/
class UserStorage extends Nette\Object implements Nette\Security\IUserStorage
class UserStorage implements Nette\Security\IUserStorage
{
use Nette\SmartObject;

/** @var string */
private $namespace = '';

Expand Down
3 changes: 1 addition & 2 deletions tests/Http/Session.handler.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
* Test: Nette\Http\Session storage.
*/

use Nette\Object;
use Nette\Http\Session;
use Tester\Assert;


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


class MySessionStorage extends Object implements SessionHandlerInterface
class MySessionStorage implements SessionHandlerInterface
{
private $path;

Expand Down
3 changes: 1 addition & 2 deletions tests/Http/Session.storage.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Test: Nette\Http\Session storage.
*/

use Nette\Object;
use Nette\Http\ISessionStorage;
use Nette\Http\Session;
use Tester\Assert;
Expand All @@ -13,7 +12,7 @@ use Tester\Assert;
require __DIR__ . '/../bootstrap.php';


class MySessionStorage extends Object implements ISessionStorage
class MySessionStorage implements ISessionStorage
{
private $path;

Expand Down

0 comments on commit 51568f8

Please sign in to comment.