Merge pull request #396 from skipperbent/v4-development

Version 4.0.0.9
This commit is contained in:
Simon Sessingø
2018-03-30 05:23:54 +02:00
committed by GitHub
5 changed files with 418 additions and 509 deletions
+394 -497
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -9,14 +9,14 @@ interface IInputItem
public function setIndex(string $index): self;
public function getName(): string;
public function getName(): ?string;
public function setName(string $name): self;
public function getValue(): string;
public function getValue(): ?string;
public function setValue(string $value): self;
public function __toString();
public function __toString(): string;
}
+4 -4
View File
@@ -140,7 +140,7 @@ class InputFile implements IInputItem
*
* @return string
*/
public function getName(): string
public function getName(): ?string
{
return $this->name;
}
@@ -177,7 +177,7 @@ class InputFile implements IInputItem
*
* @return string mixed
*/
public function getFilename(): string
public function getFilename(): ?string
{
return $this->filename;
}
@@ -256,12 +256,12 @@ class InputFile implements IInputItem
return $this;
}
public function __toString()
public function __toString(): string
{
return $this->getTmpName();
}
public function getValue(): string
public function getValue(): ?string
{
return $this->getFilename();
}
+3 -3
View File
@@ -35,7 +35,7 @@ class InputItem implements IInputItem
/**
* @return string
*/
public function getName(): string
public function getName(): ?string
{
return $this->name;
}
@@ -55,7 +55,7 @@ class InputItem implements IInputItem
/**
* @return string
*/
public function getValue(): string
public function getValue(): ?string
{
return $this->value;
}
@@ -72,7 +72,7 @@ class InputItem implements IInputItem
return $this;
}
public function __toString()
public function __toString(): string
{
return (string)$this->value;
}
+14 -2
View File
@@ -4,7 +4,7 @@ namespace Pecee\Http;
use Pecee\Http\Exceptions\MalformedUrlException;
class Url
class Url implements \JsonSerializable
{
private $originalUrl;
@@ -441,7 +441,19 @@ class Url
return $scheme . $user . $pass . $host . $port . $this->getRelativeUrl();
}
public function __toString()
/**
* Specify data which should be serialized to JSON
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
*/
public function jsonSerialize(): string
{
return $this->getRelativeUrl();
}
public function __toString(): string
{
return $this->getRelativeUrl();
}