Skip to content

Commit 209cba2

Browse files
dbulsmith77
authored andcommitted
update composer, adjust is_null to null ===
1 parent 2d9de78 commit 209cba2

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
],
2929
"require": {
3030
"php": ">=5.3.0",
31-
"phpcr/phpcr": "~2.1.0-beta10",
31+
"phpcr/phpcr": "~2.1.0-RC1",
3232
"symfony/console": "~2.0"
3333
},
3434
"autoload": {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function applyFilters(Token $token)
4141

4242
$token = $filter->filter($token);
4343

44-
if (is_null($token)) {
44+
if (null === $token) {
4545
break;
4646
}
4747
}

src/PHPCR/Util/QOM/QomToSql2QueryConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected function convertSameNodeJoinCondition(QOM\SameNodeJoinConditionInterfa
116116
return $this->generator->evalSameNodeJoinCondition(
117117
$condition->getSelector1Name(),
118118
$condition->getSelector2Name(),
119-
! is_null($condition->getSelector2Path()) ? $this->convertPath($condition->getSelector2Path()) : null);
119+
null !== $condition->getSelector2Path() ? $this->convertPath($condition->getSelector2Path()) : null);
120120
}
121121

122122
/**

src/PHPCR/Util/QOM/Sql2Generator.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ class Sql2Generator extends BaseSqlGenerator
1717
* Selector ::= nodeTypeName ['AS' selectorName]
1818
* nodeTypeName ::= Name
1919
*
20-
* @param string $nodeTypeName The node type of the selector. If it does not contain starting and ending brackets ([]) they will be added automatically
21-
* @param string $selectorName
20+
* @param string $nodeTypeName The node type of the selector. If it
21+
* does not contain starting and ending brackets ([]) they will be
22+
* added automatically.
23+
* @param string|null $selectorName The selector name. If it is different than
24+
* the nodeTypeName, the alias is declared.
2225
*
2326
* @return string
2427
*/
2528
public function evalSelector($nodeTypeName, $selectorName = null)
2629
{
2730
$sql2 = $this->addBracketsIfNeeded($nodeTypeName);
2831

29-
if (! is_null($selectorName) && $nodeTypeName !== $selectorName) {
32+
if (null !== $selectorName && $nodeTypeName !== $selectorName) {
3033
// if the selector name is the same as the type name, this is implicit for sql2
3134
$sql2 .= ' AS ' . $selectorName;
3235
}
@@ -112,7 +115,9 @@ public function evalSameNodeJoinCondition($sel1Name, $sel2Name, $sel2Path = null
112115
. $this->addBracketsIfNeeded($sel1Name) . ', '
113116
. $this->addBracketsIfNeeded($sel2Name)
114117
;
115-
$sql2 .= ! is_null($sel2Path) ? ', ' . $sel2Path : '';
118+
if (null !== $sel2Path) {
119+
$sql2 .= ', ' . $sel2Path;
120+
}
116121
$sql2 .= ')';
117122

118123
return $sql2;
@@ -165,7 +170,7 @@ public function evalDescendantNodeJoinCondition($descendantSelectorName, $ancest
165170
public function evalSameNode($path, $selectorName = null)
166171
{
167172
$sql2 = 'ISSAMENODE(';
168-
$sql2 .= is_null($selectorName) ? $path : $this->addBracketsIfNeeded($selectorName) . ', ' . $path;
173+
$sql2 .= null === $selectorName ? $path : $this->addBracketsIfNeeded($selectorName) . ', ' . $path;
169174
$sql2 .= ')';
170175

171176
return $sql2;
@@ -180,7 +185,7 @@ public function evalSameNode($path, $selectorName = null)
180185
public function evalChildNode($path, $selectorName = null)
181186
{
182187
$sql2 = 'ISCHILDNODE(';
183-
$sql2 .= is_null($selectorName) ? $path : $this->addBracketsIfNeeded($selectorName) . ', ' . $path;
188+
$sql2 .= null === $selectorName ? $path : $this->addBracketsIfNeeded($selectorName) . ', ' . $path;
184189
$sql2 .= ')';
185190

186191
return $sql2;
@@ -195,7 +200,7 @@ public function evalChildNode($path, $selectorName = null)
195200
public function evalDescendantNode($path, $selectorName = null)
196201
{
197202
$sql2 = 'ISDESCENDANTNODE(';
198-
$sql2 .= is_null($selectorName) ? $path : $this->addBracketsIfNeeded($selectorName) . ', ' . $path;
203+
$sql2 .= null === $selectorName ? $path : $this->addBracketsIfNeeded($selectorName) . ', ' . $path;
199204
$sql2 .= ')';
200205

201206
return $sql2;
@@ -289,7 +294,7 @@ public function evalFullTextSearchScore($selectorValue = null)
289294
*/
290295
public function evalPropertyValue($propertyName, $selectorName = null)
291296
{
292-
$sql2 = ! is_null($selectorName) ? $this->addBracketsIfNeeded($selectorName) . '.' : '';
297+
$sql2 = null !== $selectorName ? $this->addBracketsIfNeeded($selectorName) . '.' : '';
293298
if (false !== strpos($propertyName, ':')) {
294299
$propertyName = "[$propertyName]";
295300
}
@@ -340,11 +345,11 @@ public function evalColumns($columns)
340345
public function evalColumn($selectorName, $propertyName = null, $colname = null)
341346
{
342347
$sql2 = '';
343-
if (! is_null($selectorName) && is_null($propertyName) && is_null($colname)) {
348+
if (null !== $selectorName && null === $propertyName && null === $colname) {
344349
$sql2 .= $this->addBracketsIfNeeded($selectorName) . '.*';
345350
} else {
346351
$sql2 .= $this->evalPropertyValue($propertyName, $selectorName);
347-
if (!is_null($colname) && $colname !== $propertyName) {
352+
if (null !== $colname && $colname !== $propertyName) {
348353
// if the column name is the same as the property name, this is implicit for sql2
349354
$sql2 .= ' AS ' . $colname;
350355
}

src/PHPCR/Util/QOM/Sql2ToQomQueryConverter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ protected function parseSelector()
172172
*/
173173
protected function parseName()
174174
{
175-
// TODO: check it's the correct way to parse a JCR name
176175
return $this->scanner->fetchNextToken();
177176
}
178177

tests/PHPCR/Tests/Util/ValueConverterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function dataConversionMatrix()
272272
*/
273273
public function testConvertType($value, $srctype, $expected, $targettype)
274274
{
275-
if (is_null($expected)) {
275+
if (null === $expected) {
276276
try {
277277
$this->valueConverter->convertType($value, $targettype, $srctype);
278278
$this->fail('Excpected that this conversion would throw an exception');

0 commit comments

Comments
 (0)