Skip to content

Commit 147e265

Browse files
committed
removed deprecated stuff
1 parent 8f5453b commit 147e265

File tree

14 files changed

+3
-224
lines changed

14 files changed

+3
-224
lines changed

src/Application/IRouter.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ interface IRouter
2020
/** only matching route */
2121
const ONE_WAY = 0b0001;
2222

23-
/** @deprecated */
24-
const SECURED = 0b0010;
25-
2623
/**
2724
* Maps HTTP request to a Request object.
2825
* @return Request|NULL

src/Application/Routers/Route.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ class Route implements Application\IRouter
4343
PATH_OPTIONAL = 1,
4444
CONSTANT = 2;
4545

46-
/** @deprecated */
47-
public static $defaultFlags = 0;
48-
4946
/** @var array */
5047
public static $styles = [
5148
'#' => [ // default style for path parameters
@@ -127,24 +124,15 @@ public function __construct($mask, $metadata = [], $flags = 0)
127124
if ($action !== '') {
128125
$metadata['action'] = $action;
129126
}
130-
} elseif ($metadata instanceof \Closure || $metadata instanceof Nette\Callback) {
131-
if ($metadata instanceof Nette\Callback) {
132-
trigger_error('Nette\Callback is deprecated, use Nette\Utils\Callback::closure().', E_USER_DEPRECATED);
133-
}
127+
} elseif ($metadata instanceof \Closure) {
134128
$metadata = [
135129
self::PRESENTER_KEY => 'Nette:Micro',
136130
'callback' => $metadata,
137131
];
138132
}
139133

140-
$this->flags = $flags | static::$defaultFlags;
134+
$this->flags = $flags;
141135
$this->setMask($mask, $metadata);
142-
if (static::$defaultFlags) {
143-
trigger_error('Route::$defaultFlags is deprecated, router by default keeps the used protocol.', E_USER_DEPRECATED);
144-
} elseif ($flags & self::SECURED) {
145-
trigger_error('Router::SECURED is deprecated, specify scheme in mask.', E_USER_DEPRECATED);
146-
$this->scheme = 'https';
147-
}
148136
}
149137

150138

src/Application/Routers/SimpleRouter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ public function __construct($defaults = [], $flags = 0)
5757

5858
$this->defaults = $defaults;
5959
$this->flags = $flags;
60-
if ($flags & self::SECURED) {
61-
trigger_error('IRouter::SECURED is deprecated, router by default keeps the used protocol.', E_USER_DEPRECATED);
62-
}
6360
}
6461

6562

@@ -120,7 +117,7 @@ public function constructUrl(Application\Request $appRequest, Nette\Http\Url $re
120117
}
121118
}
122119

123-
$url = ($this->flags & self::SECURED ? 'https://' : $refUrl->getScheme() . '://') . $refUrl->getAuthority() . $refUrl->getPath();
120+
$url = $refUrl->getScheme() . '://' . $refUrl->getAuthority() . $refUrl->getPath();
124121
$sep = ini_get('arg_separator.input');
125122
$query = http_build_query($params, '', $sep ? $sep[0] : '&');
126123
if ($query != '') { // intentionally ==

src/Application/UI/ComponentReflection.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@ public static function getParameterType(\ReflectionParameter $param)
223223
}
224224

225225

