-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from saloonphp/fix/v3-improve-middleware-order
Fix | V3 - Improve middleware order and add support for PHP 8.3
- Loading branch information
Showing
11 changed files
with
149 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Saloon\Http\PendingRequest; | ||
|
||
use Saloon\Http\PendingRequest; | ||
|
||
class BootConnectorAndRequest | ||
{ | ||
/** | ||
* Boot the connector and request | ||
*/ | ||
public function __invoke(PendingRequest $pendingRequest): PendingRequest | ||
{ | ||
$pendingRequest->getConnector()->boot($pendingRequest); | ||
$pendingRequest->getRequest()->boot($pendingRequest); | ||
|
||
return $pendingRequest; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Saloon\Http\PendingRequest; | ||
|
||
use Saloon\Helpers\Helpers; | ||
use Saloon\Http\PendingRequest; | ||
|
||
class BootPlugins | ||
{ | ||
/** | ||
* Boot the plugins | ||
*/ | ||
public function __invoke(PendingRequest $pendingRequest): PendingRequest | ||
{ | ||
$connector = $pendingRequest->getConnector(); | ||
$request = $pendingRequest->getRequest(); | ||
|
||
$connectorTraits = Helpers::classUsesRecursive($connector); | ||
$requestTraits = Helpers::classUsesRecursive($request); | ||
|
||
foreach ($connectorTraits as $connectorTrait) { | ||
Helpers::bootPlugin($pendingRequest, $connector, $connectorTrait); | ||
} | ||
|
||
foreach ($requestTraits as $requestTrait) { | ||
Helpers::bootPlugin($pendingRequest, $request, $requestTrait); | ||
} | ||
|
||
return $pendingRequest; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.