@@ -295,7 +295,7 @@ |
||
| 295 | 295 | /** |
| 296 | 296 | * @NoAdminRequired |
| 297 | 297 | * @return string |
| 298 | - */ |
|
| 298 | + */ |
|
| 299 | 299 | public function getAccessLevel(): string { |
| 300 | 300 | if ($this->getIsOwner()) { |
| 301 | 301 | return 'owner'; |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Anonymizes the participants of a poll |
|
| 49 | - * @NoAdminRequired |
|
| 50 | - * @param Array $array Input list which should be anonymized must be a collection of Vote or Comment |
|
| 51 | - * @return array Returns the original array with anonymized user names |
|
| 52 | - */ |
|
| 48 | + * Anonymizes the participants of a poll |
|
| 49 | + * @NoAdminRequired |
|
| 50 | + * @param Array $array Input list which should be anonymized must be a collection of Vote or Comment |
|
| 51 | + * @return array Returns the original array with anonymized user names |
|
| 52 | + */ |
|
| 53 | 53 | private function anonymize($array) { |
| 54 | 54 | // get mapping for the complete poll |
| 55 | 55 | foreach ($array as &$element) { |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Initialize anonymizer with pollId and userId |
|
| 74 | - * Creates a mapping list with unique Anonymous strings based on the partcipants of a poll |
|
| 75 | - * @NoAdminRequired |
|
| 76 | - * @param integer $pollId |
|
| 77 | - * @param string $userId - usernames, which will not be anonymized |
|
| 78 | - */ |
|
| 73 | + * Initialize anonymizer with pollId and userId |
|
| 74 | + * Creates a mapping list with unique Anonymous strings based on the partcipants of a poll |
|
| 75 | + * @NoAdminRequired |
|
| 76 | + * @param integer $pollId |
|
| 77 | + * @param string $userId - usernames, which will not be anonymized |
|
| 78 | + */ |
|
| 79 | 79 | |
| 80 | 80 | public function set($pollId, $userId) { |
| 81 | 81 | $this->pollId = $pollId; |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | } else { |
| 108 | 108 | return false; |
| 109 | 109 | } |
| 110 | - }); |
|
| 110 | + }); |
|
| 111 | 111 | } catch (DoesNotExistException $e) { |
| 112 | 112 | $events = []; |
| 113 | 113 | // return new DataResponse($e, Http::STATUS_NOT_FOUND); |
@@ -52,11 +52,11 @@ |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Read acl with poll id for current user |
|
| 56 | - * @NoAdminRequired |
|
| 57 | - * @param integer $pollId |
|
| 58 | - * @return array |
|
| 59 | - */ |
|
| 55 | + * Read acl with poll id for current user |
|
| 56 | + * @NoAdminRequired |
|
| 57 | + * @param integer $pollId |
|
| 58 | + * @return array |
|
| 59 | + */ |
|
| 60 | 60 | public function get($id) { |
| 61 | 61 | $acl = $this->acl->setPollId($id); |
| 62 | 62 | // $acl = $this->acl->setUserId('dartcafe'); |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | class ShareController extends Controller { |
| 48 | 48 | |
| 49 | - private $logger; |
|
| 50 | - private $acl; |
|
| 49 | + private $logger; |
|
| 50 | + private $acl; |
|
| 51 | 51 | private $mapper; |
| 52 | 52 | private $userId; |
| 53 | 53 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | Acl $acl |
| 75 | 75 | ) { |
| 76 | 76 | parent::__construct($appName, $request); |
| 77 | - $this->logger = $logger; |
|
| 77 | + $this->logger = $logger; |
|
| 78 | 78 | $this->userId = $userId; |
| 79 | 79 | $this->mapper = $mapper; |
| 80 | 80 | $this->eventMapper = $eventMapper; |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * getByToken |
|
| 87 | - * Get pollId by token |
|
| 88 | - * @NoAdminRequired |
|
| 89 | - * @NoCSRFRequired |
|
| 90 | - * @PublicPage |
|
| 91 | - * @param string $token |
|
| 92 | - * @return DataResponse |
|
| 93 | - */ |
|
| 86 | + * getByToken |
|
| 87 | + * Get pollId by token |
|
| 88 | + * @NoAdminRequired |
|
| 89 | + * @NoCSRFRequired |
|
| 90 | + * @PublicPage |
|
| 91 | + * @param string $token |
|
| 92 | + * @return DataResponse |
|
| 93 | + */ |
|
| 94 | 94 | public function get($token) { |
| 95 | 95 | try { |
| 96 | 96 | $share = $this->mapper->findByToken($token); |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | |
| 152 | 152 | /** |
| 153 | 153 | * Public functions |
| 154 | - */ |
|
| 154 | + */ |
|
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * getByToken |
@@ -7,30 +7,30 @@ |
||
| 7 | 7 | |
| 8 | 8 | class FactoryMuffin extends OriginalFactoryMuffin |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Generate and set the model attributes. |
|
| 12 | - * NOTE: Patch the original method to support dynamic setter and getter |
|
| 13 | - * of the OCP\AppFramework\Db\Entity class |
|
| 14 | - * |
|
| 15 | - * @param object $model The model instance. |
|
| 16 | - * @param array $attr The model attributes. |
|
| 17 | - * |
|
| 18 | - * @return void |
|
| 19 | - */ |
|
| 20 | - protected function generate($model, array $attr = []) |
|
| 21 | - { |
|
| 22 | - foreach ($attr as $key => $kind) { |
|
| 23 | - $value = $this->factory->generate($kind, $model, $this); |
|
| 10 | + /** |
|
| 11 | + * Generate and set the model attributes. |
|
| 12 | + * NOTE: Patch the original method to support dynamic setter and getter |
|
| 13 | + * of the OCP\AppFramework\Db\Entity class |
|
| 14 | + * |
|
| 15 | + * @param object $model The model instance. |
|
| 16 | + * @param array $attr The model attributes. |
|
| 17 | + * |
|
| 18 | + * @return void |
|
| 19 | + */ |
|
| 20 | + protected function generate($model, array $attr = []) |
|
| 21 | + { |
|
| 22 | + foreach ($attr as $key => $kind) { |
|
| 23 | + $value = $this->factory->generate($kind, $model, $this); |
|
| 24 | 24 | |
| 25 | - $setter = 'set'.ucfirst(static::camelize($key)); |
|
| 26 | - // check if there is a setter and use it instead |
|
| 27 | - if ($model instanceof Entity && is_callable([$model, $setter])) { |
|
| 28 | - $model->$setter($value); |
|
| 29 | - } elseif (method_exists($model, $setter) && is_callable([$model, $setter])) { |
|
| 30 | - $model->$setter($value); |
|
| 31 | - } else { |
|
| 32 | - $model->$key = $value; |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - } |
|
| 25 | + $setter = 'set'.ucfirst(static::camelize($key)); |
|
| 26 | + // check if there is a setter and use it instead |
|
| 27 | + if ($model instanceof Entity && is_callable([$model, $setter])) { |
|
| 28 | + $model->$setter($value); |
|
| 29 | + } elseif (method_exists($model, $setter) && is_callable([$model, $setter])) { |
|
| 30 | + $model->$setter($value); |
|
| 31 | + } else { |
|
| 32 | + $model->$key = $value; |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | + } |
|
| 36 | 36 | } |