@@ -58,7 +58,7 @@ |
||
58 | 58 | $diffParser = new GitDiffParser($diffString); |
59 | 59 | $diffs = $diffParser->parse(); |
60 | 60 | |
61 | - $this->assertCount(1, $diffs,'Diff count does not equal expected 17. Actual:'.count($diffs).print_r($diffs,true)); |
|
61 | + $this->assertCount(1, $diffs, 'Diff count does not equal expected 17. Actual:'.count($diffs).print_r($diffs, true)); |
|
62 | 62 | foreach ($diffs as $diff) { |
63 | 63 | $this->assertInstanceOf("\VersionControl\GitCommandBundle\Entity\GitDiff", $diff); |
64 | 64 | } |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | $this->updateFile('test', 'Test Data has changed'); |
36 | 36 | } |
37 | 37 | |
38 | - public function testGetPreviousCommitHash(){ |
|
38 | + public function testGetPreviousCommitHash() { |
|
39 | 39 | |
40 | 40 | $previousCommitHash = $this->gitCommands->command('diff')->getPreviousCommitHash(); |
41 | - $this->assertTrue((strlen($previousCommitHash) === 7),'Previous Commit hash does not equal 7 characters: '.$previousCommitHash); |
|
41 | + $this->assertTrue((strlen($previousCommitHash) === 7), 'Previous Commit hash does not equal 7 characters: '.$previousCommitHash); |
|
42 | 42 | |
43 | 43 | } |
44 | 44 | |
@@ -50,26 +50,26 @@ discard block |
||
50 | 50 | |
51 | 51 | $diffs = $this->gitCommands->command('diff')->getDiffFile('test'); |
52 | 52 | |
53 | - $this->assertCount(1, $diffs,'Diff count does not equal expected 17. Actual:'.count($diffs).print_r($diffs,true)); |
|
53 | + $this->assertCount(1, $diffs, 'Diff count does not equal expected 17. Actual:'.count($diffs).print_r($diffs, true)); |
|
54 | 54 | foreach ($diffs as $diff) { |
55 | 55 | $this->assertInstanceOf("\VersionControl\GitCommandBundle\Entity\GitDiff", $diff); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | - public function testGetDiffFileBetweenCommits(){ |
|
59 | + public function testGetDiffFileBetweenCommits() { |
|
60 | 60 | |
61 | 61 | $previousCommitHash = $this->gitCommands->command('diff')->getPreviousCommitHash(); |
62 | 62 | |
63 | - $diffs = $this->gitCommands->command('diff')->getDiffFileBetweenCommits('test',$previousCommitHash,'HEAD'); |
|
63 | + $diffs = $this->gitCommands->command('diff')->getDiffFileBetweenCommits('test', $previousCommitHash, 'HEAD'); |
|
64 | 64 | foreach ($diffs as $diff) { |
65 | 65 | $this->assertInstanceOf("\VersionControl\GitCommandBundle\Entity\GitDiff", $diff); |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - public function testGetFilesInCommit(){ |
|
69 | + public function testGetFilesInCommit() { |
|
70 | 70 | $filesCommitted = $this->gitCommands->command('diff')->getFilesInCommit('HEAD'); |
71 | 71 | |
72 | - $this->assertCount(1, $filesCommitted,'Only one file should have been commited. Actual:'.count($filesCommitted)); |
|
72 | + $this->assertCount(1, $filesCommitted, 'Only one file should have been commited. Actual:'.count($filesCommitted)); |
|
73 | 73 | |
74 | 74 | foreach ($filesCommitted as $commitFile) { |
75 | 75 | $this->assertInstanceOf("VersionControl\GitCommandBundle\Entity\GitCommitFile", $commitFile); |
@@ -64,7 +64,7 @@ |
||
64 | 64 | $this->assertEquals("fatal: tag 'tag1' already exists", trim($errorMessage), 'create branch command error'); |
65 | 65 | } |
66 | 66 | |
67 | - public function testPushTag() |
|
67 | + public function testPushTag() |
|
68 | 68 | { |
69 | 69 | $tagCommand = $this->gitCommands->command('tag'); |
70 | 70 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | public function testGetTagsNoTags() |
41 | 41 | { |
42 | 42 | $tags = $this->gitCommands->command('tag')->getTags(); |
43 | - $this->assertCount(0, $tags,'Tag count does not equal expected 0. Actual:'.count($tags)); |
|
43 | + $this->assertCount(0, $tags, 'Tag count does not equal expected 0. Actual:'.count($tags)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | { |
51 | 51 | $tagCommand = $this->gitCommands->command('tag'); |
52 | 52 | |
53 | - $this->assertEquals('', $tagCommand->createAnnotatedTag('tag1','Test of tag1'), 'create tag command'); |
|
53 | + $this->assertEquals('', $tagCommand->createAnnotatedTag('tag1', 'Test of tag1'), 'create tag command'); |
|
54 | 54 | |
55 | 55 | $tags = $this->gitCommands->command('tag')->getTags(); |
56 | - $this->assertCount(1, $tags,'Tag count does not equal expected 1. Actual:'.count($tags)); |
|
56 | + $this->assertCount(1, $tags, 'Tag count does not equal expected 1. Actual:'.count($tags)); |
|
57 | 57 | |
58 | 58 | $errorMessage = ''; |
59 | 59 | try { |
60 | - $tagCommand->createAnnotatedTag('tag1','Test of tag1'); |
|
60 | + $tagCommand->createAnnotatedTag('tag1', 'Test of tag1'); |
|
61 | 61 | } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\RunGitCommandException $e) { |
62 | 62 | $errorMessage = $e->getMessage(); |
63 | 63 | } |
@@ -68,12 +68,12 @@ discard block |
||
68 | 68 | { |
69 | 69 | $tagCommand = $this->gitCommands->command('tag'); |
70 | 70 | |
71 | - $this->assertEquals('', $tagCommand->createAnnotatedTag('tag1','Test of tag1'), 'create tag command'); |
|
71 | + $this->assertEquals('', $tagCommand->createAnnotatedTag('tag1', 'Test of tag1'), 'create tag command'); |
|
72 | 72 | |
73 | 73 | // |
74 | 74 | try { |
75 | - $this->assertEquals('', $tagCommand->pushTag('origin','tag1'), 'Push tag1 to origin'); |
|
76 | - }catch (\VersionControl\GitCommandBundle\GitCommands\Exception\RunGitCommandException $e) { |
|
75 | + $this->assertEquals('', $tagCommand->pushTag('origin', 'tag1'), 'Push tag1 to origin'); |
|
76 | + } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\RunGitCommandException $e) { |
|
77 | 77 | $errorMessage = $e->getMessage(); |
78 | 78 | } |
79 | 79 | $this->assertContains("fatal: 'origin' does not appear to be a git repository", trim($errorMessage), 'push tag command error'); |
@@ -73,7 +73,7 @@ |
||
73 | 73 | // |
74 | 74 | try { |
75 | 75 | $this->assertEquals('', $tagCommand->pushTag('origin','tag1'), 'Push tag1 to origin'); |
76 | - }catch (\VersionControl\GitCommandBundle\GitCommands\Exception\RunGitCommandException $e) { |
|
76 | + } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\RunGitCommandException $e) { |
|
77 | 77 | $errorMessage = $e->getMessage(); |
78 | 78 | } |
79 | 79 | $this->assertContains("fatal: 'origin' does not appear to be a git repository", trim($errorMessage), 'push tag command error'); |
@@ -166,7 +166,7 @@ |
||
166 | 166 | $this->assertEquals('File path is been tracked. Please untrack file first',$message); |
167 | 167 | |
168 | 168 | try{ |
169 | - $filesCommand->ignoreFile('testFileDoesNotExist'); |
|
169 | + $filesCommand->ignoreFile('testFileDoesNotExist'); |
|
170 | 170 | }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidFilePathException $e){ |
171 | 171 | $message = $e->getMessage(); |
172 | 172 | } |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | { |
26 | 26 | $this->initGitCommandsLocal(); |
27 | 27 | $this->gitCommands->command('init')->initRepository(); |
28 | - $this->addFile('test',null,'Test Of List Files'); |
|
28 | + $this->addFile('test', null, 'Test Of List Files'); |
|
29 | 29 | $this->addFolder('MoreFiles'); |
30 | - $this->addFile('test2','MoreFiles','Test Of file in MoreFiles folder'); |
|
30 | + $this->addFile('test2', 'MoreFiles', 'Test Of file in MoreFiles folder'); |
|
31 | 31 | |
32 | 32 | $this->gitCommands->command('commit')->stageAll(); |
33 | 33 | $this->gitCommands->command('commit')->commit('first commit', 'Paul Schweppe <[email protected]>'); |
34 | 34 | |
35 | - $this->addFile('test3',null,'This file is not commited'); |
|
35 | + $this->addFile('test3', null, 'This file is not commited'); |
|
36 | 36 | |
37 | 37 | |
38 | 38 | } |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | { |
45 | 45 | $files = $this->gitCommands->command('files')->listFiles(''); |
46 | 46 | |
47 | - $this->assertCount(3, $files,'File list count does not equal expected 3. Actual:'.count($files)); |
|
47 | + $this->assertCount(3, $files, 'File list count does not equal expected 3. Actual:'.count($files)); |
|
48 | 48 | |
49 | - foreach($files as $file){ |
|
49 | + foreach ($files as $file) { |
|
50 | 50 | $this->assertInstanceOf("\SplFileInfo", $file); |
51 | 51 | } |
52 | 52 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | $this->assertNull($files[2]->getGitLog(), 'Third file should not have a git log'); |
58 | 58 | |
59 | 59 | $errorMessage = ''; |
60 | - try{ |
|
60 | + try { |
|
61 | 61 | $this->gitCommands->command('files')->listFiles('../'); |
62 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e){ |
|
62 | + } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e) { |
|
63 | 63 | $errorMessage = $e->getMessage(); |
64 | 64 | } |
65 | 65 | $this->assertContains("Directory path is not valid", trim($errorMessage), 'Invalid Directory error'); |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | |
78 | 78 | |
79 | 79 | $errorMessage = ''; |
80 | - try{ |
|
80 | + try { |
|
81 | 81 | $fileNotExisting = $this->gitCommands->command('files')->getFile('MoreFiles/testDoesNotExist'); |
82 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e){ |
|
82 | + } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e) { |
|
83 | 83 | $errorMessage = $e->getMessage(); |
84 | 84 | } |
85 | 85 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** |
91 | 91 | * Test Read File |
92 | 92 | */ |
93 | - public function testReadFile(){ |
|
93 | + public function testReadFile() { |
|
94 | 94 | $file = $this->gitCommands->command('files')->getFile('MoreFiles/test2'); |
95 | 95 | $fileContent = $this->gitCommands->command('files')->readFile($file); |
96 | 96 | $this->assertContains("Test Of file in MoreFiles folder", trim($fileContent), 'File content did not match:'.$fileContent); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * Test malicious file paths |
102 | 102 | */ |
103 | - public function testValidPathStr(){ |
|
103 | + public function testValidPathStr() { |
|
104 | 104 | |
105 | 105 | $filesCommand = $this->gitCommands->command('files'); |
106 | 106 | $this->assertTrue($filesCommand->ValidPathStr('MoreFiles/test2'), 'Path "MoreFiles/test2" should be valid'); |
@@ -118,60 +118,60 @@ discard block |
||
118 | 118 | public function testIsFileIgnored() |
119 | 119 | { |
120 | 120 | $filesCommand = $this->gitCommands->command('files'); |
121 | - $this->addFile('ignoretest',null,'Git should Ignore'); |
|
122 | - $this->addFile('.gitignore',null,'ignoretest'); |
|
121 | + $this->addFile('ignoretest', null, 'Git should Ignore'); |
|
122 | + $this->addFile('.gitignore', null, 'ignoretest'); |
|
123 | 123 | |
124 | - $this->assertTrue($filesCommand->isFileIgnored('ignoretest'),'File ignoretest should be ignored'); |
|
124 | + $this->assertTrue($filesCommand->isFileIgnored('ignoretest'), 'File ignoretest should be ignored'); |
|
125 | 125 | |
126 | - $this->updateFile('.gitignore',null,'test'); |
|
127 | - $this->assertFalse($filesCommand->isFileIgnored('test'),'File test is not ignored because it is commited already'); |
|
126 | + $this->updateFile('.gitignore', null, 'test'); |
|
127 | + $this->assertFalse($filesCommand->isFileIgnored('test'), 'File test is not ignored because it is commited already'); |
|
128 | 128 | |
129 | - $this->assertFalse($filesCommand->isFileIgnored('notest'),'File does not exist'); |
|
129 | + $this->assertFalse($filesCommand->isFileIgnored('notest'), 'File does not exist'); |
|
130 | 130 | |
131 | - $this->assertFalse($filesCommand->isFileIgnored('MoreFiles/test2'),'File exists and should not be ignored'); |
|
131 | + $this->assertFalse($filesCommand->isFileIgnored('MoreFiles/test2'), 'File exists and should not be ignored'); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | public function testIsFileTracked() |
135 | 135 | { |
136 | 136 | $filesCommand = $this->gitCommands->command('files'); |
137 | - $this->addFile('ignoretest',null,'Git should Ignore'); |
|
138 | - $this->addFile('.gitignore',null,'ignoretest'); |
|
137 | + $this->addFile('ignoretest', null, 'Git should Ignore'); |
|
138 | + $this->addFile('.gitignore', null, 'ignoretest'); |
|
139 | 139 | |
140 | - $this->assertFalse($filesCommand->isFileTracked('ignoretest'),'File ignoretest should be ignored'); |
|
140 | + $this->assertFalse($filesCommand->isFileTracked('ignoretest'), 'File ignoretest should be ignored'); |
|
141 | 141 | |
142 | - $this->updateFile('.gitignore',null,'test'); |
|
143 | - $this->assertTrue($filesCommand->isFileTracked('test'),'File test is not ignored because it is commited already'); |
|
142 | + $this->updateFile('.gitignore', null, 'test'); |
|
143 | + $this->assertTrue($filesCommand->isFileTracked('test'), 'File test is not ignored because it is commited already'); |
|
144 | 144 | |
145 | - $this->assertFalse($filesCommand->isFileTracked('notest'),'File does not exist'); |
|
145 | + $this->assertFalse($filesCommand->isFileTracked('notest'), 'File does not exist'); |
|
146 | 146 | |
147 | - $this->assertTrue($filesCommand->isFileTracked('MoreFiles/test2'),'File exists and should not be ignored'); |
|
147 | + $this->assertTrue($filesCommand->isFileTracked('MoreFiles/test2'), 'File exists and should not be ignored'); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | public function testIgnoreFile() |
151 | 151 | { |
152 | 152 | $filesCommand = $this->gitCommands->command('files'); |
153 | - $this->addFile('ignoretest',null,'Git should Ignore'); |
|
153 | + $this->addFile('ignoretest', null, 'Git should Ignore'); |
|
154 | 154 | |
155 | 155 | $response = $filesCommand->ignoreFile('ignoretest'); |
156 | 156 | |
157 | - $this->assertEquals('File added to .gitignore',$response); |
|
157 | + $this->assertEquals('File added to .gitignore', $response); |
|
158 | 158 | |
159 | 159 | $message = ''; |
160 | - try{ |
|
160 | + try { |
|
161 | 161 | $filesCommand->ignoreFile('test'); |
162 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException $e){ |
|
162 | + } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException $e) { |
|
163 | 163 | $message = $e->getMessage(); |
164 | 164 | } |
165 | 165 | |
166 | - $this->assertEquals('File path is been tracked. Please untrack file first',$message); |
|
166 | + $this->assertEquals('File path is been tracked. Please untrack file first', $message); |
|
167 | 167 | |
168 | - try{ |
|
168 | + try { |
|
169 | 169 | $filesCommand->ignoreFile('testFileDoesNotExist'); |
170 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidFilePathException $e){ |
|
170 | + } catch (\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidFilePathException $e) { |
|
171 | 171 | $message = $e->getMessage(); |
172 | 172 | } |
173 | 173 | |
174 | - $this->assertEquals('File path was not valid. Please check that the file exists.',$message); |
|
174 | + $this->assertEquals('File path was not valid. Please check that the file exists.', $message); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | //Untrack file should now work |
200 | 200 | $response = $filesCommand->unTrackFile('test'); |
201 | - $this->assertContains('Please commit to complete the removal',$response); |
|
201 | + $this->assertContains('Please commit to complete the removal', $response); |
|
202 | 202 | |
203 | 203 | } |
204 | 204 | |
@@ -214,14 +214,14 @@ discard block |
||
214 | 214 | $filesCommand->unTrackFile('test'); |
215 | 215 | |
216 | 216 | //Add test to .gitignore. Must happen before commit |
217 | - $this->updateFile('.gitignore','test'); |
|
217 | + $this->updateFile('.gitignore', 'test'); |
|
218 | 218 | |
219 | 219 | //Commit change to untracked file |
220 | 220 | $this->gitCommands->command('commit')->stageAll(); |
221 | 221 | $this->gitCommands->command('commit')->commit('Remove file from git index', 'Paul Schweppe <[email protected]>'); |
222 | 222 | |
223 | 223 | //Test that file is no longer tracked |
224 | - $this->assertFalse($filesCommand->isFileTracked('test'),'Test that test file is no longer tracked'); |
|
224 | + $this->assertFalse($filesCommand->isFileTracked('test'), 'Test that test file is no longer tracked'); |
|
225 | 225 | |
226 | 226 | } |
227 | 227 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $errorMessage = ''; |
60 | 60 | try{ |
61 | 61 | $this->gitCommands->command('files')->listFiles('../'); |
62 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e){ |
|
62 | + } catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e){ |
|
63 | 63 | $errorMessage = $e->getMessage(); |
64 | 64 | } |
65 | 65 | $this->assertContains("Directory path is not valid", trim($errorMessage), 'Invalid Directory error'); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $errorMessage = ''; |
80 | 80 | try{ |
81 | 81 | $fileNotExisting = $this->gitCommands->command('files')->getFile('MoreFiles/testDoesNotExist'); |
82 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e){ |
|
82 | + } catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidDirectoryException $e){ |
|
83 | 83 | $errorMessage = $e->getMessage(); |
84 | 84 | } |
85 | 85 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $message = ''; |
160 | 160 | try{ |
161 | 161 | $filesCommand->ignoreFile('test'); |
162 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException $e){ |
|
162 | + } catch(\VersionControl\GitCommandBundle\GitCommands\Exception\FileStatusException $e){ |
|
163 | 163 | $message = $e->getMessage(); |
164 | 164 | } |
165 | 165 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | try{ |
169 | 169 | $filesCommand->ignoreFile('testFileDoesNotExist'); |
170 | - }catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidFilePathException $e){ |
|
170 | + } catch(\VersionControl\GitCommandBundle\GitCommands\Exception\InvalidFilePathException $e){ |
|
171 | 171 | $message = $e->getMessage(); |
172 | 172 | } |
173 | 173 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Symfony\Component\Filesystem\Filesystem; |
7 | 7 | |
8 | 8 | if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) { |
9 | - class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); |
|
9 | + class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | /** |
@@ -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, 'w'); |
114 | 113 | $fileContent = $content == null ? 'test content' : $content; |
115 | 114 | $this->assertTrue(false !== fwrite($handle, $fileContent), sprintf('unable to write the file %s', $name)); |
@@ -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)) |
@@ -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); |
@@ -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 |
@@ -407,8 +407,8 @@ |
||
407 | 407 | $this->issueRepository->closeIssue($issueId); |
408 | 408 | } |
409 | 409 | |
410 | - // $em->persist($entity); |
|
411 | - // $em->flush(); |
|
410 | + // $em->persist($entity); |
|
411 | + // $em->flush(); |
|
412 | 412 | |
413 | 413 | return $this->redirect($this->generateUrl('issue_show', array('id' => $this->project->getId(), 'issueId' => $issueId))); |
414 | 414 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | break; |
55 | 55 | }else{ |
56 | 56 | //Get last md file |
57 | - $readme = $this->gitFilesCommands->readFile($file); |
|
57 | + $readme = $this->gitFilesCommands->readFile($file); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
@@ -49,10 +49,10 @@ |
||
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 | } |
@@ -52,7 +52,7 @@ |
||
52 | 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 | } |