Skip to content

Commit

Permalink
Add return types, round 1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jul 13, 2021
1 parent ab2c46b commit 3b2fe57
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion InputBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function set(string $key, mixed $value)
/**
* {@inheritdoc}
*/
public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = [])
public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed
{
$value = $this->has($key) ? $this->all()[$key] : $default;

Expand Down
7 changes: 2 additions & 5 deletions Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,6 @@ public function __clone()
$this->headers = clone $this->headers;
}

/**
* Returns the request as a string.
*/
public function __toString(): string
{
$content = $this->getContent();
Expand Down Expand Up @@ -901,7 +898,7 @@ public function getBaseUrl()
*
* @return string The raw URL (i.e. not urldecoded)
*/
private function getBaseUrlReal()
private function getBaseUrlReal(): string
{
if (null === $this->baseUrl) {
$this->baseUrl = $this->prepareBaseUrl();
Expand Down Expand Up @@ -2007,7 +2004,7 @@ private function getUrlencodedPrefix(string $string, string $prefix): ?string
return null;
}

private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): self
private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): static
{
if (self::$requestFactory) {
$request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content);
Expand Down
2 changes: 1 addition & 1 deletion Session/SessionBagProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function getStorageKey(): string
/**
* {@inheritdoc}
*/
public function clear()
public function clear(): mixed
{
return $this->bag->clear();
}
Expand Down
6 changes: 1 addition & 5 deletions Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,7 @@ public function __construct(string $driverName = null, int $errorMode = null)
$this->errorMode = null !== $errorMode ?: \PDO::ERRMODE_EXCEPTION;
}

/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function getAttribute($attribute)
public function getAttribute($attribute): mixed
{
if (\PDO::ATTR_ERRMODE === $attribute) {
return $this->errorMode;
Expand Down

0 comments on commit 3b2fe57

Please sign in to comment.