mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Run PHP-CS-FIXER to make sure
code is consisted with PSR-1 + PSR-2
This commit is contained in:
1 parent
c9d3448571
commit
35680bbae9
37 files changed
+928
-753
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user