Skip to content

Commit a966909

Browse files
committed
cs fixes
1 parent 48592ad commit a966909

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+116
-131
lines changed

src/PHPCR/Util/CND/Exception/ParserException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(TokenQueue $queue, $msg)
2121

2222
// construct a lookup of the next tokens
2323
$lookup = '';
24-
for($i = 1; $i <= 5; $i++) {
24+
for ($i = 1; $i <= 5; $i++) {
2525
if ($queue->isEof()) {
2626
break;
2727
}

src/PHPCR/Util/CND/Parser/AbstractParser.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ abstract class AbstractParser
2424
{
2525
/**
2626
* The token queue
27+
*
2728
* @var TokenQueue
2829
*/
2930
protected $tokenQueue;
@@ -33,11 +34,11 @@ abstract class AbstractParser
3334
* If the data is not provided (equal to null) then only the token type is checked.
3435
* Return false otherwise.
3536
*
36-
* @param int $type The expected token type
37-
* @param null|string $data The expected data or null
38-
* @param bool $ignoreCase whether to do string comparisons case insensitive or sensitive
37+
* @param int $type The expected token type
38+
* @param null|string $data The expected data or null
39+
* @param bool $ignoreCase whether to do string comparisons case insensitive or sensitive
3940
*
40-
* @return bool
41+
* @return boolean
4142
*/
4243
protected function checkToken($type, $data = null, $ignoreCase = false)
4344
{
@@ -68,7 +69,7 @@ protected function checkToken($type, $data = null, $ignoreCase = false)
6869
* @param int $type
6970
* @param array $data
7071
*
71-
* @return bool
72+
* @return boolean
7273
*/
7374
protected function checkTokenIn($type, array $data, $ignoreCase = false)
7475
{
@@ -85,7 +86,7 @@ protected function checkTokenIn($type, array $data, $ignoreCase = false)
8586
* Check if the next token matches the expected type and data. If it does, then consume and return it,
8687
* otherwise throw an exception.
8788
*
88-
* @param int $type The expected token type
89+
* @param int $type The expected token type
8990
* @param null|string $data The expected token data or null
9091
*
9192
* @return Token
@@ -109,15 +110,17 @@ protected function expectToken($type, $data = null)
109110
* Check if the next token matches the expected type and data. If it does, then consume it, otherwise
110111
* return false.
111112
*
112-
* @param int $type The expected token type
113+
* @param int $type The expected token type
113114
* @param null|string $data The expected token data or null
114-
* @return bool|Token
115+
*
116+
* @return boolean|Token
115117
*/
116118
protected function checkAndExpectToken($type, $data = null)
117119
{
118120
if ($this->checkToken($type, $data)) {
119121
$token = $this->tokenQueue->peek();
120122
$this->tokenQueue->next();
123+
121124
return $token;
122125
}
123126

src/PHPCR/Util/CND/Parser/CndParser.php

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ protected function parseNodeTypeAttributes(NodeTypeTemplateInterface $nodeType)
253253
while (true) {
254254
if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->ORDERABLE)) {
255255
$nodeType->setOrderableChildNodes(true);
256-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MIXIN)) {
256+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MIXIN)) {
257257
$nodeType->setMixin(true);
258-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->ABSTRACT)) {
258+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->ABSTRACT)) {
259259
$nodeType->setAbstract(true);
260-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->NOQUERY)) {
260+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->NOQUERY)) {
261261
$nodeType->setQueryable(false);
262-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->QUERY)) {
262+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->QUERY)) {
263263
$nodeType->setQueryable(true);
264-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PRIMARYITEM)) {
264+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PRIMARYITEM)) {
265265
/*
266266
* If 'primaryitem' is present without a '?' then the string following it is
267267
* the name of the primary item of the node type.
@@ -484,23 +484,23 @@ protected function parsePropertyAttributes(NodeTypeTemplateInterface $parentType
484484
while (true) {
485485
if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PRIMARY)) {
486486
$parentType->setPrimaryItemName($property->getName());
487-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->AUTOCREATED)) {
487+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->AUTOCREATED)) {
488488
$property->setAutoCreated(true);
489-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MANDATORY)) {
489+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MANDATORY)) {
490490
$property->setMandatory(true);
491-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PROTECTED)) {
491+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PROTECTED)) {
492492
$property->setProtected(true);
493-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MULTIPLE)) {
493+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MULTIPLE)) {
494494
$property->setMultiple(true);
495-
} else if ($this->checkTokenIn(Token::TK_SYMBOL, $this->MULTIPLE)) {
495+
} elseif ($this->checkTokenIn(Token::TK_SYMBOL, $this->MULTIPLE)) {
496496
$property->setMultiple(true);
497-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->QUERYOPS)) {
497+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->QUERYOPS)) {
498498
$property->setAvailableQueryOperators($this->parseQueryOpsAttribute());
499-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->NOFULLTEXT)) {
499+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->NOFULLTEXT)) {
500500
$property->setFullTextSearchable(false);
501-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->NOQUERYORDER)) {
501+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->NOQUERYORDER)) {
502502
$property->setQueryOrderable(false);
503-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->OPV)) {
503+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->OPV)) {
504504
if ($opvSeen) {
505505
throw new ParserException($this->tokenQueue, 'More than one on parent version action specified on property ' . $property->getName());
506506
}
@@ -602,18 +602,18 @@ protected function parseChildNodeAttributes(
602602
NodeTypeTemplateInterface $parentType,
603603
NodeDefinitionTemplateInterface $childType
604604
) {
605-
while(true) {
605+
while (true) {
606606
if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PRIMARY)) {
607607
$parentType->setPrimaryItemName($childType->getName());
608-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->AUTOCREATED)) {
608+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->AUTOCREATED)) {
609609
$childType->setAutoCreated(true);
610-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MANDATORY)) {
610+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->MANDATORY)) {
611611
$childType->setMandatory(true);
612-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PROTECTED)) {
612+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->PROTECTED)) {
613613
$childType->setProtected(true);
614-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->SNS)) {
614+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->SNS)) {
615615
$childType->setSameNameSiblings(true);
616-
} else if ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->OPV)) {
616+
} elseif ($this->checkTokenIn(Token::TK_IDENTIFIER, $this->OPV)) {
617617
$token = $this->tokenQueue->get();
618618
$childType->setOnParentVersion(OnParentVersionAction::valueFromName($token->getData()));
619619
continue;
@@ -678,6 +678,7 @@ protected function parseCndString()
678678
if ($type === Token::TK_STRING) {
679679
$string = substr($data, 1, -1);
680680
$this->tokenQueue->next();
681+
681682
return $string;
682683
}
683684

src/PHPCR/Util/CND/Reader/BufferReader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function currentChar()
110110
}
111111

112112
/**
113-
* @return bool
113+
* @return boolean
114114
*/
115115
public function isEof()
116116
{
@@ -122,6 +122,7 @@ public function isEof()
122122

123123
/**
124124
* Advance the forward position and return the literal delimited by start and end position
125+
*
125126
* @return string
126127
*/
127128
public function forward()
@@ -142,6 +143,7 @@ public function forward()
142143
public function forwardChar()
143144
{
144145
$this->forward();
146+
145147
return $this->currentChar();
146148
}
147149

src/PHPCR/Util/CND/Reader/FileReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class FileReader extends BufferReader
1818

1919
/**
2020
* @param string $path
21+
*
2122
* @throws \InvalidArgumentException
2223
*/
2324
public function __construct($path)

src/PHPCR/Util/CND/Reader/ReaderInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@ public function getEofMarker();
2121
public function currentChar();
2222

2323
/**
24-
* @return bool
24+
* @return boolean
2525
*/
2626
public function isEof();
2727

2828
/**
2929
* @return int
3030
*/
31-
function getCurrentLine();
31+
public function getCurrentLine();
3232

3333
/**
3434
* @return int
3535
*/
36-
function getCurrentColumn();
36+
public function getCurrentColumn();
3737

3838
/**
3939
* Return the literal delimited by start and end position
40+
*
4041
* @return string
4142
*/
4243
public function current();
@@ -51,7 +52,6 @@ public function forwardChar();
5152

5253
/**
5354
* Rewind the forward position to the start position
54-
* @return void
5555
*/
5656
public function rewind();
5757

src/PHPCR/Util/CND/Scanner/AbstractScanner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ public function resetQueue()
3232

3333
/**
3434
* @param Token $token
35-
* @return Token | void
35+
*
36+
* @return Token|void
3637
*/
3738
public function applyFilters(Token $token)
3839
{

src/PHPCR/Util/CND/Scanner/Context/DefaultScannerContext.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace PHPCR\Util\CND\Scanner\Context;
44

5-
use PHPCR\Util\CND\Scanner\TokenFilter\TokenFilterInterface;
6-
75
/**
86
* @license http://www.apache.org/licenses Apache License Version 2.0, January 2004
97
* @license http://opensource.org/licenses/MIT MIT License
@@ -28,7 +26,7 @@ public function __construct()
2826
'<', '>', '+', '*', '%', '&', '/', '(', ')', '=', '?', '#', '|', '!', '~',
2927
'[', ']', '{', '}', '$', ',', ';', ':', '.', '-', '_', '\\',
3028
);
31-
foreach($symbols as $symbol) {
29+
foreach ($symbols as $symbol) {
3230
$this->addSymbol($symbol);
3331
}
3432
}

src/PHPCR/Util/CND/Scanner/Context/ScannerContext.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class ScannerContext
5656
*/
5757
protected $tokenFilters = array();
5858

59-
6059
/**
6160
* @param string $startDelim
6261
* @param string $endDelim

0 commit comments

Comments
 (0)