Skip to content

Commit

Permalink
fix(concerns): deprecate exec method
Browse files Browse the repository at this point in the history
- Deprecate the exec method in the WithRunable trait
- Add deprecation warning message
- Suggest using the run method instead
  • Loading branch information
guanguans committed Jul 30, 2023
1 parent e7dbea4 commit a22f52e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Concerns/WithRunable.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ public function run($withOptions = [], ?callable $processTapper = null, ?callabl
*
* @throws InvalidOptionException
*
* @deprecated The method is deprecated and will be removed in version 4.0.0.
* @deprecated The method is deprecated and will be removed in version 4.0.
* Please use the {@see run} instead.
*/
protected function exec($withOptions = [], ?callable $processTapper = null, ?callable $callback = null): string
{
@trigger_error(
sprintf(
'Since guanguans/soar-php 3.0: The "%s" method is deprecated and will be removed in version 4.0. Please use the "run" method instead.',
__METHOD__
),
E_USER_DEPRECATED
);

return $this->run($withOptions, $processTapper, $callback);
}

Expand Down

0 comments on commit a22f52e

Please sign in to comment.