@@ -67,7 +67,7 @@ |
||
| 67 | 67 | foreach ($matches as $commitHash) { |
| 68 | 68 | if ($this->validateCommitHash($commitHash)) { |
| 69 | 69 | $url = $this->generateCommitHistoryUrl($commitHash, $projectId); |
| 70 | - $link = '<a href="'.$url.'" title="Related to Commit Hash '.$commitHash.'">'.$commitHash.'</a>'; |
|
| 70 | + $link = '<a href="' . $url . '" title="Related to Commit Hash ' . $commitHash . '">' . $commitHash . '</a>'; |
|
| 71 | 71 | $text = str_replace($commitHash, $link, $text); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -135,12 +135,12 @@ |
||
| 135 | 135 | $listPages = ''; |
| 136 | 136 | for ($i = ($this->currentPage - $this->midRange); $i < (($this->currentPage + $this->midRange) + 1); ++$i) { |
| 137 | 137 | if (($i > 0) && ($i <= $this->numPages)) { // if page number are within page range |
| 138 | - if ($i == $this->currentPage) { |
|
| 139 | - $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 140 | - } // if we're on current page |
|
| 141 | - else { |
|
| 142 | - $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 143 | - } // if not current page |
|
| 138 | + if ($i == $this->currentPage) { |
|
| 139 | + $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 140 | + } // if we're on current page |
|
| 141 | + else { |
|
| 142 | + $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 143 | + } // if not current page |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if ($totalRecords > 0) { |
| 81 | 81 | $this->numPages = ceil($totalRecords / $recordsPerPage); |
| 82 | 82 | $this->currentPage = $currentPage; |
| 83 | - $content = '<nav><ul class="pagination">'.$this->firstPage().$this->prevPage().$this->listPages().$this->nextPage().$this->lastPage().'</ul></nav>'; |
|
| 83 | + $content = '<nav><ul class="pagination">' . $this->firstPage() . $this->prevPage() . $this->listPages() . $this->nextPage() . $this->lastPage() . '</ul></nav>'; |
|
| 84 | 84 | } else { |
| 85 | 85 | $content = ''; |
| 86 | 86 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if ($this->currentPage > 1) { |
| 94 | 94 | $prevPage = ($this->currentPage - 1); |
| 95 | 95 | |
| 96 | - return '<li><a href="'.$this->generateUrl($prevPage).'" class="prev">prev</a></li>'; |
|
| 96 | + return '<li><a href="' . $this->generateUrl($prevPage) . '" class="prev">prev</a></li>'; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | protected function nextPage() |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | if ($this->currentPage < $this->numPages) { |
| 102 | 102 | $nextPage = $this->currentPage + 1; |
| 103 | 103 | |
| 104 | - return '<li><a href="'.$this->generateUrl($nextPage).'" class="next">next</a></li>'; |
|
| 104 | + return '<li><a href="' . $this->generateUrl($nextPage) . '" class="next">next</a></li>'; |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | protected function firstPage() |
| 108 | 108 | { |
| 109 | 109 | $firstPage = ''; |
| 110 | 110 | if ($this->currentPage > ($this->midRange + 1)) { // if number of pages between "currentPage" and "firstPage" exceeds $midRange with 1... |
| 111 | - $firstPage .= '<li><a href="'.$this->generateUrl(1).'" class="first">First Page</a></li>'; // ...show "first page"-link |
|
| 111 | + $firstPage .= '<li><a href="' . $this->generateUrl(1) . '" class="first">First Page</a></li>'; // ...show "first page"-link |
|
| 112 | 112 | if ($this->currentPage > ($this->midRange + 2)) { // if number of pages between $currentPage and "first page" exceeds $midRange with more than 1 |
| 113 | 113 | //$firstPage .= '…'; // add "..." between "1st page"-link and first page in $range |
| 114 | 114 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (($this->currentPage < ($this->numPages - $this->midRange) - 1)) { // if number of pages between $currentPage and "last page" exceeds $range with more than two |
| 124 | 124 | //$lastPage .= '…'; // add "..." between "last page"-link and last page in $range |
| 125 | 125 | } |
| 126 | - $lastPage .= '<li><a href="'.$this->generateUrl($this->numPages).'" class="last">'.$this->numPages.'</a></li>'; // show "last page"-link |
|
| 126 | + $lastPage .= '<li><a href="' . $this->generateUrl($this->numPages) . '" class="last">' . $this->numPages . '</a></li>'; // show "last page"-link |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $lastPage; |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | for ($i = ($this->currentPage - $this->midRange); $i < (($this->currentPage + $this->midRange) + 1); ++$i) { |
| 137 | 137 | if (($i > 0) && ($i <= $this->numPages)) { // if page number are within page range |
| 138 | 138 | if ($i == $this->currentPage) { |
| 139 | - $listPages .= '<li class="active"><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 139 | + $listPages .= '<li class="active"><a href="' . $this->generateUrl($i) . '">' . $i . '</a></li>'; |
|
| 140 | 140 | } // if we're on current page |
| 141 | 141 | else { |
| 142 | - $listPages .= '<li><a href="'.$this->generateUrl($i).'">'.$i.'</a></li>'; |
|
| 142 | + $listPages .= '<li><a href="' . $this->generateUrl($i) . '">' . $i . '</a></li>'; |
|
| 143 | 143 | } // if not current page |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | if ($projectEnvironment->getSsh() === true) { |
| 42 | 42 | $this->sftpProcess->setGitEnviroment($projectEnvironment); |
| 43 | 43 | try { |
| 44 | - if ($this->sftpProcess->fileExists($gitPath.'/.git') === true) { |
|
| 44 | + if ($this->sftpProcess->fileExists($gitPath . '/.git') === true) { |
|
| 45 | 45 | $this->context->buildViolation($constraint->message) |
| 46 | 46 | ->atPath('path') |
| 47 | 47 | ->addViolation(); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ->addViolation(); |
| 57 | 57 | } |
| 58 | 58 | } else { |
| 59 | - if (file_exists($gitPath.'/.git') === true) { |
|
| 59 | + if (file_exists($gitPath . '/.git') === true) { |
|
| 60 | 60 | $this->context->buildViolation($constraint->message) |
| 61 | 61 | ->atPath('path') |
| 62 | 62 | ->addViolation(); |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | try { |
| 43 | 43 | if ($this->sftpProcess->fileExists($gitPath.'/.git') === false) { |
| 44 | 44 | $this->context->buildViolation($constraint->message) |
| 45 | - ->atPath('path') |
|
| 46 | - ->addViolation(); |
|
| 45 | + ->atPath('path') |
|
| 46 | + ->addViolation(); |
|
| 47 | 47 | } |
| 48 | 48 | } catch (SshLoginException $sshLoginException) { |
| 49 | 49 | $this->context->buildViolation($sshLoginException->getMessage()) |
@@ -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); |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | { |
| 140 | 140 | $form = $this->createFormBuilder(array(), array( |
| 141 | 141 | 'method' => 'POST', |
| 142 | - )) |
|
| 142 | + )) |
|
| 143 | 143 | ->add('roles', ChoiceType::class, array( |
| 144 | 144 | 'label' => 'User Role', 'choices' => array('Reporter' => 'Reporter', 'Developer' => 'Developer', 'Master' => 'Master'), 'required' => false, 'placeholder' => 'Please select a role', 'choices_as_values' => true, 'constraints' => array( |
| 145 | 145 | new NotBlank(), |
@@ -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 | |
@@ -405,11 +405,11 @@ |
||
| 405 | 405 | $gitUndoCommand = $this->gitCommands->command('undo'); |
| 406 | 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)) |