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: case DatabaseType::MYSQL:
$sth = $this->connection->con->prepare( $sth = $this->connection->con->prepare(
'SELECT 'SELECT
`' . $this->connection->prefix . 'account`.* `' . $this->connection->prefix . 'account`.*
FROM FROM
`' . $this->connection->prefix . 'account` `' . $this->connection->prefix . 'account`
@ -119,7 +119,7 @@ class Auth implements OptionsInterface
$sth->execute(); $sth->execute();
$result = $sth->fetchAll(); $result = $sth->fetchAll();
break; break;
} }
// TODO: check if user is allowed to login on THIS page (backend|frontend|etc...) // 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 '/'; return '/';
} }
/**
* Get files passed in request.
*
* @return array
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getFiles() : array public function getFiles() : array
{ {
return $this->files; return $this->files;
@ -402,6 +410,14 @@ class Request extends RequestAbstract
// NOT Required for Http request // 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 public function getRoutify() : \string
{ {
return $this->uri->__toString(); return $this->uri->__toString();

View File

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