Skip to content

Commit 50e4e8d

Browse files
committed
PHP 5.4 syntax
1 parent 3b92a5f commit 50e4e8d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/Bridges/ApplicationLatte/Template.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ public function registerHelper($name, $callback)
102102
public function registerHelperLoader($loader)
103103
{
104104
trigger_error(__METHOD__ . '() is deprecated, use dynamic getLatte()->addFilter().', E_USER_DEPRECATED);
105-
$latte = $this->latte;
106-
$this->latte->addFilter(NULL, function ($name) use ($loader, $latte) {
105+
$this->latte->addFilter(NULL, function ($name) use ($loader) {
107106
if ($callback = call_user_func($loader, $name)) {
108-
$latte->addFilter($name, $callback);
107+
$this->latte->addFilter($name, $callback);
109108
}
110109
});
111110
return $this;

tests/Application/Presenter.link().phpt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,14 @@ class TestPresenter extends Application\UI\Presenter
144144

145145
// warning invalid link mode
146146
$this->invalidLinkMode = self::INVALID_LINK_WARNING;
147-
$me = $this;
148-
Assert::error(function () use ($me) {
149-
Assert::same('#', $me->link('product', ['var1' => NULL, 'ok' => 'a']));
147+
Assert::error(function () {
148+
Assert::same('#', $this->link('product', ['var1' => NULL, 'ok' => 'a']));
150149
}, E_USER_WARNING, "Invalid link: Invalid value for persistent parameter 'ok' in 'Test', expected boolean.");
151150

152151
// exception invalid link mode
153152
$this->invalidLinkMode = self::INVALID_LINK_EXCEPTION;
154-
Assert::exception(function () use ($me) {
155-
$me->link('product', ['var1' => NULL, 'ok' => 'a']);
153+
Assert::exception(function () {
154+
$this->link('product', ['var1' => NULL, 'ok' => 'a']);
156155
}, Nette\Application\UI\InvalidLinkException::class, "Invalid value for persistent parameter 'ok' in 'Test', expected boolean.");
157156
}
158157

0 commit comments

Comments
 (0)