- added type-hints
- added returned type-hints in interface (I checked all)
This commit is contained in:
Roland Häder 2022-06-19 13:59:58 +02:00
parent c0d7f8944d
commit bff57bb030
No known key found for this signature in database
GPG Key ID: C82EDE5DDFA0BA77
6 changed files with 20 additions and 20 deletions

View File

@ -33,14 +33,14 @@ interface ICanHandleHttpResponses
* *
* @return string The Return Code * @return string The Return Code
*/ */
public function getReturnCode(); public function getReturnCode(): string;
/** /**
* Returns the Content Type * Returns the Content Type
* *
* @return string the Content Type * @return string the Content Type
*/ */
public function getContentType(); public function getContentType(): string;
/** /**
* Returns the headers * Returns the headers
@ -51,7 +51,7 @@ interface ICanHandleHttpResponses
*@see MessageInterface::getHeader() *@see MessageInterface::getHeader()
* *
*/ */
public function getHeader(string $header); public function getHeader(string $header): array;
/** /**
* Returns all headers * Returns all headers
@ -59,7 +59,7 @@ interface ICanHandleHttpResponses
* *
* @return string[][] * @return string[][]
*/ */
public function getHeaders(); public function getHeaders(): array;
/** /**
* Check if a specified header exists * Check if a specified header exists
@ -69,7 +69,7 @@ interface ICanHandleHttpResponses
* *
* @return boolean "true" if header exists * @return boolean "true" if header exists
*/ */
public function inHeader(string $field); public function inHeader(string $field): bool;
/** /**
* Returns the headers as an associated array * Returns the headers as an associated array
@ -78,47 +78,47 @@ interface ICanHandleHttpResponses
* *
* @return string[][] associated header array * @return string[][] associated header array
*/ */
public function getHeaderArray(); public function getHeaderArray(): array;
/** /**
* @return bool * @return bool
*/ */
public function isSuccess(); public function isSuccess(): bool;
/** /**
* @return string * @return string
*/ */
public function getUrl(); public function getUrl(): string;
/** /**
* @return string * @return string
*/ */
public function getRedirectUrl(); public function getRedirectUrl(): string;
/** /**
* @see MessageInterface::getBody() * @see MessageInterface::getBody()
* *
* @return string * @return string
*/ */
public function getBody(); public function getBody(): string;
/** /**
* @return boolean * @return boolean
*/ */
public function isRedirectUrl(); public function isRedirectUrl(): bool;
/** /**
* @return integer * @return integer
*/ */
public function getErrorNumber(); public function getErrorNumber(): int;
/** /**
* @return string * @return string
*/ */
public function getError(); public function getError(): string;
/** /**
* @return boolean * @return boolean
*/ */
public function isTimeout(); public function isTimeout(): bool;
} }

View File

@ -1008,7 +1008,7 @@ class Post
/** /**
* @return string * @return string
*/ */
private function getRedirectUrl() private function getRedirectUrl(): string
{ {
return $this->redirect_url; return $this->redirect_url;
} }

View File

@ -110,7 +110,7 @@ class ContactResult implements IResult
/** /**
* @return string * @return string
*/ */
public function getUrl() public function getUrl(): string
{ {
return $this->url; return $this->url;
} }

View File

@ -164,7 +164,7 @@ abstract class MailBuilder
* *
* @return string[][] * @return string[][]
*/ */
public function getHeaders() public function getHeaders(): array
{ {
return $this->headers; return $this->headers;
} }
@ -182,7 +182,7 @@ abstract class MailBuilder
* @param string[][] $headers * @param string[][] $headers
* @return $this * @return $this
*/ */
public function withHeaders(array $headers) public function withHeaders(array $headers): MailBuilder
{ {
$this->headers = $headers; $this->headers = $headers;

View File

@ -29,7 +29,7 @@ class Mimetype
* @param string $filename filename * @param string $filename filename
* @return mixed array or string * @return mixed array or string
*/ */
public static function getContentType($filename) public static function getContentType(string $filename)
{ {
$mime_types = [ $mime_types = [

View File

@ -59,7 +59,7 @@ class ParseUrl
* @param string $accept content-type to accept * @param string $accept content-type to accept
* @return array content type * @return array content type
*/ */
public static function getContentType(string $url, string $accept = HttpClientAccept::DEFAULT) public static function getContentType(string $url, string $accept = HttpClientAccept::DEFAULT): array
{ {
$curlResult = DI::httpClient()->head($url, [HttpClientOptions::ACCEPT_CONTENT => $accept]); $curlResult = DI::httpClient()->head($url, [HttpClientOptions::ACCEPT_CONTENT => $accept]);