Code style fix

This commit is contained in:
Dennis Eichhorn 2015-12-21 11:12:19 +01:00
parent e247c6a627
commit a16f0c1d71
3 changed files with 59 additions and 5 deletions

View File

@ -108,7 +108,7 @@ class Auth implements OptionsInterface
case DatabaseType::MYSQL:
$sth = $this->connection->con->prepare(
'SELECT
'SELECT
`' . $this->connection->prefix . 'account`.*
FROM
`' . $this->connection->prefix . 'account`
@ -119,7 +119,7 @@ class Auth implements OptionsInterface
$sth->execute();
$result = $sth->fetchAll();
break;
break;
}
// TODO: check if user is allowed to login on THIS page (backend|frontend|etc...)

View File

@ -392,6 +392,14 @@ class Request extends RequestAbstract
return '/';
}
/**
* Get files passed in request.
*
* @return array
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getFiles() : array
{
return $this->files;
@ -402,6 +410,14 @@ class Request extends RequestAbstract
// NOT Required for Http request
}
/**
* Get request route.
*
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getRoutify() : \string
{
return $this->uri->__toString();

View File

@ -20,7 +20,7 @@ use phpOMS\Message\RequestMethod;
use phpOMS\Uri\InvalidUriException;
/**
* Request class.
* Rest request class.
*
* @category Framework
* @package phpOMS\Request
@ -32,10 +32,30 @@ use phpOMS\Uri\InvalidUriException;
*/
class Rest
{
/**
* Url.
*
* @var string
* @since 1.0.0
*/
private $url = '';
private $method = '';
/**
* Method.
*
* @var string
* @since 1.0.0
*/
private $method = RequestMethod::POST;
/**
* Set url.
*
* @param \string $url Url
*
* @since 1.0.0
* @author Dennis Eichhorn
*/
public function setUrl(\string $url) {
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
throw new InvalidUriException('$url');
@ -44,6 +64,14 @@ class Rest
$this->url = $url;
}
/**
* Set method.
*
* @param \string $method Method
*
* @since 1.0.0
* @author Dennis Eichhorn
*/
public function setMethod(\string $method) {
if(!RequestMethod::isValidValue($method)) {
throw new InvalidEnumValue($method);
@ -52,7 +80,17 @@ class Rest
$this->method = $method;
}
public function callApi($data = false)
/**
* Make request.
*
* @param mixed $data Data to pass
*
* @return \string
*
* @since 1.0.0
* @author Dennis Eichhorn
*/
public function callApi($data = false) : \string
{
$curl = curl_init();