Run PHP-CS-FIXER to make sure

code is consisted with PSR-1 + PSR-2
This commit is contained in:
eldadfux committed 2019-09-06 20:04:26 +03:00
1 parent c9d3448571
commit 35680bbae9
37 files changed
+928 -753

No files matched your search

+7 -4
View File
@@ -19,7 +19,7 @@ class Collection extends Structure
/**
* @param Database $database
* @param array $collections
* @param array $collections
*/
public function __construct(Database $database, array $collections)
{
@@ -30,22 +30,25 @@ class Collection extends Structure
/**
* @param Document $document
*
* @return bool
*/
public function isValid($document)
{
$document = (is_array($document)) ? new Document($document) : $document;
if(is_null($document->getCollection())) {
if (is_null($document->getCollection())) {
$this->message = 'Missing collection attribute $collection';
return false;
}
if(!in_array($document->getCollection(), $this->collections)) {
if (!in_array($document->getCollection(), $this->collections)) {
$this->message = 'Collection is not allowed';
return false;
}
return parent::isValid($document);
}
}
}