Skip to content

Commit 78a872a

Browse files
committed
improved coding style
1 parent d3e44f5 commit 78a872a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+380
-379
lines changed

src/Bridges/HttpDI/SessionExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function loadConfiguration()
4848

4949
if ($this->debugMode && $config['debugger']) {
5050
$session->addSetup('@Tracy\Bar::addPanel', [
51-
new Nette\DI\Statement('Nette\Bridges\HttpTracy\SessionPanel')
51+
new Nette\DI\Statement('Nette\Bridges\HttpTracy\SessionPanel'),
5252
]);
5353
}
5454

src/Http/IResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface IResponse
4141
S303_POST_GET = 303,
4242
S304_NOT_MODIFIED = 304,
4343
S305_USE_PROXY = 305,
44-
S307_TEMPORARY_REDIRECT= 307,
44+
S307_TEMPORARY_REDIRECT = 307,
4545
S400_BAD_REQUEST = 400,
4646
S401_UNAUTHORIZED = 401,
4747
S402_PAYMENT_REQUIRED = 402,

src/Http/Request.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ public function detectLanguage(array $langs)
319319
foreach ($matches[1] as $key => $value) {
320320
$q = $matches[2][$key] === '' ? 1.0 : (float) $matches[2][$key];
321321
if ($q > $max) {
322-
$max = $q; $lang = $value;
322+
$max = $q;
323+
$lang = $value;
323324
}
324325
}
325326

src/Http/RequestFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function createHttpRequest()
213213
}
214214

215215
// raw body
216-
$rawBodyCallback = function() {
216+
$rawBodyCallback = function () {
217217
static $rawBody;
218218

219219
if (PHP_VERSION_ID >= 50600) {

src/Http/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ private function checkHeaders()
291291
if (headers_sent($file, $line)) {
292292
throw new Nette\InvalidStateException('Cannot send header after HTTP headers have been sent' . ($file ? " (output started at $file:$line)." : '.'));
293293

294-
} elseif ($this->warnOnBuffer && ob_get_length() && !array_filter(ob_get_status(TRUE), function($i) { return !$i['chunk_size']; })) {
294+
} elseif ($this->warnOnBuffer && ob_get_length() && !array_filter(ob_get_status(TRUE), function ($i) { return !$i['chunk_size']; })) {
295295
trigger_error('Possible problem: you are sending a HTTP header while already having some data in output buffer. Try Tracy\OutputDebugger or start session earlier.', E_USER_NOTICE);
296296
}
297297
}

src/Http/Session.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function regenerateId()
224224
{
225225
if (self::$started && !$this->regenerated) {
226226
if (headers_sent($file, $line)) {
227-
throw new Nette\InvalidStateException("Cannot regenerate session ID after HTTP headers have been sent" . ($file ? " (output started at $file:$line)." : "."));
227+
throw new Nette\InvalidStateException('Cannot regenerate session ID after HTTP headers have been sent' . ($file ? " (output started at $file:$line)." : '.'));
228228
}
229229
session_regenerate_id(TRUE);
230230
session_write_close();
@@ -413,7 +413,7 @@ private function configure(array $config)
413413

414414
} else {
415415
if (defined('SID')) {
416-
throw new Nette\InvalidStateException("Unable to set 'session.$key' to value '$value' when session has been started" . ($this->started ? "." : " by session.auto_start or session_start()."));
416+
throw new Nette\InvalidStateException("Unable to set 'session.$key' to value '$value' when session has been started" . ($this->started ? '.' : ' by session.auto_start or session_start().'));
417417
}
418418
if (isset($special[$key])) {
419419
$key = "session_$key";
@@ -479,7 +479,7 @@ public function setCookieParameters($path, $domain = NULL, $secure = NULL)
479479
return $this->setOptions([
480480
'cookie_path' => $path,
481481
'cookie_domain' => $domain,
482-
'cookie_secure' => $secure
482+
'cookie_secure' => $secure,
483483
]);
484484
}
485485

src/Http/SessionSection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class SessionSection extends Nette\Object implements \IteratorAggregate, \ArrayA
3939
public function __construct(Session $session, $name)
4040
{
4141
if (!is_string($name)) {
42-
throw new Nette\InvalidArgumentException("Session namespace must be a string, " . gettype($name) . " given.");
42+
throw new Nette\InvalidArgumentException('Session namespace must be a string, ' . gettype($name) . ' given.');
4343
}
4444

4545
$this->session = $session;

src/Http/Url.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public function canonicalize()
443443
{
444444
$this->path = preg_replace_callback(
445445
'#[^!$&\'()*+,/:;=@%]+#',
446-
function($m) { return rawurlencode($m[0]); },
446+
function ($m) { return rawurlencode($m[0]); },
447447
self::unescape($this->path, '%/')
448448
);
449449
$this->host = strtolower($this->host);
@@ -474,7 +474,7 @@ public static function unescape($s, $reserved = '%;/?:@&=+$,')
474474
if ($reserved !== '') {
475475
$s = preg_replace_callback(
476476
'#%(' . substr(chunk_split(bin2hex($reserved), 2, '|'), 0, -1) . ')#i',
477-
function($m) { return '%25' . strtoupper($m[1]); },
477+
function ($m) { return '%25' . strtoupper($m[1]); },
478478
$s
479479
);
480480
}

src/Http/UserStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class UserStorage extends Nette\Object implements Nette\Security\IUserStorage
2929
private $sessionSection;
3030

3131

32-
public function __construct(Session $sessionHandler)
32+
public function __construct(Session $sessionHandler)
3333
{
3434
$this->sessionHandler = $sessionHandler;
3535
}

tests/Http.DI/HttpExtension.defaultHeaders.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ $container = new Container1;
2424
$container->initialize();
2525

2626
$headers = headers_list();
27-
Assert::contains( 'X-Frame-Options: SAMEORIGIN', $headers );
28-
Assert::contains( 'Content-Type: text/html; charset=utf-8', $headers );
29-
Assert::contains( 'X-Powered-By: Nette Framework', $headers );
27+
Assert::contains('X-Frame-Options: SAMEORIGIN', $headers);
28+
Assert::contains('Content-Type: text/html; charset=utf-8', $headers);
29+
Assert::contains('X-Powered-By: Nette Framework', $headers);

0 commit comments

Comments
 (0)