Changes:
- added type-hints - added returned type-hints in interface (I checked all)
This commit is contained in:
parent
c0d7f8944d
commit
bff57bb030
|
@ -33,14 +33,14 @@ interface ICanHandleHttpResponses
|
|||
*
|
||||
* @return string The Return Code
|
||||
*/
|
||||
public function getReturnCode();
|
||||
public function getReturnCode(): string;
|
||||
|
||||
/**
|
||||
* Returns the Content Type
|
||||
*
|
||||
* @return string the Content Type
|
||||
*/
|
||||
public function getContentType();
|
||||
public function getContentType(): string;
|
||||
|
||||
/**
|
||||
* Returns the headers
|
||||
|
@ -51,7 +51,7 @@ interface ICanHandleHttpResponses
|
|||
*@see MessageInterface::getHeader()
|
||||
*
|
||||
*/
|
||||
public function getHeader(string $header);
|
||||
public function getHeader(string $header): array;
|
||||
|
||||
/**
|
||||
* Returns all headers
|
||||
|
@ -59,7 +59,7 @@ interface ICanHandleHttpResponses
|
|||
*
|
||||
* @return string[][]
|
||||
*/
|
||||
public function getHeaders();
|
||||
public function getHeaders(): array;
|
||||
|
||||
/**
|
||||
* Check if a specified header exists
|
||||
|
@ -69,7 +69,7 @@ interface ICanHandleHttpResponses
|
|||
*
|
||||
* @return boolean "true" if header exists
|
||||
*/
|
||||
public function inHeader(string $field);
|
||||
public function inHeader(string $field): bool;
|
||||
|
||||
/**
|
||||
* Returns the headers as an associated array
|
||||
|
@ -78,47 +78,47 @@ interface ICanHandleHttpResponses
|
|||
*
|
||||
* @return string[][] associated header array
|
||||
*/
|
||||
public function getHeaderArray();
|
||||
public function getHeaderArray(): array;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSuccess();
|
||||
public function isSuccess(): bool;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl();
|
||||
public function getUrl(): string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getRedirectUrl();
|
||||
public function getRedirectUrl(): string;
|
||||
|
||||
/**
|
||||
* @see MessageInterface::getBody()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBody();
|
||||
public function getBody(): string;
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isRedirectUrl();
|
||||
public function isRedirectUrl(): bool;
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function getErrorNumber();
|
||||
public function getErrorNumber(): int;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getError();
|
||||
public function getError(): string;
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isTimeout();
|
||||
public function isTimeout(): bool;
|
||||
}
|
||||
|
|
|
@ -1008,7 +1008,7 @@ class Post
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function getRedirectUrl()
|
||||
private function getRedirectUrl(): string
|
||||
{
|
||||
return $this->redirect_url;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ class ContactResult implements IResult
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
public function getUrl(): string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ abstract class MailBuilder
|
|||
*
|
||||
* @return string[][]
|
||||
*/
|
||||
public function getHeaders()
|
||||
public function getHeaders(): array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ abstract class MailBuilder
|
|||
* @param string[][] $headers
|
||||
* @return $this
|
||||
*/
|
||||
public function withHeaders(array $headers)
|
||||
public function withHeaders(array $headers): MailBuilder
|
||||
{
|
||||
$this->headers = $headers;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class Mimetype
|
|||
* @param string $filename filename
|
||||
* @return mixed array or string
|
||||
*/
|
||||
public static function getContentType($filename)
|
||||
public static function getContentType(string $filename)
|
||||
{
|
||||
$mime_types = [
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class ParseUrl
|
|||
* @param string $accept content-type to accept
|
||||
* @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]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue