-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes ignored default values in handle method.
- Always call `resolveAttributesFromConstructor` in the constructor to account for possible attributes in handle signature. - Treat attributes `handle` and attributes in `getAttributesFromConstructor` separately. - Normalize return value to `$this` in `resolveAttributesFromConstructor`
- Loading branch information
Justin Scott
committed
Oct 16, 2020
1 parent
ef190a2
commit d8fc49d
Showing
4 changed files
with
42 additions
and
6 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,15 @@ | ||
<?php | ||
|
||
namespace Lorisleiva\Actions\Tests\Actions; | ||
|
||
use Lorisleiva\Actions\Action; | ||
|
||
class SimpleCalculatorWithHandleDefaults extends SimpleCalculator | ||
{ | ||
protected $getAttributesFromConstructor = true; | ||
|
||
public function handle($operation, $left = 50, $right = 100) | ||
{ | ||
return parent::handle($operation, $left, $right); | ||
} | ||
} |
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