Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aurimasniekis/action_blocks_concept
Action blocks proof of concept
https://github.com/aurimasniekis/action_blocks_concept
Last synced: 1 day ago
JSON representation
Action blocks proof of concept
- Host: GitHub
- URL: https://github.com/aurimasniekis/action_blocks_concept
- Owner: aurimasniekis
- License: mit
- Created: 2015-11-20T21:10:53.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-20T21:11:46.000Z (about 9 years ago)
- Last Synced: 2024-11-29T13:43:54.698Z (2 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Action blocks proof of concept
=============================Code:
-----```php
addExecutor($addExecutor);
$executor->addExecutor($multiplyExecutor);
$executor->addExecutor($inSequelExecutor);$actions = new \Acme\Action\InSequelAction(
new \Acme\Action\AddAction(
new \Acme\Action\AddAction(2, 2),
new \Acme\Action\MultiplyAction(2, new \Acme\Action\AddAction(2, 2))
),
new \Acme\Action\AddAction(
new \Acme\Action\AddAction(3, 3),
new \Acme\Action\MultiplyAction(3, new \Acme\Action\AddAction(3, 3))
),
new \Acme\Action\AddAction(
new \Acme\Action\AddAction(4, 4),
new \Acme\Action\MultiplyAction(4, new \Acme\Action\AddAction(4, 4))
)
);var_dump($executor->execute($actions));
```Result
------```php
array(3) {
[0] =>
int(12)
[1] =>
int(24)
[2] =>
int(40)
}
```