226-
/********************* compatiblity with Nette\Reflection ****************d*g**/
227-
228-
229226
/**
230227
* Has class specified annotation?
231228
* @param string
@@ -263,28 +260,4 @@ public function getMethods($filter = -1)
263260
return $res;
264261
}
265262

266-
267-
public function __toString()
268-
{
269-
trigger_error(__METHOD__ . ' is deprecated.', E_USER_DEPRECATED);
270-
return $this->getName();
271-
}
272-
273-
274-
public function __get($name)
275-
{
276-
trigger_error("getReflection()->$name is deprecated.", E_USER_DEPRECATED);
277-
return (new ClassType($this->getName()))->$name;
278-
}
279-
280-
281-
public function __call($name, $args)
282-
{
283-
if (method_exists(ClassType::class, $name)) {
284-
trigger_error("getReflection()->$name() is deprecated, use Nette\\Reflection\\ClassType::from(\$presenter)->$name()", E_USER_DEPRECATED);
285-
return call_user_func_array([new ClassType($this->getName()), $name], $args);
286-
}
287-
Nette\Utils\ObjectMixin::strictCall(get_class($this), $name);
288-
}
289-
290263
}

src/Application/UI/Control.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,6 @@ public function redrawControl($snippet = NULL, $redraw = TRUE)
119119
}
120120

121121

122-
/** @deprecated */
123-
function invalidateControl($snippet = NULL)
124-
{
125-
trigger_error(__METHOD__ . '() is deprecated; use $this->redrawControl($snippet) instead.', E_USER_DEPRECATED);
126-
$this->redrawControl($snippet);
127-
}
128-
129-
/** @deprecated */
130-
function validateControl($snippet = NULL)
131-
{
132-
trigger_error(__METHOD__ . '() is deprecated; use $this->redrawControl($snippet, FALSE) instead.', E_USER_DEPRECATED);
133-
$this->redrawControl($snippet, FALSE);
134-
}
135-
136-
137122
/**
138123
* Is required to repaint the control or its snippet?
139124
* @param string snippet name

src/Application/UI/MethodReflection.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,4 @@ public function getAnnotation($name)
4242
return $res ? end($res) : NULL;
4343
}
4444

45-
46-
public function __toString()
47-
{
48-
trigger_error(__METHOD__ . ' is deprecated.', E_USER_DEPRECATED);
49-
return parent::getDeclaringClass()->getName() . '::' . $this->getName() . '()';
50-
}
51-
52-
53-
public function __get($name)
54-
{
55-
trigger_error("getMethod('{$this->getName()}')->$name is deprecated.", E_USER_DEPRECATED);
56-
return (new Method(parent::getDeclaringClass()->getName(), $this->getName()))->$name;
57-
}
58-
59-
60-
public function __call($name, $args)
61-
{
62-
trigger_error("getMethod('{$this->getName()}')->$name() is deprecated, use Nette\\Reflection\\Method::from(\$presenter, '{$this->getName()}')->$name()", E_USER_DEPRECATED);
63-
return call_user_func_array([new Method(parent::getDeclaringClass()->getName(), $this->getName()), $name], $args);
64-
}
65-
6645
}

src/Application/UI/Presenter.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ public function run(Application\Request $request)
233233
$this->snippetMode = TRUE;
234234
$this->response->send($this->httpRequest, $this->httpResponse);
235235
$this->sendPayload();
236-
} elseif (!$this->response && $hasPayload) { // back compatibility for use terminate() instead of sendPayload()
237-
trigger_error('Use $presenter->sendPayload() instead of terminate() to send payload.');
238-
$this->sendPayload();
239236
}
240237
} catch (Application\AbortException $e) {
241238
}
@@ -694,18 +691,6 @@ public function error($message = NULL, $code = Http\IResponse::S404_NOT_FOUND)
694691
}
695692

696693

697-
/**
698-
* Link to myself.
699-
* @return string
700-
* @deprecated
701-
*/
702-
public function backlink()
703-
{
704-
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
705-
return $this->getAction(TRUE);
706-
}
707-
708-
709694
/**
710695
* Returns the last created Request.
711696
* @return Nette\Application\Request

src/Bridges/ApplicationLatte/Template.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,6 @@ public function addFilter($name, $callback)
8989
}
9090

9191

92-
/**
93-
* Alias for addFilter()
94-
* @deprecated
95-
*/
96-
public function registerHelper($name, $callback)
97-
{
98-
trigger_error(__METHOD__ . '() is deprecated, use getLatte()->addFilter().', E_USER_DEPRECATED);
99-
return $this->latte->addFilter($name, $callback);
100-
}
101-
102-
10392
/**
10493
* Sets translate adapter.
10594
* @return static
@@ -173,16 +162,6 @@ public function getParameters()
173162
}
174163

175164

176-
/**
177-
* @deprecated
178-
*/
179-
public function __call($name, $args)
180-
{
181-
trigger_error('Invoking filters on Template object is deprecated, use getLatte()->invokeFilter().', E_USER_DEPRECATED);
182-
return $this->latte->invokeFilter($name, $args);
183-
}
184-
185-
186165
/**
187166
* Sets a template parameter. Do not call directly.
188167
* @return void

src/Bridges/ApplicationLatte/TemplateFactory.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ public function createTemplate(UI\Control $control = NULL)
110110
}
111111
$latte->addProvider('cacheStorage', $this->cacheStorage);
112112

113-
// back compatibility
114-
$template->_control = $control;
115-
$template->_presenter = $presenter;
116-
$template->netteCacheStorage = $this->cacheStorage;
117-
118113
if ($presenter instanceof UI\Presenter && $presenter->hasFlashSession()) {
119114
$id = $control->getParameterId('flash');
120115
$template->flashes = (array) $presenter->getFlashSession()->$id;

src/Bridges/ApplicationLatte/UIMacros.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,4 @@ public function macroExtends(MacroNode $node, PhpWriter $writer)
150150
$this->extends = $writer->write('$this->parentName = $this->global->uiPresenter->findLayoutTemplateFile();');
151151
}
152152

153-
154-
/** @deprecated */
155-
public static function renderSnippets(Nette\Application\UI\Control $control, \stdClass $local, array $params)
156-
{
157-
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
158-
UIRuntime::renderSnippets($control, $local, $params);
159-
}
160-
161153
}

0 commit comments

Comments
 (0)