Skip to content

Commit

Permalink
Merge pull request cakephp#17778 from Harfusha/Rector_CombinedAssignR…
Browse files Browse the repository at this point in the history
…ector

Add changes from rector rule CombinedAssignRector
  • Loading branch information
ADmad authored Aug 4, 2024
2 parents 51e369a + d95337c commit 254d1a3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Collection/CollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public function takeLast(int $length): CollectionInterface
$offset++;
}

$offset = $offset % $length;
$offset %= $length;
$head = array_slice($result, $offset);
$tail = array_slice($result, 0, $offset);

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Expression/AggregateExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function count(): int
{
$count = parent::count();
if ($this->window !== null) {
$count = $count + 1;
$count += 1;
}

return $count;
Expand Down
2 changes: 1 addition & 1 deletion src/Database/QueryCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function _buildSelectPart(array $parts, Query $query, ValueBinder $bin
$parts = $this->_stringifyExpressions($parts, $binder);
foreach ($parts as $k => $p) {
if (!is_numeric($k)) {
$p = $p . ' AS ';
$p .= ' AS ';
if ($quoteIdentifiers) {
$p .= $driver->quoteIdentifier($k);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ public function postLink(string $title, array|string|null $url = null, array $op
$onClick = 'document.' . $formName . '.submit();';
if ($confirmMessage) {
$onClick = $this->_confirm($onClick, '');
$onClick = $onClick . 'event.returnValue = false; return false;';
$onClick .= 'event.returnValue = false; return false;';
$onClick = $this->templater()->format('confirmJs', [
'confirmMessage' => h($confirmMessage),
'formName' => $formName,
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/ORM/Query/SelectQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@ public function testFormatBelongsToRecords(): void
})
->formatResults(function ($authors) {
return $authors->map(function ($author) {
$author->idCopy = $author->idCopy + 2;
$author->idCopy += 2;

return $author;
});
Expand Down Expand Up @@ -2431,7 +2431,7 @@ public function testFormatDeepAssociationRecords(): void
})
->formatResults(function ($results) {
return $results->map(function ($result) {
$result->idCopy = $result->idCopy + 2;
$result->idCopy += 2;

return $result;
});
Expand Down

0 comments on commit 254d1a3

Please sign in to comment.