Skip to content

Commit 45f6bfb

Browse files
GrahamCampbelllyrixx
authored andcommitted
CS Fixes And Minor Tweaks
1 parent 2df6bd7 commit 45f6bfb

16 files changed

+20
-31
lines changed

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
22
/composer.lock
3+
/phpunit.xml

Diff for: src/Gitonomy/Git/Admin.php

-1
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,4 @@ private static function getProcess($command, array $args = array(), array $optio
163163

164164
return $process;
165165
}
166-
167166
}

Diff for: src/Gitonomy/Git/Blame.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
namespace Gitonomy\Git;
1414

15+
use Gitonomy\Git\Blame\Line;
1516
use Gitonomy\Git\Exception\InvalidArgumentException;
1617
use Gitonomy\Git\Parser\BlameParser;
17-
use Gitonomy\Git\Blame\Line;
1818

1919
/**
2020
* @author Alexandre Salomé <[email protected]>

Diff for: src/Gitonomy/Git/Commit.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
use Gitonomy\Git\Diff\Diff;
1616
use Gitonomy\Git\Exception\InvalidArgumentException;
17-
use Gitonomy\Git\Exception\ReferenceNotFoundException;
1817
use Gitonomy\Git\Exception\ProcessException;
18+
use Gitonomy\Git\Exception\ReferenceNotFoundException;
1919
use Gitonomy\Git\Util\StringHelper;
2020

2121
/**
@@ -223,7 +223,7 @@ public function getIncludingBranches($local = true, $remote = true)
223223
}
224224

225225
$branchesName = explode("\n", trim(str_replace('*', '', $result)));
226-
$branchesName = array_filter($branchesName, function($v) { return false === StringHelper::strpos($v, '->');});
226+
$branchesName = array_filter($branchesName, function ($v) { return false === StringHelper::strpos($v, '->');});
227227
$branchesName = array_map('trim', $branchesName);
228228

229229
$references = $this->repository->getReferences();

Diff for: src/Gitonomy/Git/Parser/LogParser.php

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
namespace Gitonomy\Git\Parser;
1414

15-
use Gitonomy\Git\Exception\RuntimeException;
16-
1715
class LogParser extends CommitParser
1816
{
1917
public $log = array();

Diff for: src/Gitonomy/Git/Reference.php

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function delete()
3939
$this->repository->getReferences()->delete($this->getFullname());
4040
}
4141

42-
4342
public function getCommitHash()
4443
{
4544
if (null !== $this->commitHash) {

Diff for: src/Gitonomy/Git/ReferenceBag.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
use Gitonomy\Git\Exception\ReferenceNotFoundException;
1616
use Gitonomy\Git\Exception\RuntimeException;
17-
use Gitonomy\Git\Reference\Stash;
1817
use Gitonomy\Git\Reference\Branch;
18+
use Gitonomy\Git\Reference\Stash;
1919
use Gitonomy\Git\Reference\Tag;
2020

2121
/**

Diff for: src/Gitonomy/Git/Repository.php

+8-9
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212

1313
namespace Gitonomy\Git;
1414

15-
use Psr\Log\LoggerInterface;
16-
use Symfony\Component\Process\Process;
17-
use Symfony\Component\Process\ProcessBuilder;
18-
1915
use Gitonomy\Git\Diff\Diff;
16+
use Gitonomy\Git\Exception\InvalidArgumentException;
2017
use Gitonomy\Git\Exception\ProcessException;
2118
use Gitonomy\Git\Exception\RuntimeException;
22-
use Gitonomy\Git\Exception\InvalidArgumentException;
19+
use Psr\Log\LoggerInterface;
20+
use Symfony\Component\Process\Process;
21+
use Symfony\Component\Process\ProcessBuilder;
2322

2423
/**
2524
* Git repository object.
@@ -115,7 +114,7 @@ class Repository
115114
*/
116115
public function __construct($dir, $options = array())
117116
{
118-
$is_windows = defined( 'PHP_WINDOWS_VERSION_BUILD' );
117+
$is_windows = defined('PHP_WINDOWS_VERSION_BUILD');
119118
$options = array_merge(array(
120119
'working_dir' => null,
121120
'debug' => true,
@@ -139,7 +138,7 @@ public function __construct($dir, $options = array())
139138
$this->command = $options['command'];
140139

141140
if (true === $this->debug && null !== $this->logger) {
142-
$this->logger->debug(sprintf('Repository created (git dir: "%s", working dir: "%s")', $this->gitDir, $this->workingDir ? : 'none'));
141+
$this->logger->debug(sprintf('Repository created (git dir: "%s", working dir: "%s")', $this->gitDir, $this->workingDir ?: 'none'));
143142
}
144143
}
145144

@@ -379,7 +378,7 @@ public function getBlame($revision, $file, $lineRange = null)
379378
*
380379
* @param array $revisions An array of revisions to show logs from. Can be
381380
* any text value type
382-
* @param array $paths Restrict log to modifications occuring on given
381+
* @param array $paths Restrict log to modifications occuring on given
383382
* paths.
384383
*
385384
* @param int $offset Start from a given offset in results.
@@ -616,7 +615,7 @@ private function getProcess($command, $args = array())
616615
$base = array($this->command, '--git-dir', $this->gitDir);
617616

618617
if ($this->workingDir) {
619-
$base = array_merge($base, array('--work-tree', $this->workingDir));;
618+
$base = array_merge($base, array('--work-tree', $this->workingDir));
620619
}
621620

622621
$base[] = $command;

Diff for: src/Gitonomy/Git/Revision.php

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212

1313
namespace Gitonomy\Git;
1414

15-
use Gitonomy\Git\Exception\ReferenceNotFoundException;
16-
use Gitonomy\Git\Exception\InvalidArgumentException;
17-
use Gitonomy\Git\Exception\ProcessException;
18-
1915
/**
2016
* @author Alexandre Salomé <[email protected]>
2117
*/

Diff for: src/Gitonomy/Git/RevisionList.php

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
namespace Gitonomy\Git;
1414

15-
use Gitonomy\Git\Util\StringHelper;
16-
1715
/**
1816
* @author Alexandre Salomé <[email protected]>
1917
*/

Diff for: src/Gitonomy/Git/Tree.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
namespace Gitonomy\Git;
1414

15-
use Gitonomy\Git\CommitReference;
1615
use Gitonomy\Git\Exception\InvalidArgumentException;
1716
use Gitonomy\Git\Exception\UnexpectedValueException;
1817

Diff for: src/Gitonomy/Git/WorkingCopy.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
namespace Gitonomy\Git;
1414

1515
use Gitonomy\Git\Diff\Diff;
16-
17-
use Gitonomy\Git\Exception\LogicException;
1816
use Gitonomy\Git\Exception\InvalidArgumentException;
17+
use Gitonomy\Git\Exception\LogicException;
1918

2019
/**
2120
* @author Alexandre Salomé <[email protected]>
@@ -44,8 +43,9 @@ public function getStatus()
4443
public function getUntrackedFiles()
4544
{
4645
$lines = explode("\0", $this->run('status', array('--porcelain', '--untracked-files=all', '-z')));
47-
$lines = array_filter($lines, function($l) { return substr($l, 0, 3) === '?? '; });
48-
$lines = array_map(function($l) { return substr($l, 3); }, $lines);
46+
$lines = array_filter($lines, function ($l) { return substr($l, 0, 3) === '?? '; });
47+
$lines = array_map(function ($l) { return substr($l, 3); }, $lines);
48+
4949
return $lines;
5050
}
5151

Diff for: tests/Gitonomy/Git/Tests/AdminTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
namespace Gitonomy\Git\Tests;
1414

1515
use Gitonomy\Git\Admin;
16-
use Gitonomy\Git\Repository;
1716
use Gitonomy\Git\Reference\Branch;
17+
use Gitonomy\Git\Repository;
1818

1919
class AdminTest extends AbstractTest
2020
{

Diff for: tests/Gitonomy/Git/Tests/CommitTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ public function testGetShortMessage($repository)
204204
$this->assertEquals('Add README', $commit->getShortMessage(20));
205205
$this->assertEquals('A', $commit->getShortMessage(1, false, ''));
206206
$this->assertEquals('Add!!!', $commit->getShortMessage(1, true, '!!!'));
207-
208207
}
209208

210209
/**

Diff for: tests/Gitonomy/Git/Tests/RepositoryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
namespace Gitonomy\Git\Tests;
1414

15-
use Gitonomy\Git\Repository;
1615
use Gitonomy\Git\Blob;
16+
use Gitonomy\Git\Repository;
1717

1818
class RepositoryTest extends AbstractTest
1919
{

0 commit comments

Comments
 (0)