Skip to content

Commit

Permalink
Merge branch '10.x' into add-color-into-notification-action
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPunyapal committed Mar 9, 2024
2 parents fef094a + f2bff1c commit cfcfadd
Show file tree
Hide file tree
Showing 25 changed files with 533 additions and 118 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,24 @@ jobs:
bash ./bin/release.sh v${{ steps.version.outputs.version }}
script_stop: true

- name: Generate release notes
id: notes
uses: RedCrafter07/release-notes-action@main
with:
tag-name: v${{ steps.version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
# - name: Generate release notes
# id: notes
# uses: RedCrafter07/release-notes-action@main
# with:
# tag-name: v${{ steps.version.outputs.version }}
# token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref_name }}

- name: Cleanup release notes
run: |
sed -i '/## What/d' ${{ steps.notes.outputs.release-notes }}
sed -i '/## New Contributors/,$d' ${{ steps.notes.outputs.release-notes }}
# - name: Cleanup release notes
# run: |
# sed -i '/## What/d' ${{ steps.notes.outputs.release-notes }}
# sed -i '/## New Contributors/,$d' ${{ steps.notes.outputs.release-notes }}

- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
body: ${{ steps.notes.outputs.release-notes }}
# - name: Create release
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ steps.version.outputs.version }}
# name: v${{ steps.version.outputs.version }}
# body: ${{ steps.notes.outputs.release-notes }}
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Release Notes for 10.x

## [Unreleased](https://github.com/laravel/framework/compare/v10.46.0...10.x)
## [Unreleased](https://github.com/laravel/framework/compare/v10.47.0...10.x)

## [v10.47.0](https://github.com/laravel/framework/compare/v10.46.0...v10.47.0) - 2024-03-05

