@@ -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 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | |
75 | 75 | if (null !== $this->logger) { |
76 | 76 | $message = sprintf('%s (%s) %0.2f ms', $command, $method, $time * 1000); |
77 | - $this->logger->info($message, (array)$data); |
|
77 | + $this->logger->info($message, (array) $data); |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 |
@@ -148,7 +148,7 @@ |
||
148 | 148 | */ |
149 | 149 | protected function sortFilesByDirectoryThenName(array &$fileArray): void |
150 | 150 | { |
151 | - usort($fileArray, static function (FileInfoInterface $a, FileInfoInterface $b) { |
|
151 | + usort($fileArray, static function(FileInfoInterface $a, FileInfoInterface $b) { |
|
152 | 152 | if ($a->isDir()) { |
153 | 153 | if ($b->isDir()) { |
154 | 154 | return strnatcasecmp($a->getFilename(), $b->getFilename()); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function getDiffFile($filename) |
70 | 70 | { |
71 | - $diffString = $this->command->runCommand('git --no-pager diff --oneline '.escapeshellarg($filename).''); |
|
71 | + $diffString = $this->command->runCommand('git --no-pager diff --oneline ' . escapeshellarg($filename) . ''); |
|
72 | 72 | $diffParser = new GitDiffParser($diffString); |
73 | 73 | return $diffParser->parse(); |
74 | 74 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function getDiffFileBetweenCommits($filename, $previousCommitHash, $commitHash) |
88 | 88 | { |
89 | - $diffString = $this->command->runCommand('git --no-pager diff --oneline '.escapeshellarg($previousCommitHash).' '.escapeshellarg($commitHash).' -- '.escapeshellarg($filename).''); |
|
89 | + $diffString = $this->command->runCommand('git --no-pager diff --oneline ' . escapeshellarg($previousCommitHash) . ' ' . escapeshellarg($commitHash) . ' -- ' . escapeshellarg($filename) . ''); |
|
90 | 90 | $diffParser = new GitDiffParser($diffString); |
91 | 91 | return $diffParser->parse(); |
92 | 92 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function getFilesInCommit($commitHash) |
103 | 103 | { |
104 | - $response = $this->command->runCommand('git diff-tree --no-commit-id --name-status -r '.escapeshellarg($commitHash).''); |
|
104 | + $response = $this->command->runCommand('git diff-tree --no-commit-id --name-status -r ' . escapeshellarg($commitHash) . ''); |
|
105 | 105 | $responseLines = $this->splitOnNewLine($response); |
106 | 106 | $files = new GitCommitFileCollection(); |
107 | 107 | foreach ($responseLines as $line) { |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | public function getPreviousCommitHash($commitHash = 'HEAD', $fileName = false) |
125 | 125 | { |
126 | 126 | $previousCommitHash = ''; |
127 | - $command = " git log --pretty=format:'%h' -n 2 ".escapeshellarg($commitHash).''; |
|
127 | + $command = " git log --pretty=format:'%h' -n 2 " . escapeshellarg($commitHash) . ''; |
|
128 | 128 | if ($fileName !== false) { |
129 | - $command .= ' '.escapeshellarg($fileName); |
|
129 | + $command .= ' ' . escapeshellarg($fileName); |
|
130 | 130 | } |
131 | 131 | $response = $this->command->runCommand($command); |
132 | 132 | $responseLines = $this->splitOnNewLine($response); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @throws RunGitCommandException |
145 | 145 | * @throws RuntimeException |
146 | 146 | */ |
147 | - public function getConflictFileNames(){ |
|
147 | + public function getConflictFileNames() { |
|
148 | 148 | |
149 | 149 | $command = ' git diff --name-only --diff-filter=U'; |
150 | 150 | $response = $this->command->runCommand($command); |
@@ -185,7 +185,7 @@ |
||
185 | 185 | { |
186 | 186 | $this->logCommand = 'git --no-pager log -m "--pretty=format:\'' . $this->format . '\'"'; |
187 | 187 | if ($this->logCount) { |
188 | - $this->logCommand .= ' -' . (int)$this->logCount . ' '; |
|
188 | + $this->logCommand .= ' -' . (int) $this->logCount . ' '; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | if ($this->showReferences === true) { |
@@ -311,7 +311,7 @@ |
||
311 | 311 | $currentBranch = $this->getCurrentBranch(); |
312 | 312 | if ($branchName === $currentBranch) { |
313 | 313 | throw new RuntimeException( |
314 | - 'You cannot merge a branch with itself. Please checkout a '. |
|
314 | + 'You cannot merge a branch with itself. Please checkout a ' . |
|
315 | 315 | 'different branch before trying to merge.' |
316 | 316 | ); |
317 | 317 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | throw new InvalidBranchNameException('This is not a valid branch name'); |
66 | 66 | } |
67 | 67 | |
68 | - $command = sprintf($this->initGitCommand().' tag -a %s -m %s', escapeshellarg($version), escapeshellarg($message)); |
|
68 | + $command = sprintf($this->initGitCommand() . ' tag -a %s -m %s', escapeshellarg($version), escapeshellarg($message)); |
|
69 | 69 | if ($commitShortCode) { |
70 | 70 | $command .= ' ' . escapeshellarg($commitShortCode); |
71 | 71 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function pushTag($remote, $tag): string |
87 | 87 | { |
88 | - $command = sprintf($this->initGitCommand().' push %s %s', escapeshellarg(trim($remote)), escapeshellarg(trim($tag))); |
|
88 | + $command = sprintf($this->initGitCommand() . ' push %s %s', escapeshellarg(trim($remote)), escapeshellarg(trim($tag))); |
|
89 | 89 | |
90 | 90 | return $this->command->runCommand($command); |
91 | 91 | } |
@@ -108,8 +108,7 @@ |
||
108 | 108 | $path = $this->path; |
109 | 109 | |
110 | 110 | $filename = $folder == null ? |
111 | - $path . DIRECTORY_SEPARATOR . $name : |
|
112 | - $path . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $name; |
|
111 | + $path . DIRECTORY_SEPARATOR . $name : $path . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $name; |
|
113 | 112 | $handle = fopen($filename, 'wb'); |
114 | 113 | $fileContent = $content == null ? 'test content' : $content; |
115 | 114 | $this->assertNotSame(false, fwrite($handle, $fileContent), sprintf('unable to write the file %s', $name)); |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | $this->updateFile('test', 'Test Data has changed'); |
38 | 38 | } |
39 | 39 | |
40 | - public function testGetPreviousCommitHash(){ |
|
40 | + public function testGetPreviousCommitHash() { |
|
41 | 41 | |
42 | 42 | $previousCommitHash = $this->gitCommands->command('diff')->getPreviousCommitHash(); |
43 | - $this->assertTrue(strlen($previousCommitHash) === 7,'Previous Commit hash does not equal 7 characters: '.$previousCommitHash); |
|
43 | + $this->assertTrue(strlen($previousCommitHash) === 7, 'Previous Commit hash does not equal 7 characters: ' . $previousCommitHash); |
|
44 | 44 | |
45 | 45 | } |
46 | 46 | |
@@ -52,26 +52,26 @@ discard block |
||
52 | 52 | |
53 | 53 | $diffs = $this->gitCommands->command('diff')->getDiffFile('test'); |
54 | 54 | |
55 | - $this->assertCount(1, $diffs,'Diff count does not equal expected 17. Actual:'.count($diffs).print_r($diffs,true)); |
|
55 | + $this->assertCount(1, $diffs, 'Diff count does not equal expected 17. Actual:' . count($diffs) . print_r($diffs, true)); |
|
56 | 56 | foreach ($diffs as $diff) { |
57 | 57 | $this->assertInstanceOf(GitDiff::class, $diff); |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | - public function testGetDiffFileBetweenCommits(){ |
|
61 | + public function testGetDiffFileBetweenCommits() { |
|
62 | 62 | |
63 | 63 | $previousCommitHash = $this->gitCommands->command('diff')->getPreviousCommitHash(); |
64 | 64 | |
65 | - $diffs = $this->gitCommands->command('diff')->getDiffFileBetweenCommits('test',$previousCommitHash,'HEAD'); |
|
65 | + $diffs = $this->gitCommands->command('diff')->getDiffFileBetweenCommits('test', $previousCommitHash, 'HEAD'); |
|
66 | 66 | foreach ($diffs as $diff) { |
67 | 67 | $this->assertInstanceOf(GitDiff::class, $diff); |
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | - public function testGetFilesInCommit(){ |
|
71 | + public function testGetFilesInCommit() { |
|
72 | 72 | $filesCommitted = $this->gitCommands->command('diff')->getFilesInCommit('HEAD'); |
73 | 73 | |
74 | - $this->assertCount(1, $filesCommitted,'Only one file should have been commited. Actual:'.count($filesCommitted)); |
|
74 | + $this->assertCount(1, $filesCommitted, 'Only one file should have been commited. Actual:' . count($filesCommitted)); |
|
75 | 75 | |
76 | 76 | foreach ($filesCommitted as $commitFile) { |
77 | 77 | $this->assertInstanceOf(GitCommitFile::class, $commitFile); |