@@ -127,7 +127,7 @@ |
||
| 127 | 127 | |
| 128 | 128 | public function process($token, $organizationId) |
| 129 | 129 | { |
| 130 | - $organizationRepository = $this->getOrganizationRepository(); |
|
| 130 | + $organizationRepository = $this->getOrganizationRepository(); |
|
| 131 | 131 | $organization = $organizationRepository->find($organizationId); /* @var $organization \Organizations\Entity\OrganizationInterface */ |
| 132 | 132 | |
| 133 | 133 | if (!$organization) { |
@@ -27,13 +27,13 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @var int |
| 29 | 29 | */ |
| 30 | - const JOBS_VIEW = 16; // 10000 |
|
| 31 | - const JOBS_CREATE = 24; // 11000 # Create w/o View makes no sense |
|
| 32 | - const JOBS_CHANGE = 20; // 10100 # Change w/o view makes no sense |
|
| 33 | - const APPLICATIONS_VIEW = 2; // 00010 |
|
| 34 | - const APPLICATIONS_CHANGE = 3; // 00011 # change w/o view makes no sense |
|
| 35 | - const ALL = 31; // 11111 |
|
| 36 | - const NONE = 0; // 00000 |
|
| 30 | + const JOBS_VIEW = 16; // 10000 |
|
| 31 | + const JOBS_CREATE = 24; // 11000 # Create w/o View makes no sense |
|
| 32 | + const JOBS_CHANGE = 20; // 10100 # Change w/o view makes no sense |
|
| 33 | + const APPLICATIONS_VIEW = 2; // 00010 |
|
| 34 | + const APPLICATIONS_CHANGE = 3; // 00011 # change w/o view makes no sense |
|
| 35 | + const ALL = 31; // 11111 |
|
| 36 | + const NONE = 0; // 00000 |
|
| 37 | 37 | /**#@- */ |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | public function getHydrator() |
| 25 | 25 | { |
| 26 | 26 | if (!$this->hydrator) { |
| 27 | - $hydrator = new EntityHydrator(); |
|
| 27 | + $hydrator = new EntityHydrator(); |
|
| 28 | 28 | $this->setHydrator($hydrator); |
| 29 | 29 | } |
| 30 | 30 | return $this->hydrator; |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | if ($document instanceof UserInterface) { |
| 42 | 42 | $repository = $args->getDocumentManager()->getRepository('Organizations\Entity\Organization'); |
| 43 | - $userId = $document->getId(); |
|
| 43 | + $userId = $document->getId(); |
|
| 44 | 44 | $reference = new OrganizationReference($userId, $repository); |
| 45 | 45 | |
| 46 | 46 | $document->setOrganization($reference); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * |
| 25 | 25 | * @var String |
| 26 | 26 | */ |
| 27 | - protected $repositoryName="Organizations/Organization"; |
|
| 27 | + protected $repositoryName = "Organizations/Organization"; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Sortable fields |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | * @see \Core\Repository\Filter\AbstractPaginationQuery::createQuery() |
| 52 | 52 | * @param $params |
| 53 | 53 | * @param \Doctrine\ODM\MongoDB\Query\Builder $queryBuilder |
| 54 | - * @return mixed |
|
| 54 | + * @return \Doctrine\ODM\MongoDB\Query\Builder |
|
| 55 | 55 | */ |
| 56 | 56 | public function createQuery($params, $queryBuilder) |
| 57 | 57 | { |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | $fieldset->setLabel(ucfirst($label)); |
| 103 | 103 | } |
| 104 | 104 | $fieldset->setName($name) |
| 105 | - ->setObject($child); |
|
| 105 | + ->setObject($child); |
|
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | $this->add($fieldset); |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $inputLabel = isset($this->labelMap[$inputName]) ? $this->labelMap[$inputName] : $inputName; |
| 76 | 76 | |
| 77 | - if (is_array($inputLabel)){ |
|
| 78 | - $priority = isset($inputLabel[1])?$inputLabel[1]:0; |
|
| 77 | + if (is_array($inputLabel)) { |
|
| 78 | + $priority = isset($inputLabel[1]) ? $inputLabel[1] : 0; |
|
| 79 | 79 | $inputLabel = $inputLabel[0]; |
| 80 | - }else{ |
|
| 80 | + } else { |
|
| 81 | 81 | $priority = 0; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -89,19 +89,19 @@ discard block |
||
| 89 | 89 | ), |
| 90 | 90 | ); |
| 91 | 91 | if (is_bool($value)) { |
| 92 | - $input['type']= 'Checkbox'; |
|
| 92 | + $input['type'] = 'Checkbox'; |
|
| 93 | 93 | $input['attributes']['checked'] = $value; |
| 94 | 94 | } else { |
| 95 | 95 | $input['attributes']['value'] = $value; |
| 96 | 96 | } |
| 97 | - $this->add($input,['priority'=>$priority]); |
|
| 97 | + $this->add($input, ['priority'=>$priority]); |
|
| 98 | 98 | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | foreach ($children as $name => $child) { |
| 102 | 102 | $objectClass = ltrim(get_class($settings), '\\'); |
| 103 | 103 | $moduleName = substr($objectClass, 0, strpos($objectClass, '\\')); |
| 104 | - $fieldsetName = $moduleName . '/' . ucfirst($name) . 'SettingsFieldset'; |
|
| 104 | + $fieldsetName = $moduleName.'/'.ucfirst($name).'SettingsFieldset'; |
|
| 105 | 105 | |
| 106 | 106 | if ($this->formManager->has($fieldsetName)) { |
| 107 | 107 | $fieldset = $this->formManager->get($fieldsetName); |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | if (is_array($inputLabel)){ |
| 78 | 78 | $priority = isset($inputLabel[1])?$inputLabel[1]:0; |
| 79 | 79 | $inputLabel = $inputLabel[0]; |
| 80 | - }else{ |
|
| 80 | + } else{ |
|
| 81 | 81 | $priority = 0; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | // 'driver' => 'odm_default', |
| 27 | 27 | // |
| 28 | 28 | // 'generate_proxies' => true, |
| 29 | - 'proxy_dir' => 'cache/DoctrineMongoODMModule/Proxy', |
|
| 29 | + 'proxy_dir' => 'cache/DoctrineMongoODMModule/Proxy', |
|
| 30 | 30 | // 'proxy_namespace' => 'DoctrineMongoODMModule\Proxy', |
| 31 | 31 | // |
| 32 | 32 | // 'generate_hydrators' => true, |
| 33 | - 'hydrator_dir' => 'cache/DoctrineMongoODMModule/Hydrator', |
|
| 33 | + 'hydrator_dir' => 'cache/DoctrineMongoODMModule/Hydrator', |
|
| 34 | 34 | // 'hydrator_namespace' => 'DoctrineMongoODMModule\Hydrator', |
| 35 | 35 | // |
| 36 | 36 | // 'default_db' => '', |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | { |
| 132 | 132 | $viewModel = new ViewModel(); |
| 133 | 133 | $viewModel->setTemplate('error/index') |
| 134 | - ->setVariable('message', 'An unexpected error had occured. Please try again later.'); |
|
| 134 | + ->setVariable('message', 'An unexpected error had occured. Please try again later.'); |
|
| 135 | 135 | return $viewModel; |
| 136 | 136 | } |
| 137 | 137 | } |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | // ) |
| 129 | 129 | // ); |
| 130 | 130 | $qb->addAnd($qb->expr()->field('user')->equals($userId)) |
| 131 | - ->addAnd( |
|
| 132 | - $qb->expr()->addOr($qb->expr()->field('parent')->exists(false)) |
|
| 133 | - ->addOr($qb->expr()->field('parent')->equals(null)) |
|
| 134 | - ); |
|
| 131 | + ->addAnd( |
|
| 132 | + $qb->expr()->addOr($qb->expr()->field('parent')->exists(false)) |
|
| 133 | + ->addOr($qb->expr()->field('parent')->equals(null)) |
|
| 134 | + ); |
|
| 135 | 135 | |
| 136 | 136 | $q = $qb->getQuery(); |
| 137 | 137 | $entity = $q->getSingleResult(); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | if ($userOrg->hasAssociation()) { |
| 253 | 253 | $qb->addAnd( |
| 254 | 254 | $qb->expr()->addOr($qb->expr()->field('parent')->equals($userOrg->getId())) |
| 255 | - ->addOr($qb->expr()->field('_id')->equals($userOrg->getId())) |
|
| 255 | + ->addOr($qb->expr()->field('_id')->equals($userOrg->getId())) |
|
| 256 | 256 | ); |
| 257 | 257 | } |
| 258 | 258 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | /** |
| 107 | 107 | * Finds the main organization of an user. |
| 108 | 108 | * |
| 109 | - * @param string|UserInterface $userOrId |
|
| 109 | + * @param string $userOrId |
|
| 110 | 110 | * |
| 111 | 111 | * @return null|OrganizationInterface |
| 112 | 112 | */ |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * Finds the organization, an user is employed by. |
| 144 | 144 | * |
| 145 | - * @param string|UserInterface $userOrId |
|
| 145 | + * @param string $userOrId |
|
| 146 | 146 | * |
| 147 | 147 | * @return null|OrganizationInterface |
| 148 | 148 | */ |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | /** |
| 271 | 271 | * Look for an drafted Document of a given user |
| 272 | 272 | * |
| 273 | - * @param $user |
|
| 273 | + * @param \Auth\Entity\AnonymousUser $user |
|
| 274 | 274 | * @return \Organizations\Entity\Organization|null |
| 275 | 275 | */ |
| 276 | 276 | public function findDraft($user) |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $organizationNameQb = $this->getDocumentManager()->createQueryBuilder('Organizations\Entity\OrganizationName'); |
| 226 | 226 | $organizationNameQb->hydrate(false) |
| 227 | 227 | ->select(array('id', 'name')) |
| 228 | - ->field('name')->equals(new \MongoRegex('/' . $query . '/i')) |
|
| 228 | + ->field('name')->equals(new \MongoRegex('/'.$query.'/i')) |
|
| 229 | 229 | ->sort('name') |
| 230 | 230 | ->limit(5); |
| 231 | 231 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | foreach ($result as $id => $item) { |
| 262 | 262 | $organizations[$id] = $item; |
| 263 | - $organizationNameId = (string)$organizations[$id]['organizationName']; |
|
| 263 | + $organizationNameId = (string) $organizations[$id]['organizationName']; |
|
| 264 | 264 | $organizations[$id]['organizationName'] = $organizationNames[$organizationNameId]; |
| 265 | 265 | } |
| 266 | 266 | |