-
Notifications
You must be signed in to change notification settings - Fork 10
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 #60 from saloonphp/fix/improve-deprecations
Fix | Remove Saloon::fake() deprecations but deprecate methods
- Loading branch information
Showing
5 changed files
with
112 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^PHPDoc tag \\@mixin contains invalid type Saloon\\\\Laravel\\\\Traits\\\\HasDeprecatedFacadeMethods.$#" | ||
count: 1 | ||
path: src/Facades/Saloon.php |
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,87 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Saloon\Laravel\Traits; | ||
|
||
use Saloon\Http\Response; | ||
|
||
/** | ||
* @internal This trait is only used to present deprecations. | ||
*/ | ||
trait HasDeprecatedFacadeMethods | ||
{ | ||
/** | ||
* Assert JSON response data was received | ||
* | ||
* @param array<string, mixed> $data | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
*/ | ||
public static function assertSentJson(string $request, array $data): void | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
|
||
/** | ||
* Start Saloon recording responses. | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
*/ | ||
public function record(): void | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
|
||
/** | ||
* Stop Saloon recording responses. | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
*/ | ||
public function stopRecording(): void | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
|
||
/** | ||
* Check if Saloon is recording | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
*/ | ||
public function isRecording(): bool | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
|
||
/** | ||
* Record a response. | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
*/ | ||
public function recordResponse(Response $response): void | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
|
||
/** | ||
* Get all the recorded responses. | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
* | ||
* @return array<\Saloon\Http\Response> | ||
*/ | ||
public function getRecordedResponses(): array | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
|
||
/** | ||
* Get the last response that Saloon recorded. | ||
* | ||
* @deprecated This method will be removed in Saloon v4. | ||
*/ | ||
public function getLastRecordedResponse(): ?Response | ||
{ | ||
// This trait is only used to present deprecations. | ||
} | ||
} |