mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
[cs] finalize, spaces, concat and strict comparison
This commit is contained in:
committed by
Jaap van Otterdijk
parent
833126e6a3
commit
5ff9ca38c5
+2
-2
@@ -174,7 +174,7 @@ final class DocBlock
|
||||
|
||||
/** @var Tag $tag */
|
||||
foreach ($this->getTags() as $tag) {
|
||||
if ($tag->getName() != $name) {
|
||||
if ($tag->getName() !== $name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ final class DocBlock
|
||||
|
||||
/** @var Tag $tag */
|
||||
foreach ($this->getTags() as $tag) {
|
||||
if ($tag->getName() == $name) {
|
||||
if ($tag->getName() === $name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class Description
|
||||
$this->bodyTemplate = $bodyTemplate;
|
||||
$this->tags = $tags;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the tags for this DocBlock.
|
||||
*
|
||||
|
||||
@@ -77,7 +77,7 @@ final class Param extends BaseTag implements Factory\StaticMethod
|
||||
}
|
||||
|
||||
// if the next item starts with a $ or ...$ it must be the variable name
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$')) {
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$' || substr($parts[0], 0, 4) === '...$')) {
|
||||
$variableName = array_shift($parts);
|
||||
array_shift($parts);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class Property extends BaseTag implements Factory\StaticMethod
|
||||
}
|
||||
|
||||
// if the next item starts with a $ or ...$ it must be the variable name
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) {
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) {
|
||||
$variableName = array_shift($parts);
|
||||
array_shift($parts);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class PropertyRead extends BaseTag implements Factory\StaticMethod
|
||||
}
|
||||
|
||||
// if the next item starts with a $ or ...$ it must be the variable name
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) {
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) {
|
||||
$variableName = array_shift($parts);
|
||||
array_shift($parts);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class PropertyWrite extends BaseTag implements Factory\StaticMethod
|
||||
}
|
||||
|
||||
// if the next item starts with a $ or ...$ it must be the variable name
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) {
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) {
|
||||
$variableName = array_shift($parts);
|
||||
array_shift($parts);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class Var_ extends BaseTag implements Factory\StaticMethod
|
||||
}
|
||||
|
||||
// if the next item starts with a $ or ...$ it must be the variable name
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) {
|
||||
if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] === '$')) {
|
||||
$variableName = array_shift($parts);
|
||||
array_shift($parts);
|
||||
|
||||
@@ -111,8 +111,8 @@ class Var_ extends BaseTag implements Factory\StaticMethod
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return ($this->type ? $this->type.' ' : '')
|
||||
.(empty($this->variableName) ? null : ('$'.$this->variableName))
|
||||
.($this->description ? ' '.$this->description : '');
|
||||
return ($this->type ? $this->type . ' ' : '')
|
||||
. (empty($this->variableName) ? null : ('$' . $this->variableName))
|
||||
. ($this->description ? ' ' . $this->description : '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ final class DocBlockFactory implements DocBlockFactoryInterface
|
||||
$comment = trim(preg_replace('#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment));
|
||||
|
||||
// reg ex above is not able to remove */ from a single line docblock
|
||||
if (substr($comment, -2) == '*/') {
|
||||
if (substr($comment, -2) === '*/') {
|
||||
$comment = trim(substr($comment, 0, -2));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user