Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit 976a284

Browse files
committed
used PHP 5.4 syntax
1 parent 858dddd commit 976a284

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

app/forms/SignFormFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function create()
3535

3636
$form->addSubmit('send', 'Sign in');
3737

38-
$form->onSuccess[] = array($this, 'formSucceeded');
38+
$form->onSuccess[] = [$this, 'formSucceeded'];
3939
return $form;
4040
}
4141

app/model/UserManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function authenticate(array $credentials)
4848
throw new Nette\Security\AuthenticationException('The password is incorrect.', self::INVALID_CREDENTIAL);
4949

5050
} elseif (Passwords::needsRehash($row[self::COLUMN_PASSWORD_HASH])) {
51-
$row->update(array(
51+
$row->update([
5252
self::COLUMN_PASSWORD_HASH => Passwords::hash($password),
53-
));
53+
]);
5454
}
5555

5656
$arr = $row->toArray();
@@ -68,10 +68,10 @@ public function authenticate(array $credentials)
6868
public function add($username, $password)
6969
{
7070
try {
71-
$this->database->table(self::TABLE_NAME)->insert(array(
71+
$this->database->table(self::TABLE_NAME)->insert([
7272
self::COLUMN_NAME => $username,
7373
self::COLUMN_PASSWORD_HASH => Passwords::hash($password),
74-
));
74+
]);
7575
} catch (Nette\Database\UniqueConstraintViolationException $e) {
7676
throw new DuplicateNameException;
7777
}

app/presenters/ErrorPresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function renderDefault($exception)
3131
if ($exception instanceof Nette\Application\BadRequestException) {
3232
$code = $exception->getCode();
3333
// load template 403.latte or 404.latte or ... 4xx.latte
34-
$this->setView(in_array($code, array(403, 404, 405, 410, 500)) ? $code : '4xx');
34+
$this->setView(in_array($code, [403, 404, 405, 410, 500]) ? $code : '4xx');
3535
// log to access.log
3636
$this->logger->log("HTTP code $code: {$exception->getMessage()} in {$exception->getFile()}:{$exception->getLine()}", 'access');
3737

app/presenters/SignPresenter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class SignPresenter extends BasePresenter
2222
protected function createComponentSignInForm()
2323
{
2424
$form = $this->factory->create();
25-
$form->onSuccess[] = function ($form) {
26-
$form->getPresenter()->redirect('Homepage:');
25+
$form->onSuccess[] = function () {
26+
$this->redirect('Homepage:');
2727
};
2828
return $form;
2929
}

www/adminer/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !isset($_SERVER['REMOTE_ADDR']) ||
4-
!in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
4+
!in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']))
55
{
66
header('HTTP/1.1 403 Forbidden');
77
echo 'Adminer is available only from localhost';

0 commit comments

Comments
 (0)