Skip to content

Commit

Permalink
removed deprecated stuff & UserStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 25, 2021
1 parent 69c413d commit 4c6b8c6
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 221 deletions.
10 changes: 1 addition & 9 deletions src/Bridges/HttpDI/SessionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getConfigSchema(): Nette\Schema\Schema
'expiration' => Expect::string()->dynamic(),
'handler' => Expect::string()->dynamic(),
'readAndClose' => Expect::bool(),
'cookieSamesite' => Expect::anyOf(IResponse::SAME_SITE_LAX, IResponse::SAME_SITE_STRICT, IResponse::SAME_SITE_NONE, true)
'cookieSamesite' => Expect::anyOf(IResponse::SAME_SITE_LAX, IResponse::SAME_SITE_STRICT, IResponse::SAME_SITE_NONE)
->firstIsDefault(),
])->otherItems('mixed');
}
Expand All @@ -62,14 +62,6 @@ public function loadConfiguration()
if (($config->cookieDomain ?? null) === 'domain') {
$config->cookieDomain = $builder::literal('$this->getByType(Nette\Http\IRequest::class)->getUrl()->getDomain(2)');
}
if (isset($config->cookieSecure)) {
trigger_error("The item 'session › cookieSecure' is deprecated, use 'http › cookieSecure' (it has default value 'auto').", E_USER_DEPRECATED);
unset($config->cookieSecure);
}
if ($config->cookieSamesite === true) {
trigger_error("In 'session › cookieSamesite' replace true with 'Lax'.", E_USER_DEPRECATED);
$config->cookieSamesite = IResponse::SAME_SITE_LAX;
}
$this->compiler->addExportedType(Nette\Http\IRequest::class);

if ($this->debugMode && $config->debugger) {
Expand Down
6 changes: 0 additions & 6 deletions src/Http/IResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
*/
interface IResponse
{
/** @deprecated */
public const PERMANENT = 2116333333;

/** @deprecated */
public const BROWSER = 0;

/** HTTP 1.1 response code */
public const
S100_CONTINUE = 100,
Expand Down
10 changes: 0 additions & 10 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ public function getQuery(string $key = null): mixed
{
if (func_num_args() === 0) {
return $this->url->getQueryParameters();
} elseif (func_num_args() > 1) {
trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED);
}
return $this->url->getQueryParameter($key);
}
Expand All @@ -122,8 +120,6 @@ public function getPost(string $key = null): mixed
{
if (func_num_args() === 0) {
return $this->post;
} elseif (func_num_args() > 1) {
trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED);
}
return $this->post[$key] ?? null;
}
Expand Down Expand Up @@ -154,9 +150,6 @@ public function getFiles(): array
*/
public function getCookie(string $key): mixed
{
if (func_num_args() > 1) {
trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED);
}
return $this->cookies[$key] ?? null;
}

Expand Down Expand Up @@ -196,9 +189,6 @@ public function isMethod(string $method): bool
*/
public function getHeader(string $header): ?string
{
if (func_num_args() > 1) {
trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED);
}
$header = strtolower($header);
return $this->headers[$header] ?? null;
}
Expand Down
6 changes: 0 additions & 6 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ final class Response implements IResponse
/** Whether the cookie is available only through HTTPS */
public bool $cookieSecure = false;

/** @deprecated */
public $cookieHttpOnly;

/** Whether warn on possible problem with data in output buffer */
public bool $warnOnBuffer = true;

Expand Down Expand Up @@ -199,9 +196,6 @@ public function isSent(): bool
*/
public function getHeader(string $header): ?string
{
if (func_num_args() > 1) {
trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED);
}
$header .= ':';
$len = strlen($header);
foreach (headers_list() as $item) {
Expand Down
8 changes: 0 additions & 8 deletions src/Http/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,6 @@ public function setCookieParameters(
}


/** @deprecated */
public function getCookieParameters(): array
{
trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
return session_get_cookie_params();
}


/**
* Sets path of the directory used to save session data.
*/
Expand Down
4 changes: 0 additions & 4 deletions src/Http/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@ public function getQueryParameters(): array

public function getQueryParameter(string $name): mixed
{
if (func_num_args() > 1) {
trigger_error(__METHOD__ . '() parameter $default is deprecated, use operator ??', E_USER_DEPRECATED);
}
return $this->query[$name] ?? null;
}

Expand Down Expand Up @@ -329,7 +326,6 @@ public function isEqual(string|self $url): bool

/**
* Transforms URL to canonical form.
* @deprecated
*/
public function canonicalize(): static
{
Expand Down
178 changes: 0 additions & 178 deletions src/Http/UserStorage.php

This file was deleted.

0 comments on commit 4c6b8c6

Please sign in to comment.