Skip to content

Commit 771a21d

Browse files
TomasVotrubajaapio
authored andcommitted
[cs] use short arrays, order imports
1 parent 87c6ecc commit 771a21d

File tree

9 files changed

+13
-14
lines changed

9 files changed

+13
-14
lines changed

src/DocBlock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class DocBlock
2424
private $description = null;
2525

2626
/** @var Tag[] An array containing all the tags in this docblock; except inline. */
27-
private $tags = array();
27+
private $tags = [];
2828

2929
/** @var Types\Context Information about the context of this DocBlock. */
3030
private $context = null;
@@ -171,7 +171,7 @@ public function getTagsByName($name)
171171
{
172172
Assert::string($name);
173173

174-
$result = array();
174+
$result = [];
175175

176176
/** @var Tag $tag */
177177
foreach ($this->getTags() as $tag) {

src/DocBlock/ExampleFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ExampleFinder
2323
private $sourceDirectory = '';
2424

2525
/** @var string[] */
26-
private $exampleDirectories = array();
26+
private $exampleDirectories = [];
2727

2828
/**
2929
* Attempts to find the example contents for the given descriptor.

src/DocBlock/StandardTagFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function registerTagHandler($tagName, $handler)
166166
*/
167167
private function extractTagParts($tagLine)
168168
{
169-
$matches = array();
169+
$matches = [];
170170
if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)/us', $tagLine, $matches)) {
171171
throw new \InvalidArgumentException(
172172
'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors'

src/DocBlock/Tags/Covers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
namespace phpDocumentor\Reflection\DocBlock\Tags;
1414

15+
use phpDocumentor\Reflection\DocBlock\Description;
1516
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
1617
use phpDocumentor\Reflection\Fqsen;
17-
use phpDocumentor\Reflection\DocBlock\Description;
18-
use phpDocumentor\Reflection\Types\Context as TypeContext;
1918
use phpDocumentor\Reflection\FqsenResolver;
19+
use phpDocumentor\Reflection\Types\Context as TypeContext;
2020
use Webmozart\Assert\Assert;
2121

2222
/**

src/DocBlock/Tags/Deprecated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
namespace phpDocumentor\Reflection\DocBlock\Tags;
1414

15-
use phpDocumentor\Reflection\Types\Context as TypeContext;
1615
use phpDocumentor\Reflection\DocBlock\Description;
1716
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
17+
use phpDocumentor\Reflection\Types\Context as TypeContext;
1818
use Webmozart\Assert\Assert;
1919

2020
/**

src/DocBlock/Tags/See.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212

1313
namespace phpDocumentor\Reflection\DocBlock\Tags;
1414

15+
use phpDocumentor\Reflection\DocBlock\Description;
1516
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
1617
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Fqsen as FqsenRef;
1718
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Reference;
1819
use phpDocumentor\Reflection\DocBlock\Tags\Reference\Url;
19-
use phpDocumentor\Reflection\Fqsen;
2020
use phpDocumentor\Reflection\FqsenResolver;
2121
use phpDocumentor\Reflection\Types\Context as TypeContext;
22-
use phpDocumentor\Reflection\DocBlock\Description;
2322
use Webmozart\Assert\Assert;
2423

2524
/**

src/DocBlock/Tags/Since.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
namespace phpDocumentor\Reflection\DocBlock\Tags;
1414

15-
use phpDocumentor\Reflection\Types\Context as TypeContext;
1615
use phpDocumentor\Reflection\DocBlock\Description;
1716
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
17+
use phpDocumentor\Reflection\Types\Context as TypeContext;
1818
use Webmozart\Assert\Assert;
1919

2020
/**

src/DocBlock/Tags/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
namespace phpDocumentor\Reflection\DocBlock\Tags;
1414

15-
use phpDocumentor\Reflection\Types\Context as TypeContext;
1615
use phpDocumentor\Reflection\DocBlock\Description;
1716
use phpDocumentor\Reflection\DocBlock\DescriptionFactory;
17+
use phpDocumentor\Reflection\Types\Context as TypeContext;
1818
use Webmozart\Assert\Assert;
1919

2020
/**

src/DocBlockFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function stripDocComment($comment)
124124
$comment = trim(substr($comment, 0, -2));
125125
}
126126

127-
return str_replace(array("\r\n", "\r"), "\n", $comment);
127+
return str_replace(["\r\n", "\r"], "\n", $comment);
128128
}
129129

130130
/**
@@ -143,7 +143,7 @@ private function splitDocBlock($comment)
143143
// method does not split tags so we return this verbatim as the fourth result (tags). This saves us the
144144
// performance impact of running a regular expression
145145
if (strpos($comment, '@') === 0) {
146-
return array('', '', '', $comment);
146+
return ['', '', '', $comment];
147147
}
148148

149149
// clears all extra horizontal whitespace from the line endings to prevent parsing issues
@@ -241,7 +241,7 @@ private function parseTagBlock($tags, Types\Context $context)
241241
*/
242242
private function splitTagBlockIntoTagLines($tags)
243243
{
244-
$result = array();
244+
$result = [];
245245
foreach (explode("\n", $tags) as $tag_line) {
246246
if (isset($tag_line[0]) && ($tag_line[0] === '@')) {
247247
$result[] = $tag_line;

0 commit comments

Comments
 (0)