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
|
* @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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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 = [
|
||||||
|
|
||||||
|
|
|
@ -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]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue