Skip to content

Commit e027bfe

Browse files
Apply fixes from StyleCI (#145)
1 parent cff9b15 commit e027bfe

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Gitonomy/Git/Parser/TagParser.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* This source file is subject to the MIT license that is bundled
1010
* with this source code in the file LICENSE.
1111
*/
12+
1213
namespace Gitonomy\Git\Parser;
1314

1415
use Gitonomy\Git\Exception\RuntimeException;
@@ -46,7 +47,7 @@ protected function doParse()
4647
$this->consumeNewLine();
4748

4849
try {
49-
$this->message = $this->consumeTo("-----BEGIN PGP SIGNATURE-----");
50+
$this->message = $this->consumeTo('-----BEGIN PGP SIGNATURE-----');
5051
$this->gpgSignature = $this->consumeGPGSignature();
5152
} catch (RuntimeException $e) {
5253
$this->message = $this->consumeAll();
@@ -55,15 +56,15 @@ protected function doParse()
5556

5657
protected function consumeGPGSignature()
5758
{
58-
$expected = "-----BEGIN PGP SIGNATURE-----";
59+
$expected = '-----BEGIN PGP SIGNATURE-----';
5960
$length = strlen($expected);
6061
$actual = substr($this->content, $this->cursor, $length);
6162
if ($actual != $expected) {
6263
return '';
6364
}
6465
$this->cursor += $length;
6566

66-
return $this->consumeTo("-----END PGP SIGNATURE-----");
67+
return $this->consumeTo('-----END PGP SIGNATURE-----');
6768
}
6869

6970
protected function consumeNameEmailDate()
@@ -74,7 +75,7 @@ protected function consumeNameEmailDate()
7475

7576
$this->cursor += strlen($vars[1]);
7677

77-
return array($vars[2], $vars[3], $vars[4]);
78+
return [$vars[2], $vars[3], $vars[4]];
7879
}
7980

8081
protected function parseDate($text)

src/Gitonomy/Git/Reference/Tag.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
namespace Gitonomy\Git\Reference;
1414

15-
use Gitonomy\Git\Exception\RuntimeException;
1615
use Gitonomy\Git\Exception\ProcessException;
17-
use Gitonomy\Git\Reference;
16+
use Gitonomy\Git\Exception\RuntimeException;
1817
use Gitonomy\Git\Parser\TagParser;
18+
use Gitonomy\Git\Reference;
1919

2020
/**
2121
* Representation of a tag reference.
@@ -41,7 +41,7 @@ public function getName()
4141
public function isAnnotated()
4242
{
4343
try {
44-
$this->repository->run('cat-file', array('tag', $this->revision));
44+
$this->repository->run('cat-file', ['tag', $this->revision]);
4545
} catch (ProcessException $e) {
4646
return false; // Is not an annotated tag
4747
}
@@ -122,12 +122,13 @@ public function getGPGSignature()
122122
/**
123123
* Check whether tag is signed.
124124
*
125-
* @return boolean
125+
* @return bool
126126
*/
127127
public function isSigned()
128128
{
129129
try {
130130
$this->getGPGSignature();
131+
131132
return true;
132133
} catch (\InvalidArgumentException $e) {
133134
return false;
@@ -165,7 +166,7 @@ private function getData($name)
165166
}
166167

167168
$parser = new TagParser();
168-
$result = $this->repository->run('cat-file', array('tag', $this->revision));
169+
$result = $this->repository->run('cat-file', ['tag', $this->revision]);
169170

170171
$parser->parse($result);
171172

0 commit comments

Comments
 (0)