@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if ($projectEnvironment->getSsh() === true) { |
41 | 41 | $this->sftpProcess->setGitEnviroment($projectEnvironment); |
42 | 42 | try { |
43 | - if ($this->sftpProcess->fileExists($gitPath.'/.git') === false) { |
|
43 | + if ($this->sftpProcess->fileExists($gitPath . '/.git') === false) { |
|
44 | 44 | $this->context->buildViolation($constraint->message) |
45 | 45 | ->atPath('path') |
46 | 46 | ->addViolation(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | ->addViolation(); |
56 | 56 | } |
57 | 57 | } else { |
58 | - if (file_exists($gitPath.'/.git') === false) { |
|
58 | + if (file_exists($gitPath . '/.git') === false) { |
|
59 | 59 | $this->context->buildViolation($constraint->message) |
60 | 60 | ->atPath('path') |
61 | 61 | ->addViolation(); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | if (!$input->getArgument('username')) { |
82 | 82 | $question = new Question('Please choose a username:'); |
83 | - $question->setValidator(function ($username) { |
|
83 | + $question->setValidator(function($username) { |
|
84 | 84 | if (empty($username)) { |
85 | 85 | throw new \Exception('Username can not be empty'); |
86 | 86 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | if (!$input->getArgument('email')) { |
94 | 94 | $question = new Question('Please choose an email:'); |
95 | - $question->setValidator(function ($email) { |
|
95 | + $question->setValidator(function($email) { |
|
96 | 96 | if (empty($email)) { |
97 | 97 | throw new \Exception('Email can not be empty'); |
98 | 98 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | if (!$input->getArgument('password')) { |
106 | 106 | $question = new Question('Please choose a password:'); |
107 | - $question->setValidator(function ($password) { |
|
107 | + $question->setValidator(function($password) { |
|
108 | 108 | if (empty($password)) { |
109 | 109 | throw new \Exception('Password can not be empty'); |
110 | 110 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | if (!$input->getArgument('name')) { |
119 | 119 | $question = new Question('Please choose a display name:'); |
120 | - $question->setValidator(function ($name) { |
|
120 | + $question->setValidator(function($name) { |
|
121 | 121 | if (empty($name)) { |
122 | 122 | throw new \Exception('Display name can not be empty'); |
123 | 123 | } |
@@ -166,7 +166,7 @@ |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | $output->writeln(sprintf('Clearing cache for directory <info>%s</info>', $this->cacheDir)); |
169 | - $oldCacheDir = $this->cacheDir.'_old'; |
|
169 | + $oldCacheDir = $this->cacheDir . '_old'; |
|
170 | 170 | |
171 | 171 | if ($this->filesystem->exists($oldCacheDir)) { |
172 | 172 | $this->filesystem->remove($oldCacheDir); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | //Get merge conflicts |
77 | 77 | $conflictFileNames = $this->gitCommands->command('diff')->getConflictFileNames(); |
78 | 78 | |
79 | - $files = $this->filterConflicts($files,$conflictFileNames); |
|
79 | + $files = $this->filterConflicts($files, $conflictFileNames); |
|
80 | 80 | |
81 | 81 | $commitEntity = new Commit(); |
82 | 82 | $commitEntity->setProject($this->project); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | //Get merge conflicts |
113 | 113 | $conflictFileNames = $this->gitCommands->command('diff')->getConflictFileNames(); |
114 | - $files = $this->filterConflicts($files,$conflictFileNames); |
|
114 | + $files = $this->filterConflicts($files, $conflictFileNames); |
|
115 | 115 | |
116 | 116 | $commitEntity = new Commit(); |
117 | 117 | $commitEntity->setProject($this->project); |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | $this->handleIssue($commitEntity); |
147 | 147 | |
148 | 148 | $user = $this->get('security.token_storage')->getToken()->getUser(); |
149 | - $author = $user->getName().' <'.$user->getEmail().'>'; |
|
149 | + $author = $user->getName() . ' <' . $user->getEmail() . '>'; |
|
150 | 150 | //Git Commit |
151 | 151 | $this->gitCommitCommand->commit($commitEntity->getComment(), $author); |
152 | 152 | |
153 | 153 | //Set notice of successfull commit |
154 | - $this->get('session')->getFlashBag()->add('notice', $filesCommited.' files have been committed'); |
|
154 | + $this->get('session')->getFlashBag()->add('notice', $filesCommited . ' files have been committed'); |
|
155 | 155 | |
156 | 156 | $this->get('session')->getFlashBag()->add('status-refresh', 'true'); |
157 | 157 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $issueEntity = $this->issueRepository->findIssueById($issueId); |
248 | 248 | if ($issueEntity) { |
249 | 249 | $issueAction = $commitEntity->getIssueAction(); |
250 | - $commitMessage = $issueAction.' #'.$issueEntity->getId().':'.$commitMessage; |
|
250 | + $commitMessage = $issueAction . ' #' . $issueEntity->getId() . ':' . $commitMessage; |
|
251 | 251 | $commitEntity->setComment($commitMessage); |
252 | 252 | if (in_array($issueAction, $issueCloseStatus)) { |
253 | 253 | //Close Issue |
@@ -316,17 +316,17 @@ discard block |
||
316 | 316 | * @param array $conflictedFiles |
317 | 317 | * @return type |
318 | 318 | */ |
319 | - public function filterConflicts($files,$conflictedFiles){ |
|
319 | + public function filterConflicts($files, $conflictedFiles) { |
|
320 | 320 | |
321 | 321 | //Get merge conflicts |
322 | 322 | $conflictFileNames = $this->gitCommands->command('diff')->getConflictFileNames(); |
323 | - if(count($conflictFileNames) > 0){ |
|
323 | + if (count($conflictFileNames) > 0) { |
|
324 | 324 | $conflictedFiles = array(); |
325 | - foreach($files as $file){ |
|
326 | - if(($file->getIndexStatus() == 'U' || $file->getWorkTreeStatus() == 'U') |
|
325 | + foreach ($files as $file) { |
|
326 | + if (($file->getIndexStatus() == 'U' || $file->getWorkTreeStatus() == 'U') |
|
327 | 327 | || ($file->getIndexStatus() == 'D' && $file->getWorkTreeStatus() == 'D') |
328 | 328 | || ($file->getIndexStatus() == 'A' && $file->getWorkTreeStatus() == 'A') |
329 | - ){ |
|
329 | + ) { |
|
330 | 330 | $conflictedFiles[] = $file; |
331 | 331 | } |
332 | 332 | } |
@@ -398,18 +398,18 @@ discard block |
||
398 | 398 | * @ProjectAccess(grantType="EDIT") |
399 | 399 | * @Template() |
400 | 400 | */ |
401 | - public function fixedConflictAction($filePath,$option) |
|
401 | + public function fixedConflictAction($filePath, $option) |
|
402 | 402 | { |
403 | 403 | $file = urldecode($filePath); |
404 | 404 | try { |
405 | 405 | $gitUndoCommand = $this->gitCommands->command('undo'); |
406 | - if($option === 'theirs'){ |
|
406 | + if ($option === 'theirs') { |
|
407 | 407 | $response = $gitUndoCommand->checkoutTheirFile($file); |
408 | - }elseif($option === 'ours'){ |
|
408 | + }elseif ($option === 'ours') { |
|
409 | 409 | $response = $gitUndoCommand->checkoutOurFile($file); |
410 | - }elseif($option === 'delete'){ |
|
410 | + }elseif ($option === 'delete') { |
|
411 | 411 | $response = $gitUndoCommand->deleteFile($file); |
412 | - }else{ |
|
412 | + } else { |
|
413 | 413 | $response = $gitUndoCommand->addFile($file); |
414 | 414 | } |
415 | 415 |
@@ -251,7 +251,7 @@ |
||
251 | 251 | ->add('branch', ChoiceType::class, array( |
252 | 252 | 'label' => 'Branch', 'choices' => $branchChoices, 'preferred_choices' => array($currentBranch), 'data' => trim($currentBranch), 'required' => false, 'choices_as_values' => true, 'constraints' => array( |
253 | 253 | //new NotBlank() |
254 | - ), ) |
|
254 | + ),) |
|
255 | 255 | ) |
256 | 256 | ->add('filter', HiddenType::class) |
257 | 257 | ->add('keyword', TextType::class, array('required' => false)) |
@@ -220,12 +220,12 @@ discard block |
||
220 | 220 | ->add('remoteName', TextType::class, array( |
221 | 221 | 'label' => 'Remote Name', 'required' => false, 'constraints' => array( |
222 | 222 | new NotBlank(), |
223 | - ), ) |
|
223 | + ),) |
|
224 | 224 | ) |
225 | 225 | ->add('remoteUrl', TextType::class, array( |
226 | 226 | 'label' => 'Remote Url', 'required' => false, 'constraints' => array( |
227 | 227 | new NotBlank(), |
228 | - ), ) |
|
228 | + ),) |
|
229 | 229 | )->add('submit', SubmitType::class, array('label' => 'Add')) |
230 | 230 | |
231 | 231 | ->getForm(); |
@@ -242,12 +242,12 @@ discard block |
||
242 | 242 | ->add('remoteName', HiddenType::class, array( |
243 | 243 | 'constraints' => array( |
244 | 244 | new NotBlank(), |
245 | - ), ) |
|
245 | + ),) |
|
246 | 246 | ) |
247 | 247 | ->add('newRemoteName', TextType::class, array( |
248 | 248 | 'label' => 'New Remote Name', 'required' => false, 'constraints' => array( |
249 | 249 | new NotBlank(), |
250 | - ), ) |
|
250 | + ),) |
|
251 | 251 | )->add('submit', SubmitType::class, array('label' => 'Rename')) |
252 | 252 | |
253 | 253 | ->getForm(); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $form->add('remotename', HiddenType::class, array( |
133 | 133 | 'label' => 'Remote Branch Name', 'required' => true, 'constraints' => array( |
134 | 134 | new NotBlank(), |
135 | - ), ) |
|
135 | + ),) |
|
136 | 136 | ); |
137 | 137 | |
138 | 138 | return array_merge($this->viewVariables, array( |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $form->add('remotename', HiddenType::class, array( |
160 | 160 | 'label' => 'Remote Branch Name', 'required' => true, 'constraints' => array( |
161 | 161 | new NotBlank(), |
162 | - ), ) |
|
162 | + ),) |
|
163 | 163 | ); |
164 | 164 | |
165 | 165 | $form->handleRequest($request); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | ->add('name', TextType::class, array( |
247 | 247 | 'label' => 'Branch Name', 'required' => true, 'constraints' => array( |
248 | 248 | new NotBlank(), |
249 | - ), ) |
|
249 | + ),) |
|
250 | 250 | ) |
251 | 251 | ->add('switch', CheckboxType::class, array( |
252 | 252 | 'label' => 'Switch to branch on creation', 'required' => false, |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | { |
272 | 272 | try { |
273 | 273 | $user = $this->get('security.token_storage')->getToken()->getUser(); |
274 | - $author = $user->getName().' <'.$user->getEmail().'>'; |
|
274 | + $author = $user->getName() . ' <' . $user->getEmail() . '>'; |
|
275 | 275 | $response = $this->gitCommands->command('branch')->mergeBranch($branchName); |
276 | 276 | $this->get('session')->getFlashBag()->add('notice', $response); |
277 | 277 | } catch (\Exception $e) { |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | ->add('branch', ChoiceType::class, array( |
313 | 313 | 'choices' => $branches, 'label' => 'Branch Name', 'required' => true, 'choices_as_values' => true, 'constraints' => array( |
314 | 314 | new NotBlank(), |
315 | - ), ) |
|
315 | + ),) |
|
316 | 316 | ) |
317 | 317 | ->getForm(); |
318 | 318 |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | $readme = ''; |
50 | 50 | foreach ($files as $file) { |
51 | 51 | if (strtolower($file->getExtension()) == 'md' || strtolower($file->getExtension()) == 'markdown') { |
52 | - if(strtolower($file->getFilename()) === 'readme' ){ |
|
52 | + if (strtolower($file->getFilename()) === 'readme') { |
|
53 | 53 | $readme = $this->gitFilesCommands->readFile($file); |
54 | 54 | break; |
55 | - }else{ |
|
55 | + } else { |
|
56 | 56 | //Get last md file |
57 | 57 | $readme = $this->gitFilesCommands->readFile($file); |
58 | 58 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | if (trim($pathInfo['dirname']) && $pathInfo['dirname'] != '.') { |
137 | 137 | $currentDir = $pathInfo['dirname']; |
138 | - $params['currentDir'] = $currentDir.'/'; |
|
138 | + $params['currentDir'] = $currentDir . '/'; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | try { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if ($form->isValid()) { |
70 | 70 | $issueLabel = $this->issueLabelRepository->createLabel($issueLabel); |
71 | 71 | |
72 | - $this->get('session')->getFlashBag()->add('notice', 'New Issue label Created '.$issueLabel->getId().'.'); |
|
72 | + $this->get('session')->getFlashBag()->add('notice', 'New Issue label Created ' . $issueLabel->getId() . '.'); |
|
73 | 73 | |
74 | 74 | $this->get('session')->getFlashBag()->add('info', 'It may take a minute or two before you can see the new label in the list below'); |
75 | 75 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | if ($editForm->isValid()) { |
187 | 187 | $this->issueLabelRepository->updateLabel($issueLabel); |
188 | 188 | |
189 | - $this->get('session')->getFlashBag()->add('notice', "Issue label Update '".$issueLabel->getId()."'."); |
|
189 | + $this->get('session')->getFlashBag()->add('notice', "Issue label Update '" . $issueLabel->getId() . "'."); |
|
190 | 190 | //$this->get('session')->getFlashBag()->add('info', "It may take a minute or two before you can see the updated label in the list below"); |
191 | 191 | |
192 | 192 | return $this->redirect($this->generateUrl('issuelabels', array('id' => $this->project->getId()))); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $this->issueLabelRepository->deleteLabel($labelId); |
210 | 210 | } |
211 | 211 | |
212 | - $this->get('session')->getFlashBag()->add('notice', "Issue label '".$labelId."' has been deleted"); |
|
212 | + $this->get('session')->getFlashBag()->add('notice', "Issue label '" . $labelId . "' has been deleted"); |
|
213 | 213 | |
214 | 214 | return $this->redirect($this->generateUrl('issuelabels', array('id' => $this->project->getId()))); |
215 | 215 | } |