Skip to content

Commit 84b5386

Browse files
committed
Enable no_useless_concat_operator
1 parent a3eedf4 commit 84b5386

File tree

12 files changed

+26
-15
lines changed

12 files changed

+26
-15
lines changed

.php-cs-fixer.dist.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
__DIR__ . '/spark',
3939
]);
4040

41-
$overrides = [];
41+
$overrides = [
42+
'no_useless_concat_operator' => [
43+
'juggle_simple_strings' => true,
44+
],
45+
];
4246

4347
$options = [
4448
'cacheFile' => 'build/.php-cs-fixer.cache',

.php-cs-fixer.no-header.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
__DIR__ . '/admin/starter/builds',
3131
]);
3232

33-
$overrides = [];
33+
$overrides = [
34+
'no_useless_concat_operator' => [
35+
'juggle_simple_strings' => true,
36+
],
37+
];
3438

3539
$options = [
3640
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',

.php-cs-fixer.user-guide.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
'php_unit_internal_class' => false,
3434
'no_unused_imports' => false,
3535
'class_attributes_separation' => false,
36+
'no_useless_concat_operator' => [
37+
'juggle_simple_strings' => true,
38+
],
3639
];
3740

3841
$options = [

system/Database/BaseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ public function unionAll($union)
11791179
*/
11801180
protected function addUnionStatement($union, bool $all = false)
11811181
{
1182-
$this->QBUnion[] = "\n" . 'UNION '
1182+
$this->QBUnion[] = "\nUNION "
11831183
. ($all ? 'ALL ' : '')
11841184
. 'SELECT * FROM '
11851185
. $this->buildSubquery($union, true, 'uwrp' . (count($this->QBUnion) + 1));

system/Database/MySQLi/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public function escapeLikeStringDirect($str)
360360
// Escape LIKE condition wildcards
361361
return str_replace(
362362
[$this->likeEscapeChar, '%', '_'],
363-
['\\' . $this->likeEscapeChar, '\\' . '%', '\\' . '_'],
363+
['\\' . $this->likeEscapeChar, '\\%', '\\_'],
364364
$str
365365
);
366366
}

system/Debug/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
386386
mkdir(WRITEPATH . 'debugbar', 0777);
387387
}
388388

389-
write_file(WRITEPATH . 'debugbar/' . 'debugbar_' . $time . '.json', $data, 'w+');
389+
write_file(WRITEPATH . 'debugbar/debugbar_' . $time . '.json', $data, 'w+');
390390

391391
$format = $response->getHeaderLine('content-type');
392392

system/Helpers/form_helper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,13 +484,13 @@ function form_datalist(string $name, string $value, array $options): string
484484

485485
$out = form_input($data) . "\n";
486486

487-
$out .= "<datalist id='" . $name . '_list' . "'>";
487+
$out .= "<datalist id='" . $name . "_list'>";
488488

489489
foreach ($options as $option) {
490-
$out .= "<option value='{$option}'>" . "\n";
490+
$out .= "<option value='{$option}'>\n";
491491
}
492492

493-
return $out . ('</datalist>' . "\n");
493+
return $out . ("</datalist>\n");
494494
}
495495
}
496496

system/View/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ protected function parsePair(string $variable, array $data, string $template): a
277277
// have something to loop over.
278278
preg_match_all(
279279
'#' . $this->leftDelimiter . '\s*' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '(.+?)' .
280-
$this->leftDelimiter . '\s*' . '/' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '#s',
280+
$this->leftDelimiter . '\s*/' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '#s',
281281
$template,
282282
$matches,
283283
PREG_SET_ORDER

tests/system/HTTP/MessageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function testAppendBody()
156156

157157
$this->message->appendBody('\n');
158158

159-
$this->assertSame('moo' . '\n', $this->message->getBody());
159+
$this->assertSame('moo\n', $this->message->getBody());
160160
}
161161

162162
public function testSetHeaderReplacingHeader()

tests/system/Images/GDHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public function testImageConvert()
413413
public function testImageReorientLandscape()
414414
{
415415
for ($i = 0; $i <= 8; $i++) {
416-
$source = $this->origin . 'EXIFsamples/landscape_' . '' . $i . '.jpg';
416+
$source = $this->origin . 'EXIFsamples/landscape_' . $i . '.jpg';
417417

418418
$this->handler->withFile($source);
419419
$this->handler->reorient();
@@ -429,7 +429,7 @@ public function testImageReorientLandscape()
429429
public function testImageReorientPortrait()
430430
{
431431
for ($i = 0; $i <= 8; $i++) {
432-
$source = $this->origin . 'EXIFsamples/portrait_' . '' . $i . '.jpg';
432+
$source = $this->origin . 'EXIFsamples/portrait_' . $i . '.jpg';
433433

434434
$this->handler->withFile($source);
435435
$this->handler->reorient();

tests/system/Images/ImageMagickHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public function testImageConvert()
408408
public function testImageReorientLandscape()
409409
{
410410
for ($i = 0; $i <= 8; $i++) {
411-
$source = $this->origin . 'EXIFsamples/landscape_' . '' . $i . '.jpg';
411+
$source = $this->origin . 'EXIFsamples/landscape_' . $i . '.jpg';
412412
$result = $this->root . 'landscape_' . $i . '_reoriented.jpg';
413413

414414
$this->handler->withFile($source);
@@ -427,7 +427,7 @@ public function testImageReorientLandscape()
427427
public function testImageReorientPortrait()
428428
{
429429
for ($i = 0; $i <= 8; $i++) {
430-
$source = $this->origin . 'EXIFsamples/portrait_' . '' . $i . '.jpg';
430+
$source = $this->origin . 'EXIFsamples/portrait_' . $i . '.jpg';
431431
$result = $this->root . 'portrait_' . $i . '_reoriented.jpg';
432432

433433
$this->handler->withFile($source);

user_guide_src/source/testing/benchmark/007.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Add a new task
66
$iterator->add('single_concat', static function () {
7-
$str = 'Some basic' . 'little' . 'string concatenation test.';
7+
$str = 'Some basiclittlestring concatenation test.';
88
});
99

1010
// Add another task

0 commit comments

Comments
 (0)