@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $entity->$propName = $this->encryptor->$encryptorMethod($refProperty->getValue()); |
160 | 160 | } else { |
161 | 161 | $methodName = self::capitalize($propName); |
162 | - if ($reflectionClass->hasMethod($getter = 'get'.$methodName) && $reflectionClass->hasMethod($setter = 'set'.$methodName)) { |
|
162 | + if ($reflectionClass->hasMethod($getter = 'get' . $methodName) && $reflectionClass->hasMethod($setter = 'set' . $methodName)) { |
|
163 | 163 | $currentPropValue = $this->encryptor->$encryptorMethod($entity->$getter()); |
164 | 164 | $entity->$setter($currentPropValue); |
165 | 165 | } else { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $className = get_class($entity); |
206 | 206 | $metadata = $em->getClassMetadata($className); |
207 | - $getter = 'get'.self::capitalize($metadata->getIdentifier()); |
|
207 | + $getter = 'get' . self::capitalize($metadata->getIdentifier()); |
|
208 | 208 | |
209 | 209 | return isset($this->decodedRegistry[$className][$entity->$getter()]); |
210 | 210 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | $className = get_class($entity); |
221 | 221 | $metadata = $em->getClassMetadata($className); |
222 | - $getter = 'get'.self::capitalize($metadata->getIdentifier()); |
|
222 | + $getter = 'get' . self::capitalize($metadata->getIdentifier()); |
|
223 | 223 | $this->decodedRegistry[$className][$entity->$getter()] = true; |
224 | 224 | } |
225 | 225 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $container->setParameter('versioncontrol_doctrine_encrypt.encryptor_class_name', $encryptorFullName); |
43 | 43 | $container->setParameter('versioncontrol_doctrine_encrypt.secret_key', $config['secret_key']); |
44 | 44 | |
45 | - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
45 | + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
46 | 46 | $loader->load(sprintf('%s.xml', $services[$config['db_driver']])); |
47 | 47 | } |
48 | 48 |
@@ -29,11 +29,11 @@ |
||
29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
30 | 30 | // indexes |
31 | 31 | $columns = array( |
32 | - array('db' => 'id', 'dt' => 0), |
|
33 | - array('db' => 'firstname', 'dt' => 1), |
|
34 | - array('db' => 'surname', 'dt' => 2), |
|
35 | - array('db' => 'zip', 'dt' => 3), |
|
36 | - array('db' => 'country', 'dt' => 4), |
|
32 | + array('db' => 'id', 'dt' => 0), |
|
33 | + array('db' => 'firstname', 'dt' => 1), |
|
34 | + array('db' => 'surname', 'dt' => 2), |
|
35 | + array('db' => 'zip', 'dt' => 3), |
|
36 | + array('db' => 'country', 'dt' => 4), |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | // SQL server connection information |
@@ -374,13 +374,13 @@ |
||
374 | 374 | |
375 | 375 | foreach ($types as $type) { |
376 | 376 | $mode[$type] = 0; |
377 | - if (call_user_func(array($this, 'getPermission'.$type.'Read'))) { |
|
377 | + if (call_user_func(array($this, 'getPermission' . $type . 'Read'))) { |
|
378 | 378 | $mode[$type] += 4; |
379 | 379 | } |
380 | - if (call_user_func(array($this, 'getPermission'.$type.'Write'))) { |
|
380 | + if (call_user_func(array($this, 'getPermission' . $type . 'Write'))) { |
|
381 | 381 | $mode[$type] += 2; |
382 | 382 | } |
383 | - if (call_user_func(array($this, 'getPermission'.$type.'Execute'))) { |
|
383 | + if (call_user_func(array($this, 'getPermission' . $type . 'Execute'))) { |
|
384 | 384 | $mode[$type] += 1; |
385 | 385 | } |
386 | 386 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | if ($id !== false) { |
68 | 68 | $redirectUrl = $controller[0]->initAction($id, $configuration->grantType); |
69 | 69 | if ($redirectUrl) { |
70 | - $event->setController(static function () use ($redirectUrl) { |
|
70 | + $event->setController(static function() use ($redirectUrl) { |
|
71 | 71 | return new RedirectResponse($redirectUrl); |
72 | 72 | }); |
73 | 73 | } |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | if (defined('PHP_MAJOR_VERSION') && PHP_MAJOR_VERSION >= 7) { |
46 | 46 | $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length("AES-256-ECB")); |
47 | 47 | |
48 | - return trim(base64_encode(openssl_encrypt ( |
|
49 | - $data , |
|
48 | + return trim(base64_encode(openssl_encrypt( |
|
49 | + $data, |
|
50 | 50 | "AES-256-ECB", |
51 | 51 | $this->secretKey, |
52 | 52 | 0, |
53 | 53 | $iv))); |
54 | - }else{ |
|
54 | + } else { |
|
55 | 55 | return trim(base64_encode(mcrypt_encrypt( |
56 | 56 | MCRYPT_RIJNDAEL_256, $this->secretKey, $data, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND |
57 | 57 | )))); |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | if (defined('PHP_MAJOR_VERSION') && PHP_MAJOR_VERSION >= 7) { |
75 | 75 | $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length("AES-256-ECB")); |
76 | 76 | |
77 | - return trim(openssl_decrypt ( |
|
78 | - base64_decode($data) , |
|
77 | + return trim(openssl_decrypt( |
|
78 | + base64_decode($data), |
|
79 | 79 | "AES-256-ECB", |
80 | 80 | $this->secretKey, |
81 | 81 | 0, |
82 | 82 | $iv)); |
83 | - }else{ |
|
83 | + } else { |
|
84 | 84 | return trim(mcrypt_decrypt( |
85 | 85 | MCRYPT_RIJNDAEL_256, $this->secretKey, base64_decode($data), MCRYPT_MODE_ECB, mcrypt_create_iv( |
86 | 86 | mcrypt_get_iv_size( |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->secretKey, |
52 | 52 | 0, |
53 | 53 | $iv))); |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | return trim(base64_encode(mcrypt_encrypt( |
56 | 56 | MCRYPT_RIJNDAEL_256, $this->secretKey, $data, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND |
57 | 57 | )))); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->secretKey, |
81 | 81 | 0, |
82 | 82 | $iv)); |
83 | - }else{ |
|
83 | + } else{ |
|
84 | 84 | return trim(mcrypt_decrypt( |
85 | 85 | MCRYPT_RIJNDAEL_256, $this->secretKey, base64_decode($data), MCRYPT_MODE_ECB, mcrypt_create_iv( |
86 | 86 | mcrypt_get_iv_size( |
@@ -174,19 +174,19 @@ discard block |
||
174 | 174 | return $this->findByProjectAndStatus($state, $keyword, $issueMilestoneId, true); |
175 | 175 | } |
176 | 176 | |
177 | - /** |
|
178 | - * @param type $project |
|
179 | - * |
|
180 | - * @return int |
|
181 | - */ |
|
182 | - public function countIssuesForProjectWithStatus($status = 'open', $keyword = false, $milestone = null) |
|
183 | - { |
|
184 | - $qb = $this->findByProjectAndStatus($status, $keyword, $milestone, true); |
|
185 | - |
|
186 | - $qb->select('count(a)'); |
|
187 | - |
|
188 | - return $qb->getQuery()->getSingleScalarResult(); |
|
189 | - } |
|
177 | + /** |
|
178 | + * @param type $project |
|
179 | + * |
|
180 | + * @return int |
|
181 | + */ |
|
182 | + public function countIssuesForProjectWithStatus($status = 'open', $keyword = false, $milestone = null) |
|
183 | + { |
|
184 | + $qb = $this->findByProjectAndStatus($status, $keyword, $milestone, true); |
|
185 | + |
|
186 | + $qb->select('count(a)'); |
|
187 | + |
|
188 | + return $qb->getQuery()->getSingleScalarResult(); |
|
189 | + } |
|
190 | 190 | |
191 | 191 | public function findByProjectAndStatus($status = 'open', $keyword = false, $milestone = null, $queryOnly = false) |
192 | 192 | { |
@@ -197,29 +197,29 @@ discard block |
||
197 | 197 | $parameters = array('project' => $this->project); |
198 | 198 | |
199 | 199 | $qb->select('a') |
200 | - ->from('VersionControlGitControlBundle:Issue', 'a') |
|
201 | - ->where($where) |
|
202 | - ->setParameters($parameters); |
|
200 | + ->from('VersionControlGitControlBundle:Issue', 'a') |
|
201 | + ->where($where) |
|
202 | + ->setParameters($parameters); |
|
203 | 203 | |
204 | 204 | if ($status) { |
205 | 205 | $qb->andWhere( |
206 | - $qb->expr()->like('a.status', ':status') |
|
207 | - )->setParameter('status', $status); |
|
206 | + $qb->expr()->like('a.status', ':status') |
|
207 | + )->setParameter('status', $status); |
|
208 | 208 | } |
209 | - //If keyword is set |
|
210 | - if ($keyword) { |
|
211 | - $qb->andWhere( |
|
209 | + //If keyword is set |
|
210 | + if ($keyword) { |
|
211 | + $qb->andWhere( |
|
212 | 212 | $qb->expr()->orX( |
213 | 213 | $qb->expr()->like('a.title', ':keyword'), |
214 | 214 | $qb->expr()->like('a.description', ':keyword') |
215 | 215 | ) |
216 | 216 | )->setParameter('keyword', '%'.$keyword.'%'); |
217 | - } |
|
217 | + } |
|
218 | 218 | |
219 | 219 | if ($milestone != null) { |
220 | 220 | $qb->andWhere( |
221 | - $qb->expr()->eq('a.issueMilestone', ':milestone') |
|
222 | - )->setParameter('milestone', $milestone); |
|
221 | + $qb->expr()->eq('a.issueMilestone', ':milestone') |
|
222 | + )->setParameter('milestone', $milestone); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | $qb->orderBy('a.updatedAt', 'desc'); |
@@ -213,7 +213,7 @@ |
||
213 | 213 | $qb->expr()->like('a.title', ':keyword'), |
214 | 214 | $qb->expr()->like('a.description', ':keyword') |
215 | 215 | ) |
216 | - )->setParameter('keyword', '%'.$keyword.'%'); |
|
216 | + )->setParameter('keyword', '%' . $keyword . '%'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | if ($milestone != null) { |
@@ -20,16 +20,16 @@ |
||
20 | 20 | $qb = $em->createQueryBuilder(); |
21 | 21 | |
22 | 22 | $qb->select('a') |
23 | - ->from('VersionControlGitControlBundle:UserProjects', 'a') |
|
23 | + ->from('VersionControlGitControlBundle:UserProjects', 'a') |
|
24 | 24 | ->leftJoin('a.project', 'b') |
25 | 25 | ->where('a.user = :user') |
26 | 26 | ->setParameter('user', $user); |
27 | 27 | |
28 | - //If keyword is set |
|
29 | - if ($keyword) { |
|
30 | - $qb->andWhere(' b.title LIKE :keyword OR b.description LIKE :keyword ') |
|
31 | - ->setParameter('keyword', '%'.$keyword.'%'); |
|
32 | - } |
|
28 | + //If keyword is set |
|
29 | + if ($keyword) { |
|
30 | + $qb->andWhere(' b.title LIKE :keyword OR b.description LIKE :keyword ') |
|
31 | + ->setParameter('keyword', '%'.$keyword.'%'); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | if ($queryOnly === true) { |
35 | 35 | return $qb; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | //If keyword is set |
29 | 29 | if ($keyword) { |
30 | 30 | $qb->andWhere(' b.title LIKE :keyword OR b.description LIKE :keyword ') |
31 | - ->setParameter('keyword', '%'.$keyword.'%'); |
|
31 | + ->setParameter('keyword', '%' . $keyword . '%'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if ($queryOnly === true) { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | if ($this->issueIntegrator) { |
49 | 49 | $repoType = $this->issueIntegrator->getRepoType(); |
50 | - $issueRepository = $this->serviceContainer->get('version_control.issue_repository.'.strtolower($repoType)); |
|
50 | + $issueRepository = $this->serviceContainer->get('version_control.issue_repository.' . strtolower($repoType)); |
|
51 | 51 | $issueRepository->setIssueIntegrator($this->issueIntegrator); |
52 | 52 | } else { |
53 | 53 | //Default ORM repository |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | if ($this->issueIntegrator) { |
67 | 67 | $repoType = $this->issueIntegrator->getRepoType(); |
68 | - $issueLabelRepository = $this->serviceContainer->get('version_control.issue_label_repository.'.strtolower($repoType)); |
|
68 | + $issueLabelRepository = $this->serviceContainer->get('version_control.issue_label_repository.' . strtolower($repoType)); |
|
69 | 69 | $issueLabelRepository->setIssueIntegrator($this->issueIntegrator); |
70 | 70 | } else { |
71 | 71 | //Default ORM repository |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | if ($this->issueIntegrator) { |
85 | 85 | $repoType = $this->issueIntegrator->getRepoType(); |
86 | - $issueMilestoneRepository = $this->serviceContainer->get('version_control.issue_milestone_repository.'.strtolower($repoType)); |
|
86 | + $issueMilestoneRepository = $this->serviceContainer->get('version_control.issue_milestone_repository.' . strtolower($repoType)); |
|
87 | 87 | $issueMilestoneRepository->setIssueIntegrator($this->issueIntegrator); |
88 | 88 | } else { |
89 | 89 | //Default ORM repository |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | if ($this->issueIntegrator) { |
128 | 128 | $repoType = $this->issueIntegrator->getRepoType(); |
129 | - $issueFormType = 'VersionControl\\'.$repoType.'IssueBundle\Form\IssueType'; |
|
129 | + $issueFormType = 'VersionControl\\' . $repoType . 'IssueBundle\Form\IssueType'; |
|
130 | 130 | } else { |
131 | 131 | $issueFormType = IssueType::class; |
132 | 132 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | if ($this->issueIntegrator) { |
140 | 140 | $repoType = $this->issueIntegrator->getRepoType(); |
141 | - $issueEditFormType = 'VersionControl\\'.$repoType."IssueBundle\Form\IssueEditType"; |
|
141 | + $issueEditFormType = 'VersionControl\\' . $repoType . "IssueBundle\Form\IssueEditType"; |
|
142 | 142 | } else { |
143 | 143 | $issueEditFormType = IssueEditType::class; |
144 | 144 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | if ($this->issueIntegrator) { |
152 | 152 | $repoType = $this->issueIntegrator->getRepoType(); |
153 | 153 | //$issueFormType = $this->serviceContainer->get("version_control.issue_comment_form_type.'.strtolower($repoType)); |
154 | - $issueFormType = 'VersionControl\\'.$repoType.'IssueBundle\Form\IssueCommentType'; |
|
154 | + $issueFormType = 'VersionControl\\' . $repoType . 'IssueBundle\Form\IssueCommentType'; |
|
155 | 155 | } else { |
156 | 156 | $issueFormType = IssueCommentType::class; |
157 | 157 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | if ($this->issueIntegrator) { |
165 | 165 | $repoType = $this->issueIntegrator->getRepoType(); |
166 | 166 | //$issueFormType = $this->serviceContainer->get('version_control.issue_label_form_type.'.strtolower($repoType)); |
167 | - $issueFormType = 'VersionControl\\'.$repoType.'IssueBundle\Form\IssueLabelType'; |
|
167 | + $issueFormType = 'VersionControl\\' . $repoType . 'IssueBundle\Form\IssueLabelType'; |
|
168 | 168 | } else { |
169 | 169 | $issueFormType = IssueLabelType::class; |
170 | 170 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | if ($this->issueIntegrator) { |
178 | 178 | $repoType = $this->issueIntegrator->getRepoType(); |
179 | 179 | //$issueFormType = $this->serviceContainer->get('version_control.issue_milestone_form_type.'.strtolower($repoType)); |
180 | - $issueFormType = 'VersionControl\\'.$repoType.'IssueBundle\Form\IssueMilestoneType'; |
|
180 | + $issueFormType = 'VersionControl\\' . $repoType . 'IssueBundle\Form\IssueMilestoneType'; |
|
181 | 181 | } else { |
182 | 182 | $issueFormType = IssueMilestoneType::class; |
183 | 183 | } |