@@ -37,20 +37,20 @@ discard block |
||
37 | 37 | ->add('description', TextareaType::class) |
38 | 38 | ->add('issueMilestone', 'choice', array( |
39 | 39 | 'choices' => $this->getIssueMilestoneChoices(), |
40 | - 'multiple' => false, // Multiple selection allowed |
|
40 | + 'multiple' => false, // Multiple selection allowed |
|
41 | 41 | //'expanded' => true, // Render as checkboxes |
42 | 42 | 'placeholder' => 'Choose a milestone', |
43 | 43 | 'required' => false, |
44 | 44 | 'choices_as_values' => true, |
45 | 45 | //'property' => 'title', // Assuming that the entity has a "name" property |
46 | - 'choice_label' => function ($issueMilestone) { |
|
46 | + 'choice_label' => function($issueMilestone) { |
|
47 | 47 | if ($issueMilestone) { |
48 | 48 | return $issueMilestone->getTitle(); |
49 | 49 | } |
50 | 50 | |
51 | 51 | return; |
52 | 52 | }, |
53 | - 'choice_value' => function ($issueMilestone) { |
|
53 | + 'choice_value' => function($issueMilestone) { |
|
54 | 54 | if ($issueMilestone) { |
55 | 55 | return $issueMilestone->getId(); |
56 | 56 | } |
@@ -71,20 +71,20 @@ discard block |
||
71 | 71 | //->add('verUser') |
72 | 72 | ->add('issueLabel', ChoiceType::class, array( |
73 | 73 | 'choices' => $this->getIssueLabelChoices(), |
74 | - 'multiple' => true, // Multiple selection allowed |
|
75 | - 'expanded' => true, // Render as checkboxes |
|
74 | + 'multiple' => true, // Multiple selection allowed |
|
75 | + 'expanded' => true, // Render as checkboxes |
|
76 | 76 | //'property' => 'title', // Assuming that the entity has a "name" property |
77 | 77 | //'class' => 'VersionControl\GitControlBundle\Entity\IssueLabel', |
78 | 78 | 'required' => false, |
79 | 79 | 'choices_as_values' => true, |
80 | - 'choice_label' => function ($issueLabel) { |
|
80 | + 'choice_label' => function($issueLabel) { |
|
81 | 81 | if ($issueLabel) { |
82 | 82 | return $issueLabel->getTitle(); |
83 | 83 | } |
84 | 84 | |
85 | 85 | return; |
86 | 86 | }, |
87 | - 'choice_value' => function ($issueLabel) { |
|
87 | + 'choice_value' => function($issueLabel) { |
|
88 | 88 | if ($issueLabel) { |
89 | 89 | return $issueLabel->getId(); |
90 | 90 | } |
@@ -38,20 +38,20 @@ discard block |
||
38 | 38 | ) |
39 | 39 | ->add('issueMilestone', ChoiceType::class, array( |
40 | 40 | 'choices' => $this->getIssueMilestoneChoices(), |
41 | - 'multiple' => false, // Multiple selection allowed |
|
41 | + 'multiple' => false, // Multiple selection allowed |
|
42 | 42 | //'expanded' => true, // Render as checkboxes |
43 | 43 | 'placeholder' => 'Choose a milestone', |
44 | 44 | 'required' => false, |
45 | 45 | 'choices_as_values' => true, |
46 | 46 | //'property' => 'title', // Assuming that the entity has a "name" property |
47 | - 'choice_label' => function ($issueMilestone) { |
|
47 | + 'choice_label' => function($issueMilestone) { |
|
48 | 48 | if ($issueMilestone) { |
49 | 49 | return $issueMilestone->getTitle(); |
50 | 50 | } |
51 | 51 | |
52 | 52 | return; |
53 | 53 | }, |
54 | - 'choice_value' => function ($issueMilestone) { |
|
54 | + 'choice_value' => function($issueMilestone) { |
|
55 | 55 | if ($issueMilestone) { |
56 | 56 | return $issueMilestone->getId(); |
57 | 57 | } |
@@ -68,20 +68,20 @@ discard block |
||
68 | 68 | )) |
69 | 69 | ->add('issueLabel', ChoiceType::class, array( |
70 | 70 | 'choices' => $this->getIssueLabelChoices(), |
71 | - 'multiple' => true, // Multiple selection allowed |
|
72 | - 'expanded' => true, // Render as checkboxes |
|
71 | + 'multiple' => true, // Multiple selection allowed |
|
72 | + 'expanded' => true, // Render as checkboxes |
|
73 | 73 | //'property' => 'title', // Assuming that the entity has a "name" property |
74 | 74 | //'class' => 'VersionControl\GitControlBundle\Entity\IssueLabel', |
75 | 75 | 'required' => false, |
76 | 76 | 'choices_as_values' => true, |
77 | - 'choice_label' => function ($issueLabel) { |
|
77 | + 'choice_label' => function($issueLabel) { |
|
78 | 78 | if ($issueLabel) { |
79 | 79 | return $issueLabel->getTitle(); |
80 | 80 | } |
81 | 81 | |
82 | 82 | return; |
83 | 83 | }, |
84 | - 'choice_value' => function ($issueLabel) { |
|
84 | + 'choice_value' => function($issueLabel) { |
|
85 | 85 | if ($issueLabel) { |
86 | 86 | return $issueLabel->getId(); |
87 | 87 | } |
@@ -219,7 +219,7 @@ |
||
219 | 219 | */ |
220 | 220 | protected function setGitPath($gitPath) |
221 | 221 | { |
222 | - $this->gitPath = rtrim(trim($gitPath), DIRECTORY_SEPARATOR ); |
|
222 | + $this->gitPath = rtrim(trim($gitPath), DIRECTORY_SEPARATOR); |
|
223 | 223 | |
224 | 224 | return $this; |
225 | 225 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $output = $this->command->runCommand(sprintf('git branch %s', escapeshellarg($branchName))); |
153 | 153 | |
154 | 154 | if ($switchToBranch) { |
155 | - $output .= $this->command->runCommand(sprintf('git checkout %s 2>&1', escapeshellarg($branchName))); |
|
155 | + $output .= $this->command->runCommand(sprintf('git checkout %s 2>&1', escapeshellarg($branchName))); |
|
156 | 156 | |
157 | 157 | //Trigger file alter Event |
158 | 158 | $this->triggerGitAlterFilesEvent(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $output = $this->command->runCommand(sprintf('git branch %s %s 2>&1', escapeshellarg($branchName), escapeshellarg($remoteBranchName))); |
181 | 181 | |
182 | 182 | if ($switchToBranch) { |
183 | - $output .= $this->command->runCommand(sprintf('git checkout %s 2>&1', escapeshellarg($branchName))); |
|
183 | + $output .= $this->command->runCommand(sprintf('git checkout %s 2>&1', escapeshellarg($branchName))); |
|
184 | 184 | //Trigger file alter Event |
185 | 185 | $this->triggerGitAlterFilesEvent(); |
186 | 186 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | public function checkoutBranch($branchName) |
249 | 249 | { |
250 | - $response = $this->command->runCommand(sprintf('git checkout %s 2>&1', escapeshellarg($branchName))); |
|
250 | + $response = $this->command->runCommand(sprintf('git checkout %s 2>&1', escapeshellarg($branchName))); |
|
251 | 251 | |
252 | 252 | //Trigger file alter Event |
253 | 253 | $this->triggerGitAlterFilesEvent(); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $deleteFlag = '-d'; |
279 | 279 | } |
280 | 280 | |
281 | - return $this->command->runCommand(sprintf('git branch '.$deleteFlag.' %s 2>&1', escapeshellarg($branchName))); |
|
281 | + return $this->command->runCommand(sprintf('git branch '.$deleteFlag.' %s 2>&1', escapeshellarg($branchName))); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | if ($branchName === $currentBranch) { |
296 | 296 | throw new \Exception('You cannot merge a branch with itself. Please checkout a different branch before trying to merge.'); |
297 | 297 | } |
298 | - $response = $this->command->runCommand(sprintf('git merge --no-ff %s 2>&1', escapeshellarg($branchName))); |
|
298 | + $response = $this->command->runCommand(sprintf('git merge --no-ff %s 2>&1', escapeshellarg($branchName))); |
|
299 | 299 | |
300 | 300 | //Trigger file alter Event |
301 | 301 | $this->triggerGitAlterFilesEvent(); |
@@ -128,7 +128,7 @@ |
||
128 | 128 | * Get array of conflict file names |
129 | 129 | * @return array of conflict file names |
130 | 130 | */ |
131 | - public function getConflictFileNames(){ |
|
131 | + public function getConflictFileNames() { |
|
132 | 132 | |
133 | 133 | $command = " git diff --name-only --diff-filter=U"; |
134 | 134 | $response = $this->command->runCommand($command); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | protected function sortFilesByDirectoryThenName(array &$fileArray) |
122 | 122 | { |
123 | - usort($fileArray, function ($a, $b) { |
|
123 | + usort($fileArray, function($a, $b) { |
|
124 | 124 | if ($a->isDir()) { |
125 | 125 | if ($b->isDir()) { |
126 | 126 | return strnatcasecmp($a->getFilename(), $b->getFilename()); |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | $response = ''; |
349 | 349 | if ($this->fileExists($filePath)) { |
350 | 350 | |
351 | - if($this->isFileTracked($filePath)){ |
|
351 | + if ($this->isFileTracked($filePath)) { |
|
352 | 352 | throw new \VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException('File path is been tracked. Please untrack file first'); |
353 | 353 | } |
354 | 354 | |
355 | - if($this->isFileIgnored($filePath) === false){ |
|
355 | + if ($this->isFileIgnored($filePath) === false) { |
|
356 | 356 | $response = $this->addToGitIgnore($filePath); |
357 | - }else { |
|
357 | + } else { |
|
358 | 358 | throw new \VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException('File path is already ignored'); |
359 | 359 | } |
360 | 360 | |
@@ -382,15 +382,15 @@ discard block |
||
382 | 382 | $response = ''; |
383 | 383 | if ($this->fileExists($filePath)) { |
384 | 384 | |
385 | - if($this->isFileTracked($filePath)){ |
|
385 | + if ($this->isFileTracked($filePath)) { |
|
386 | 386 | $statusCount = $this->command->command('commit')->countStatus(); |
387 | - if($statusCount <= 0){ |
|
387 | + if ($statusCount <= 0) { |
|
388 | 388 | $response .= $this->command->runCommand(sprintf('git rm --cached %s', escapeshellarg($filePath))); |
389 | 389 | $response .= "\n Please commit to complete the removal of this file from git index"; |
390 | - }else{ |
|
390 | + } else { |
|
391 | 391 | throw new \VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException('Please commit all files first'); |
392 | 392 | } |
393 | - }else{ |
|
393 | + } else { |
|
394 | 394 | throw new \VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException('File path is not been tracked'); |
395 | 395 | } |
396 | 396 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $tags = $this->command->runCommand($command); |
39 | 39 | $lines = $this->splitOnNewLine($tags, true); |
40 | 40 | |
41 | - foreach ($lines as $line){ |
|
41 | + foreach ($lines as $line) { |
|
42 | 42 | $tagEntities[] = new GitTag($line); |
43 | 43 | } |
44 | 44 | |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return string command response |
58 | 58 | */ |
59 | - public function createAnnotatedTag($version, $message, $commitShortCode = false ) |
|
59 | + public function createAnnotatedTag($version, $message, $commitShortCode = false) |
|
60 | 60 | { |
61 | 61 | if ($this->validateTagName($version)) { |
62 | 62 | $command = sprintf('git tag -a %s -m %s', escapeshellarg($version), escapeshellarg($message)); |
63 | - if($commitShortCode){ |
|
63 | + if ($commitShortCode) { |
|
64 | 64 | $command .= ' '.escapeshellarg($commitShortCode); |
65 | 65 | } |
66 | 66 | $output = $this->command->runCommand($command); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function cloneRepository($repo) |
51 | 51 | { |
52 | - $response = $this->command->runCommand(sprintf('git clone %s . 2>&1', escapeshellarg($repo))); |
|
52 | + $response = $this->command->runCommand(sprintf('git clone %s . 2>&1', escapeshellarg($repo))); |
|
53 | 53 | |
54 | 54 | return $response; |
55 | 55 | } |
@@ -72,7 +72,7 @@ |
||
72 | 72 | $response = $this->command->runCommand(sprintf('git checkout %s %s', escapeshellarg($commitHash), escapeshellarg($file))); |
73 | 73 | |
74 | 74 | //Trigger file alter Event |
75 | - if($triggerGitAlterFilesEvent === true){ |
|
75 | + if ($triggerGitAlterFilesEvent === true) { |
|
76 | 76 | $this->triggerGitAlterFilesEvent(); |
77 | 77 | } |
78 | 78 |