* [10.x] Allow for relation key to be an enum by [@AJenbo](https://github.com/AJenbo) in https://github.com/laravel/framework/pull/50311
* FIx for "empty" strings passed to Str::apa() by [@tiagof](https://github.com/tiagof) in https://github.com/laravel/framework/pull/50335
* [10.x] Fixed header mail text component to not use markdown by [@dmyers](https://github.com/dmyers) in https://github.com/laravel/framework/pull/50332
* [10.x] Add test for the "empty strings in `Str::apa()`" fix by [@osbre](https://github.com/osbre) in https://github.com/laravel/framework/pull/50340
* [10.x] Fix the cache cannot expire cache with `0` TTL by [@kayw-geek](https://github.com/kayw-geek) in https://github.com/laravel/framework/pull/50359
* [10.x] Add fail on timeout to queue listener by [@saeedhosseiinii](https://github.com/saeedhosseiinii) in https://github.com/laravel/framework/pull/50352
* [10.x] Support sort option flags on sortByMany Collections by [@TWithers](https://github.com/TWithers) in https://github.com/laravel/framework/pull/50269
* [10.x] Add `whereAll` and `whereAny` methods to the query builder by [@musiermoore](https://github.com/musiermoore) in https://github.com/laravel/framework/pull/50344
* [10.x] Adds Reverb broadcasting driver by [@joedixon](https://github.com/joedixon) in https://github.com/laravel/framework/pull/50088

## [v10.46.0](https://github.com/laravel/framework/compare/v10.45.1...v10.46.0) - 2024-02-27

Expand Down
11 changes: 11 additions & 0 deletions src/Illuminate/Broadcasting/BroadcastManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,17 @@ protected function callCustomCreator(array $config)
return $this->customCreators[$config['driver']]($this->app, $config);
}

/**
* Create an instance of the driver.
*
* @param array $config
* @return \Illuminate\Contracts\Broadcasting\Broadcaster
*/
protected function createReverbDriver(array $config)
{
return $this->createPusherDriver($config);
}

/**
* Create an instance of the driver.
*
Expand Down
24 changes: 10 additions & 14 deletions src/Illuminate/Cache/RedisTaggedCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ public function add($key, $value, $ttl = null)
if ($ttl !== null) {
$seconds = $this->getSeconds($ttl);

if ($seconds <= 0) {
return false;
if ($seconds > 0) {
$this->tags->addEntry(
$this->itemKey($key),
$seconds
);
}
}

$this->tags->addEntry(
$this->itemKey($key),
$seconds
);

return parent::add($key, $value, $ttl);
}

Expand All @@ -48,15 +46,13 @@ public function put($key, $value, $ttl = null)

$seconds = $this->getSeconds($ttl);

if ($seconds <= 0) {
return false;
if ($seconds > 0) {
$this->tags->addEntry(
$this->itemKey($key),
$seconds
);
}

$this->tags->addEntry(
$this->itemKey($key),
$seconds
);

return parent::put($key, $value, $ttl);
}

Expand Down
3 changes: 1 addition & 2 deletions src/Illuminate/Cache/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
*/
class Repository implements ArrayAccess, CacheContract
{
use InteractsWithTime;
use Macroable {
use InteractsWithTime, Macroable {
__call as macroCall;
}

Expand Down
23 changes: 19 additions & 4 deletions src/Illuminate/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ public function sortDesc($options = SORT_REGULAR)
public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
{
if (is_array($callback) && ! is_callable($callback)) {
return $this->sortByMany($callback);
return $this->sortByMany($callback, $options);
}

$results = [];
Expand Down Expand Up @@ -1428,13 +1428,14 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false)
* Sort the collection using multiple comparisons.
*
* @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}> $comparisons
* @param int $options
* @return static
*/
protected function sortByMany(array $comparisons = [])
protected function sortByMany(array $comparisons = [], int $options = SORT_REGULAR)
{
$items = $this->items;

uasort($items, function ($a, $b) use ($comparisons) {
uasort($items, function ($a, $b) use ($comparisons, $options) {
foreach ($comparisons as $comparison) {
$comparison = Arr::wrap($comparison);

Expand All @@ -1452,7 +1453,21 @@ protected function sortByMany(array $comparisons = [])
$values = array_reverse($values);
}

$result = $values[0] <=> $values[1];
if (($options & SORT_FLAG_CASE) === SORT_FLAG_CASE) {
if (($options & SORT_NATURAL) === SORT_NATURAL) {
$result = strnatcasecmp($values[0], $values[1]);
} else {
$result = strcasecmp($values[0], $values[1]);
}
} else {
$result = match ($options) {
SORT_NUMERIC => intval($values[0]) <=> intval($values[1]),
SORT_STRING => strcmp($values[0], $values[1]),
SORT_NATURAL => strnatcmp($values[0], $values[1]),
SORT_LOCALE_STRING => strcoll($values[0], $values[1]),
default => $values[0] <=> $values[1],
};
}
}

if ($result === 0) {
Expand Down
19 changes: 9 additions & 10 deletions src/Illuminate/Database/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,15 @@ public function transaction(Closure $callback, $attempts = 1)
continue;
}

$levelBeingCommitted = $this->transactions;

try {
if ($this->transactions == 1) {
$this->fireConnectionEvent('committing');
$this->getPdo()->commit();
}

[$levelBeingCommitted, $this->transactions] = [
$this->transactions,
max(0, $this->transactions - 1),
];

$this->transactionsManager?->commit(
$this->getName(),
$levelBeingCommitted,
$this->transactions
);
$this->transactions = max(0, $this->transactions - 1);
} catch (Throwable $e) {
$this->handleCommitTransactionException(
$e, $currentAttempt, $attempts
Expand All @@ -65,6 +58,12 @@ public function transaction(Closure $callback, $attempts = 1)
continue;
}

$this->transactionsManager?->commit(
$this->getName(),
$levelBeingCommitted,
$this->transactions
);

$this->fireConnectionEvent('committed');

return $callbackResult;
Expand Down
Loading

0 comments on commit cfcfadd

Please sign in to comment.