Skip to content

Commit 607aa79

Browse files
committed
Merge pull request #8 from boenrobot/CS
Coding standard fixes.
2 parents 6b707f7 + a4107ac commit 607aa79

28 files changed

+388
-233
lines changed

src/phpDocumentor/Reflection/DocBlock.php

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* phpDocumentor
44
*
5-
* PHP Version 5
5+
* PHP Version 5.3
66
*
77
* @author Mike van Riel <[email protected]>
88
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
@@ -15,24 +15,24 @@
1515
/**
1616
* Parses the DocBlock for any structure.
1717
*
18-
* @author Mike van Riel <[email protected]>
19-
* @license http://www.opensource.org/licenses/mit-license.php MIT
20-
* @link http://phpdoc.org
18+
* @author Mike van Riel <[email protected]>
19+
* @license http://www.opensource.org/licenses/mit-license.php MIT
20+
* @link http://phpdoc.org
2121
*/
2222
class DocBlock implements \Reflector
2323
{
2424
/** @var string The opening line for this docblock. */
2525
protected $short_description = '';
2626

2727
/**
28-
* @var \phpDocumentor\Reflection\DocBlock\LongDescription The actual description
29-
* for this docblock.
28+
* @var \phpDocumentor\Reflection\DocBlock\LongDescription The actual
29+
* description for this docblock.
3030
*/
3131
protected $long_description = null;
3232

3333
/**
34-
* @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all the tags
35-
* in this docblock; except inline.
34+
* @var \phpDocumentor\Reflection\DocBlock\Tags[] An array containing all
35+
* the tags in this docblock; except inline.
3636
*/
3737
protected $tags = array();
3838

@@ -52,19 +52,21 @@ class DocBlock implements \Reflector
5252
* For example the param and return tags use this to expand their type
5353
* information.
5454
*
55-
* @param \Reflector|string $docblock A docblock comment (including asterisks)
56-
* or reflector supporting the getDocComment method.
57-
* @param string $namespace The namespace where this DocBlock resides in;
58-
* defaults to `\`.
59-
* @param string[] $namespace_aliases a list of namespace aliases as
60-
* provided by the `use` keyword; the key of the array is the alias name
61-
* or last part of the alias array if no alias name is provided.
55+
* @param \Reflector|string $docblock A docblock comment (including
56+
* asterisks) or reflector supporting the getDocComment method.
57+
* @param string $namespace The namespace where this
58+
* DocBlock resides in; defaults to `\`.
59+
* @param string[] $namespace_aliases A list of namespace aliases
60+
* as provided by the `use` keyword; the key of the array is the alias
61+
* name or last part of the alias array if no alias name is provided.
6262
*
6363
* @throws \InvalidArgumentException if the given argument does not have the
6464
* getDocComment method.
6565
*/
6666
public function __construct(
67-
$docblock, $namespace = '\\', $namespace_aliases = array()
67+
$docblock,
68+
$namespace = '\\',
69+
$namespace_aliases = array()
6870
) {
6971
if (is_object($docblock)) {
7072
if (!method_exists($docblock, 'getDocComment')) {
@@ -99,7 +101,9 @@ protected function cleanInput($comment)
99101
{
100102
$comment = trim(
101103
preg_replace(
102-
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment
104+
'#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u',
105+
'$1',
106+
$comment
103107
)
104108
);
105109

@@ -121,7 +125,7 @@ protected function cleanInput($comment)
121125
* @param string $comment Comment to split into the sub-parts.
122126
*
123127
* @author RichardJ Special thanks to RichardJ for the regex responsible
124-
* for the split/
128+
* for the split.
125129
*
126130
* @return string[] containing the short-, long description and an element
127131
* containing the tags.
@@ -173,7 +177,9 @@ protected function splitDocBlock($comment)
173177
)
174178
)?
175179
(\s+ [\s\S]*)? # everything that follows
176-
/u', $comment, $matches
180+
/u',
181+
$comment,
182+
$matches
177183
);
178184
array_shift($matches);
179185
}
@@ -306,9 +312,10 @@ public function hasTag($name)
306312
* @param string $type Type to expand into full namespaced
307313
* equivalent.
308314
* @param string[] $ignore_keywords Whether to ignore given keywords, when
309-
* null it will use the default keywords: 'string', 'int', 'integer',
310-
* 'bool', 'boolean', 'float', 'double', 'object', 'mixed', 'array',
311-
* 'resource', 'void', 'null', 'callback', 'false', 'true'.
315+
* null it will use the default keywords:
316+
* 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
317+
* 'object', 'mixed', 'array', 'resource', 'void', 'null', 'callback',
318+
* 'false', 'true', 'self', '$this', 'callable'.
312319
* Default value for this parameter is null.
313320
*
314321
* @return string
@@ -321,9 +328,9 @@ public function expandType($type, $ignore_keywords = null)
321328

322329
if ($ignore_keywords === null) {
323330
$ignore_keywords = array(
324-
'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
325-
'object', 'mixed', 'array', 'resource', 'void', 'null',
326-
'callback', 'false', 'true', 'self', '$this', 'callable'
331+
'string', 'int', 'integer', 'bool', 'boolean', 'float',
332+
'double', 'object', 'mixed', 'array', 'resource', 'void',
333+
'null', 'callback', 'false', 'true', 'self', '$this', 'callable'
327334
);
328335
}
329336

@@ -382,7 +389,7 @@ public function expandType($type, $ignore_keywords = null)
382389
*
383390
* @return string
384391
*/
385-
static public function export()
392+
public static function export()
386393
{
387394
throw new \Exception('Not yet implemented');
388395
}

src/phpDocumentor/Reflection/DocBlock/LongDescription.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
/**
1616
* Parses a Long Description of a DocBlock.
1717
*
18-
* @author Mike van Riel <[email protected]>
19-
* @license http://www.opensource.org/licenses/mit-license.php MIT
20-
* @link http://phpdoc.org
18+
* @author Mike van Riel <[email protected]>
19+
* @license http://www.opensource.org/licenses/mit-license.php MIT
20+
* @link http://phpdoc.org
2121
*/
2222
class LongDescription implements \Reflector
2323
{
@@ -51,18 +51,20 @@ public function getContents()
5151
return $this->contents;
5252
}
5353

54-
/*
54+
/**
5555
* Returns the parsed text of this description.
5656
*
5757
* @return array An array of strings and tag objects, in the order they
58-
* occur within the description.
58+
* occur within the description.
5959
*/
6060
public function getParsedContents()
6161
{
6262
if (null === $this->parsedContents) {
6363
$this->parsedContents = preg_split(
64-
'/\{(\@.*?)\}/uS', $this->contents,
65-
null, PREG_SPLIT_DELIM_CAPTURE
64+
'/\{(\@.*?)\}/uS',
65+
$this->contents,
66+
null,
67+
PREG_SPLIT_DELIM_CAPTURE
6668
);
6769
for ($i=1, $l = count($this->parsedContents); $i<$l; $i += 2) {
6870
$this->parsedContents[$i] = Tag::createInstance(
@@ -97,8 +99,8 @@ public function getFormattedContents()
9799
}
98100

99101
if (class_exists('dflydev\markdown\MarkdownExtraParser')) {
100-
$md = new \dflydev\markdown\MarkdownExtraParser();
101-
$result = $md->transformMarkdown($result);
102+
$markdown = new \dflydev\markdown\MarkdownExtraParser();
103+
$result = $markdown->transformMarkdown($result);
102104
}
103105

104106
return trim($result);
@@ -107,11 +109,12 @@ public function getFormattedContents()
107109
/**
108110
* Builds a string representation of this object.
109111
*
110-
* @todo determine the exact format as used by PHP Reflection and implement it.
112+
* @todo determine the exact format as used by PHP Reflection
113+
* and implement it.
111114
*
112115
* @return void
113116
*/
114-
static public function export()
117+
public static function export()
115118
{
116119
throw new \Exception('Not yet implemented');
117120
}
@@ -126,4 +129,4 @@ public function __toString()
126129
{
127130
return 'Not yet implemented';
128131
}
129-
}
132+
}

src/phpDocumentor/Reflection/DocBlock/Tag.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* phpDocumentor
44
*
5-
* PHP Version 5
5+
* PHP Version 5.3
66
*
77
* @author Mike van Riel <[email protected]>
88
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
@@ -15,9 +15,9 @@
1515
/**
1616
* Parses a tag definition for a DocBlock.
1717
*
18-
* @author Mike van Riel <[email protected]>
19-
* @license http://www.opensource.org/licenses/mit-license.php MIT
20-
* @link http://phpdoc.org
18+
* @author Mike van Riel <[email protected]>
19+
* @license http://www.opensource.org/licenses/mit-license.php MIT
20+
* @link http://phpdoc.org
2121
*/
2222
class Tag implements \Reflector
2323
{
@@ -29,7 +29,7 @@ class Tag implements \Reflector
2929

3030
/** @var string Description of the content of this tag */
3131
protected $description = '';
32-
32+
3333
/** @var array The description, as an array of strings and Tag objects. */
3434
protected $parsedDescription = null;
3535

@@ -51,7 +51,9 @@ class Tag implements \Reflector
5151
public static function createInstance($tag_line)
5252
{
5353
if (!preg_match(
54-
'/^@([\w\-\_\\\\]+)(?:\s*([^\s].*)|$)?/us', $tag_line, $matches
54+
'/^@([\w\-\_\\\\]+)(?:\s*([^\s].*)|$)?/us',
55+
$tag_line,
56+
$matches
5557
)) {
5658
throw new \InvalidArgumentException(
5759
'Invalid tag_line detected: ' . $tag_line
@@ -60,7 +62,9 @@ public static function createInstance($tag_line)
6062

6163
// support hypphen separated tag names
6264
$tag_name = str_replace(
63-
' ', '', ucwords(str_replace('-', ' ', $matches[1]))
65+
' ',
66+
'',
67+
ucwords(str_replace('-', ' ', $matches[1]))
6468
).'Tag';
6569
$class_name = 'phpDocumentor\\Reflection\\DocBlock\\Tag\\' . $tag_name;
6670

@@ -111,12 +115,12 @@ public function getDescription()
111115
{
112116
return $this->description;
113117
}
114-
115-
/*
118+
119+
/**
116120
* Returns the parsed text of this description.
117121
*
118122
* @return array An array of strings and tag objects, in the order they
119-
* occur within the description.
123+
* occur within the description.
120124
*/
121125
public function getParsedDescription()
122126
{
@@ -170,7 +174,7 @@ public function setDocBlock($docblock)
170174
*
171175
* @return void
172176
*/
173-
static public function export()
177+
public static function export()
174178
{
175179
throw new \Exception('Not yet implemented');
176180
}
@@ -185,5 +189,4 @@ public function __toString()
185189
{
186190
return 'Not yet implemented';
187191
}
188-
189192
}

src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
/**
33
* phpDocumentor
44
*
5-
* PHP Version 5
5+
* PHP Version 5.3
66
*
7-
* @author Mike van Riel <mike.vanriel@naenius.com>
7+
* @author Vasil Rangelov <boen.robot@gmail.com>
88
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
99
* @license http://www.opensource.org/licenses/mit-license.php MIT
1010
* @link http://phpdoc.org
@@ -17,18 +17,18 @@
1717
/**
1818
* Reflection class for an @author tag in a Docblock.
1919
*
20-
* @author Mike van Riel <[email protected]>
21-
* @license http://www.opensource.org/licenses/mit-license.php MIT
22-
* @link http://phpdoc.org
20+
* @author Mike van Riel <[email protected]>
21+
* @license http://www.opensource.org/licenses/mit-license.php MIT
22+
* @link http://phpdoc.org
2323
*/
2424
class AuthorTag extends Tag
2525
{
2626
/** @var string The name of the author */
2727
protected $name = '';
28-
28+
2929
/** @var string The email of the author */
3030
protected $email = '';
31-
31+
3232
/**
3333
* Parses a tag and populates the member variables.
3434
*
@@ -45,7 +45,7 @@ public function __construct($type, $content)
4545
}
4646
}
4747
}
48-
48+
4949
/**
5050
* Gets the author's name.
5151
*
@@ -55,7 +55,7 @@ public function getAuthorName()
5555
{
5656
return $this->name;
5757
}
58-
58+
5959
/**
6060
* Gets the author's email.
6161
*

src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* phpDocumentor
44
*
5-
* PHP Version 5
5+
* PHP Version 5.3
66
*
77
* @author Mike van Riel <[email protected]>
88
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
@@ -15,11 +15,10 @@
1515
/**
1616
* Reflection class for a @covers tag in a Docblock.
1717
*
18-
* @author Mike van Riel <[email protected]>
19-
* @license http://www.opensource.org/licenses/mit-license.php MIT
20-
* @link http://phpdoc.org
18+
* @author Mike van Riel <[email protected]>
19+
* @license http://www.opensource.org/licenses/mit-license.php MIT
20+
* @link http://phpdoc.org
2121
*/
2222
class CoversTag extends SeeTag
2323
{
24-
2524
}

src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* phpDocumentor
44
*
5-
* PHP Version 5
5+
* PHP Version 5.3
66
*
77
* @author Ben Selby <[email protected]>
88
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
@@ -11,14 +11,15 @@
1111
*/
1212

1313
namespace phpDocumentor\Reflection\DocBlock\Tag;
14+
1415
use phpDocumentor\Reflection\DocBlock\Tag;
1516

1617
/**
1718
* Reflection class for a @link tag in a Docblock.
1819
*
19-
* @author Ben Selby <[email protected]>
20-
* @license http://www.opensource.org/licenses/mit-license.php MIT
21-
* @link http://phpdoc.org
20+
* @author Ben Selby <[email protected]>
21+
* @license http://www.opensource.org/licenses/mit-license.php MIT
22+
* @link http://phpdoc.org
2223
*/
2324
class LinkTag extends Tag
2425
{

0 commit comments

Comments
 (0)