Skip to content

Commit d75496e

Browse files
committed
fix(qa) apply PHP74Migration:risky rule
1 parent bfd53f9 commit d75496e

File tree

16 files changed

+30
-32
lines changed

16 files changed

+30
-32
lines changed

lib/Doctrine/Adapter/Statement/Oracle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function bindParam($column, &$variable, $type = null, $length = null, $dr
152152
break;
153153
}
154154

155-
if (is_integer($column)) {
155+
if (is_int($column)) {
156156
$variable_name = ":oci_b_var_{$column}";
157157
} else {
158158
$variable_name = $column;
@@ -381,7 +381,7 @@ public function fetchAll($fetchStyle = Doctrine_Core::FETCH_BOTH, $colnum = 0)
381381
*/
382382
public function fetchColumn($columnIndex = 0)
383383
{
384-
if (!is_integer($columnIndex)) {
384+
if (!is_int($columnIndex)) {
385385
$this->handleError(['message' => 'columnIndex parameter should be numeric']);
386386

387387
return false;
@@ -452,7 +452,7 @@ public function fetchObject($className = 'stdClass', $args = [])
452452
*/
453453
public function getColumnMeta($column)
454454
{
455-
if (is_integer($column)) {
455+
if (is_int($column)) {
456456
$internal_column = $column + 1;
457457
} else {
458458
$internal_column = $column;

lib/Doctrine/Connection/Mssql.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private function parseOrderBy($orderby)
177177
$tokens = preg_split('/,/', $parsed);
178178

179179
for ($i = 0, $iMax = count($tokens); $i < $iMax; ++$i) {
180-
$tokens[$i] = trim(preg_replace_callback('/##(\d+)##/', function ($m) { return $chunks[$m[1]]; }, $tokens[$i]));
180+
$tokens[$i] = trim(preg_replace_callback('/##(\d+)##/', fn ($m) => $chunks[$m[1]], $tokens[$i]));
181181
}
182182

183183
return $tokens;
@@ -323,9 +323,7 @@ protected function replaceBoundParamsWithInlineValuesInQuery($query, array $para
323323

324324
$self = $this;
325325

326-
return preg_replace_callback('/##(\d+)##/', function ($m) use ($params, $self) {
327-
return (null === $params[$m[1]]) ? 'NULL' : $self->quote($params[$m[1]]);
328-
}, $query);
326+
return preg_replace_callback('/##(\d+)##/', fn ($m) => (null === $params[$m[1]]) ? 'NULL' : $self->quote($params[$m[1]]), $query);
329327
}
330328

331329
/**

lib/Doctrine/Expression/Driver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public function concat()
308308
{
309309
$args = func_get_args();
310310

311-
return 'CONCAT('.join(', ', (array) $args).')';
311+
return 'CONCAT('.implode(', ', (array) $args).')';
312312
}
313313

314314
/**
@@ -635,7 +635,7 @@ public function coalesce()
635635
{
636636
$args = func_get_args();
637637

638-
return 'COALESCE('.join(', ', (array) $args).')';
638+
return 'COALESCE('.implode(', ', (array) $args).')';
639639
}
640640

641641
/**

lib/Doctrine/Expression/Oracle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function concat()
4040
{
4141
$args = func_get_args();
4242

43-
return join(' || ', $args);
43+
return implode(' || ', $args);
4444
}
4545

4646
/**

lib/Doctrine/Expression/Pgsql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function concat()
137137
{
138138
$args = func_get_args();
139139

140-
return join(' || ', $args);
140+
return implode(' || ', $args);
141141
}
142142

143143
/**

lib/Doctrine/Expression/Sqlite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function concatImpl()
5959
{
6060
$args = func_get_args();
6161

62-
return join('', $args);
62+
return implode('', $args);
6363
}
6464

6565
/**

lib/Doctrine/Import/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,12 +739,12 @@ public function buildPhpDocs(array $definition)
739739
if (isset($phpCommentMap[$column['type']])) {
740740
$comment = $phpCommentMap[$column['type']];
741741
if ('enum' == $column['type']) {
742-
$comment = sprintf($comment, strtoupper(join(', ', $column['values'])));
742+
$comment = sprintf($comment, strtoupper(implode(', ', $column['values'])));
743743
}
744744
$commentOptions[] = $comment;
745745
}
746746

747-
$comment = join(', ', $commentOptions);
747+
$comment = implode(', ', $commentOptions);
748748

749749
$fieldName = trim($fieldName);
750750

lib/Doctrine/Parser/sfYaml/sfYamlInline.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected static function dumpArray($value)
120120
$keys = array_keys($value);
121121
if (
122122
(1 == count($keys) && '0' == $keys[0])
123-
|| (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (int) ($v + $w); }, 0) == count($keys) * (count($keys) - 1) / 2)) {
123+
|| (count($keys) > 1 && array_reduce($keys, fn ($v, $w) => (int) ($v + $w), 0) == count($keys) * (count($keys) - 1) / 2)) {
124124
$output = [];
125125
foreach ($value as $val) {
126126
$output[] = self::dump($val);

lib/Doctrine/Query/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ public function execute($params = [], $hydrationMode = null)
10781078
} else {
10791079
$stmt = $this->_execute($params);
10801080

1081-
if (is_integer($stmt)) {
1081+
if (is_int($stmt)) {
10821082
$result = $stmt;
10831083
} else {
10841084
$this->_hydrator->setQueryComponents($this->_queryComponents);

lib/Doctrine/Query/Tokenizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ private function clauseExplodeCountBrackets($str, $regexp, $e1 = '(', $e2 = ')')
358358
}
359359

360360
$terms = array_merge($terms, $subterms);
361-
$i += sizeof($subterms);
361+
$i += count($subterms);
362362
}
363363
}
364364

0 commit comments

Comments
 (0)