PHP code example of zrone / hyperf-workflow

1. Go to this page and download the library: Download zrone/hyperf-workflow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zrone / hyperf-workflow example snippets

angular2html
php bin/hyperf.php vendor:publish zrone/hyperf-workflow
angular2html
class WorkflowService
{
    /**
     * @Inject
     * @var ContainerInterface $container
     */
    public $container;

    public function toReview(Event $event)
    {
        // event
        // ...
        var_dump(1);
        var_dump($event->getMetadata('label', $event->getTransition()));
    }

    public function publish(Event $event)
    {
        var_dump(2);
    }

    public function reject(Event $event)
    {
        var_dump(3);
    }
}