Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
__DIR__ . '/spark',
]);

$overrides = [];
$overrides = [
'no_useless_concat_operator' => [
'juggle_simple_strings' => true,
],
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
Expand Down
6 changes: 5 additions & 1 deletion .php-cs-fixer.no-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
__DIR__ . '/admin/starter/builds',
]);

$overrides = [];
$overrides = [
'no_useless_concat_operator' => [
'juggle_simple_strings' => true,
],
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
Expand Down
3 changes: 3 additions & 0 deletions .php-cs-fixer.user-guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
'php_unit_internal_class' => false,
'no_unused_imports' => false,
'class_attributes_separation' => false,
'no_useless_concat_operator' => [
'juggle_simple_strings' => true,
],
];

$options = [
Expand Down
2 changes: 1 addition & 1 deletion system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ public function unionAll($union)
*/
protected function addUnionStatement($union, bool $all = false)
{
$this->QBUnion[] = "\n" . 'UNION '
$this->QBUnion[] = "\nUNION "
. ($all ? 'ALL ' : '')
. 'SELECT * FROM '
. $this->buildSubquery($union, true, 'uwrp' . (count($this->QBUnion) + 1));
Expand Down
2 changes: 1 addition & 1 deletion system/Database/MySQLi/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public function escapeLikeStringDirect($str)
// Escape LIKE condition wildcards
return str_replace(
[$this->likeEscapeChar, '%', '_'],
['\\' . $this->likeEscapeChar, '\\' . '%', '\\' . '_'],
['\\' . $this->likeEscapeChar, '\\%', '\\_'],
$str
);
}
Expand Down
2 changes: 1 addition & 1 deletion system/Debug/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
mkdir(WRITEPATH . 'debugbar', 0777);
}

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

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

Expand Down
6 changes: 3 additions & 3 deletions system/Helpers/form_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,13 @@ function form_datalist(string $name, string $value, array $options): string

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

$out .= "<datalist id='" . $name . '_list' . "'>";
$out .= "<datalist id='" . $name . "_list'>";

foreach ($options as $option) {
$out .= "<option value='{$option}'>" . "\n";
$out .= "<option value='{$option}'>\n";
}

return $out . ('</datalist>' . "\n");
return $out . ("</datalist>\n");
}
}

Expand Down
2 changes: 1 addition & 1 deletion system/View/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected function parsePair(string $variable, array $data, string $template): a
// have something to loop over.
preg_match_all(
'#' . $this->leftDelimiter . '\s*' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '(.+?)' .
$this->leftDelimiter . '\s*' . '/' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '#s',
$this->leftDelimiter . '\s*/' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '#s',
$template,
$matches,
PREG_SET_ORDER
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function testAppendBody()

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

$this->assertSame('moo' . '\n', $this->message->getBody());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one almost got me 😆

$this->assertSame('moo\n', $this->message->getBody());
}

public function testSetHeaderReplacingHeader()
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Images/GDHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public function testImageConvert()
public function testImageReorientLandscape()
{
for ($i = 0; $i <= 8; $i++) {
$source = $this->origin . 'EXIFsamples/landscape_' . '' . $i . '.jpg';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

$source = $this->origin . 'EXIFsamples/landscape_' . $i . '.jpg';

$this->handler->withFile($source);
$this->handler->reorient();
Expand All @@ -429,7 +429,7 @@ public function testImageReorientLandscape()
public function testImageReorientPortrait()
{
for ($i = 0; $i <= 8; $i++) {
$source = $this->origin . 'EXIFsamples/portrait_' . '' . $i . '.jpg';
$source = $this->origin . 'EXIFsamples/portrait_' . $i . '.jpg';

$this->handler->withFile($source);
$this->handler->reorient();
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Images/ImageMagickHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public function testImageConvert()
public function testImageReorientLandscape()
{
for ($i = 0; $i <= 8; $i++) {
$source = $this->origin . 'EXIFsamples/landscape_' . '' . $i . '.jpg';
$source = $this->origin . 'EXIFsamples/landscape_' . $i . '.jpg';
$result = $this->root . 'landscape_' . $i . '_reoriented.jpg';

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

$this->handler->withFile($source);
Expand Down
10 changes: 2 additions & 8 deletions user_guide_src/source/testing/benchmark/007.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

$iterator = new \CodeIgniter\Debug\Iterator();

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

// Add another task
$iterator->add('double', static function ($a = 'little') {
$str = "Some basic {$little} string test.";
$iterator->add('double', static function ($word = 'little') {
"Some basic {$word} string test.";
});