Permalink
Browse files

coding style: fixes in code

  • Loading branch information...
dg committed Jul 11, 2017
1 parent 956741a commit 82ffc4956e9d8cf202b7de1354114c55f9eeddd4
@@ -39,7 +39,7 @@ public function __construct(Nette\Database\Context $database)
*/
public function authenticate(array $credentials): Nette\Security\IIdentity
{
list($username, $password) = $credentials;
[$username, $password] = $credentials;
$row = $this->database->table(self::TABLE_NAME)->where(self::COLUMN_NAME, $username)->fetch();
@@ -31,7 +31,7 @@ public function run(Nette\Application\Request $request): Nette\Application\IResp
if ($e instanceof Nette\Application\BadRequestException) {
// $this->logger->log("HTTP code {$e->getCode()}: {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", 'access');
list($module, , $sep) = Nette\Application\Helpers::splitName($request->getPresenterName());
[$module, , $sep] = Nette\Application\Helpers::splitName($request->getPresenterName());
return new Responses\ForwardResponse($request->setPresenterName($module . $sep . 'Error4xx'));
}
@@ -10,7 +10,7 @@
exit(1);
}
list(, $name, $email, $password) = $_SERVER['argv'];
[, $name, $email, $password] = $_SERVER['argv'];
$container = require __DIR__ . '/../app/bootstrap.php';
/** @var App\Model\UserManager $manager */
@@ -16,18 +16,18 @@ class ExampleTest extends Tester\TestCase
private $container;
function __construct(Nette\DI\Container $container)
public function __construct(Nette\DI\Container $container)
{
$this->container = $container;
}
function setUp()
public function setUp()
{
}
function testSomething()
public function testSomething()
{
Assert::true(true);
}
@@ -3,11 +3,12 @@
declare(strict_types=1);
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !isset($_SERVER['REMOTE_ADDR']) ||
!in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']))
{
!in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true)) {
header('HTTP/1.1 403 Forbidden');
echo 'Adminer is available only from localhost';
for ($i = 2e3; $i; $i--) echo substr(" \t\r\n", rand(0, 3), 1);
for ($i = 2e3; $i; $i--) {
echo substr(" \t\r\n", rand(0, 3), 1);
}
exit;
}
@@ -7,11 +7,12 @@
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !isset($_SERVER['REMOTE_ADDR']) ||
!in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']))
{
!in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true)) {
header('HTTP/1.1 403 Forbidden');
echo 'Requirements Checker is available only from localhost';
for ($i = 2e3; $i; $i--) echo substr(" \t\r\n", rand(0, 3), 1);
for ($i = 2e3; $i; $i--) {
echo substr(" \t\r\n", rand(0, 3), 1);
}
exit;
}
@@ -290,8 +291,7 @@ function iniFlag($var)
*/
$errors = $warnings = false;
foreach ($tests as $id => $requirement)
{
foreach ($tests as $id => $requirement) {
$tests[$id] = $requirement = (object) $requirement;
if (isset($requirement->passed) && !$requirement->passed) {
if ($requirement->required) {
@@ -488,12 +488,12 @@ function iniFlag($var)
<?php foreach ($tests as $id => $requirement):?>
<?php $class = isset($requirement->passed) ? ($requirement->passed ? 'passed' : ($requirement->required ? 'failed' : 'warning')) : 'info' ?>
<tr id="res<?php echo $id ?>" class="<?php echo $class ?>">
<th><?php echo htmlSpecialChars($requirement->title) ?></th>
<th><?php echo htmlspecialchars($requirement->title) ?></th>

<?php if (empty($requirement->passed) && isset($requirement->errorMessage)): ?>
<td><?php echo htmlSpecialChars($requirement->errorMessage) ?></td>
<td><?php echo htmlspecialchars($requirement->errorMessage) ?></td>
<?php elseif (isset($requirement->message)): ?>
<td><?php echo htmlSpecialChars($requirement->message) ?></td>
<td><?php echo htmlspecialchars($requirement->message) ?></td>
<?php elseif (isset($requirement->passed)): ?>
<td><?php echo $requirement->passed ? 'Enabled' : 'Disabled' ?></td>
<?php else: ?>

0 comments on commit 82ffc49

Please sign in to comment.