Code Monkey home page Code Monkey logo

finite's Introduction

Finite, A Simple PHP Finite State Machine

Finite is a Simple State Machine, written in PHP. It can manage any Stateful object by defining states and transitions between these states.

Build Status Latest Stable Version Total Downloads License Scrutinizer Code Quality Code Coverage SensioLabsInsight Dependency Status Reference Status Gitter

Features

  • Managing State/Transition graph for an object
  • Defining and retrieving properties for states
  • Event Listenable transitions
  • Symfony2 integration
  • Custom state graph loaders
  • Twig Extension

Documentation

Documentation for master (1.1)

Getting started

Installation (via composer)

{
      "require": {
        "yohang/finite": "~1.1"
    }
}

Version note :

If your are using this library in a Symfony project, 1.1 version is only compatible with Symfony >=2.6. 1.0 is compatible with Symfony >=2.3, <2.6.

Define your Stateful Object

Your stateful object just need to implement the StatefulInterface Interface.

use Finite\StatefulInterface;

class Document implements StatefulInterface
{
        private $state;
        public function setFiniteState($state)
        {
                $this->state = $state;
        }

        public function getFiniteState()
        {
            return $this->state;
        }
}

Initializing a simple StateMachine

use Finite\StateMachine\StateMachine;
use Finite\State\State;
use Finite\State\StateInterface;

// $document = retrieve your stateful object

$sm = new StateMachine();

// Define states
$sm->addState(new State('s1', StateInterface::TYPE_INITIAL));
$sm->addState('s2');
$sm->addState('s3');
$sm->addState(new State('s4', StateInterface::TYPE_FINAL));

// Define transitions
$sm->addTransition('t12', 's1', 's2');
$sm->addTransition('t23', 's2', 's3');
$sm->addTransition('t34', 's3', 's4');
$sm->addTransition('t42', 's4', 's2');

// Initialize
$sm->setObject($document);
$sm->initialize();

// Retrieve current state
$sm->getCurrentState();

// Can we process a transition ?
$sm->can('t34');

finite's People

Contributors

acorncom avatar arikal avatar dannykopping avatar defrag avatar k-phoen avatar ksn135 avatar liuggio avatar navitronic avatar nidup avatar padam87 avatar pborreli avatar realshadow avatar reiz avatar ronrademaker avatar tompedals avatar tortuetorche avatar winzou avatar yohang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

finite's Issues

Introduce an interface for objects with multiple graphs

Like the current StatefulInterface for simple graphs.

This interface could contains a method, which could look like this when implemented :

public function configureStatefulProperties(Configurator $configurator)
{
    $configurator->addStatefulProperty('graph', 'property');
}

StateMachine used with Doctrine Entities

I would like to use a StateMachine implementation with some of my entities, but it seems a bit weird that the statemachine is not injected into the entity, but the entity is injected into the statemachine (maybe because this is new to me).

Any suggestion how to use this lib with doctrine? There is a doctrine behavior implementation, but I would be happier with a doctrine type instead.

finite.yml override issue

I have custom core bundle in my Sylius app, and have src/Umpirsky/Bundle/CoreBundle/Resources/config/finite.yml file where I override:

finite_finite:
    sylius_order_shipping:
...

The problem is that sylius_payment callbacks are not loaded at all for some reason. And when I put:

    sylius_payment:
        callbacks:
            after:
                sylius_update_order:
                    on:   'complete'
                    do:   [@sylius.callback.order_payment, 'updateOrderOnPayment']
                    args: ['object']

here it gets loaded twice, once under sylius_update_order key in array loader and once under 0 key. 😖 So its called twice.

Am I doing something wrong or this is a bug in Finite?

Add new maintainers

It's a nice and useful library, but it needs more care - solve outstanding issues, tag release versions regularly.

If you don't have the time or willpower to work on it, add more maintainers. Please don't let it die.

Add class option to states definition

Can we add the class node as optional to instantiate a custom State object in the states definition?

Example:

finite_finite:
    my_flow:
        class: Acme\DemoBundle\Model\MyStatefulClass
        states:
            101: # Cart 1x1 Created
                class: /MySpecial/StateClass # This must implement StateInterface
                type:  initial
                properties:
                    description: Cart is open.
                    cart: true
            201: # Order 2x1 Created
                class: /MySpecial/StateClass # This must implement StateInterface
                type:  normal
                properties:
                    description: Order has started.
                    order: true

[feature request] Markov chain

In finite state machine all transitions has probability of 100%, in Markov chain this probability can be configured.

Modifications are need to be done:

  • store probability in transition
  • can() should return true then probability > 0%
  • add function selectTrasition() which will select next transition randomly from available

Btw, are transitions support conditions? Transitions probability can be either float or callback, callbacks are needed to check condition and their return probability and can return probability 0%.

Interfaces and public method

namespace Finite\Transition\Transition implements TransitionInterface

but the Transition class has more public methods than the interface,
public method are API, and they should respect the interface, this is very important for future BCs.

The task is for all the Classes that doesn't respect the interface, move the functions to protected before the stable version.

Split standalone component and Symfony bundle

First, really nice project, i love it !

Is it possible to split Finite as standalone component without the symfony stack inside ? and add the symfony bundle on top ?

Currently on non symfony project (like silex or cilex) it's a bit frustrating to see a bundle folder appear :D

Is it plan ?

Symfony2 service injection

Hi,

I'm using your bundle in a Symfony2 console command. Right now I have a gigantic configuration of the state machine in my configure() function. You have created the opportunity to integrate the bundle through the service container, could you give me an example how I could do this for my project?

Awesome bundle!

composer

composers "yohang/finite": "~1.1" does not work, only "~1.0" on packagist...

Callback Handler improvement

I think we can have a really better way to integrate / process callback with a registry pattern and concret api implementation in dedicated class instead of options resolver.

Options resolver is not for do this, you resolve nothing in fact. From the start you know how validate your data and all needed options, and the options do not change during the workflow process.

        $this->specResolver->setDefaults(
            array(
                'on' => self::ALL,
                'from' => self::ALL,
                'to' => self::ALL,
                'exclude_from' => array(),
                'exclude_to' => array(),
            )
        );
        $this->specResolver->setAllowedTypes(
            array(
                'on' => array('string', 'array'),
                'from' => array('string', 'array'),
                'to' => array('string', 'array'),
                'exclude_from' => array('string', 'array'),
                'exclude_to' => array('string', 'array'),
            )
        );
        $toArrayNormalizer = function (Options $options, $value) {
            return (array) $value;
        };
        $this->specResolver->setNormalizers(
            array(
                'on' => $toArrayNormalizer,
                'from' => $toArrayNormalizer,
                'to' => $toArrayNormalizer,
                'exclude_to' => $toArrayNormalizer,
                'exclude_from' => $toArrayNormalizer,
            )
        );
    }

And you never transport the option resolver instance to let developper customize options, simply because we dont need in fact.

And here you retrieve the resolver who has never go out the class to be customize.

 $specs = $this->specResolver->resolve($specs);

So :

  • We dont need to let developper to customize, and we must not.
  • Options resolver is not to doing that
  • That remove a dependency

protected function processSpecs(array $specs) should be protected function handle(array $specs) it's the same and named according with the class business

With registry pattern, register all your handler inside a registry class, set this class as dependency on CallbackHandler, handler just fetch all handler from the registryCallbackHandler and handle them. And each handler is a concret class not an array.

$callback = new GenericCallback(); //$callback is not the good name
$callback->setEventTrigger('my event');
$callback->setCallable(array('class', 'function'), $parameters);

$callbackRegistry = new CallbackRegistry();
$callbackRegistry->add($callback);

$handler = new CallbackHandle($callbackRegistry)
$handler->handle();

GenericCallback implement an interface, to allowed developper create their own callback handler for heavy / not generic callback.

Symfony2 integration : The callback registry is populated with tagged service.

What do you think ? If you have better idea, or you see an improvement on this, please expose it :)

And btw, CallbackHandler class be readable with this actually she is not, I made 20 minutes to restituate workflow of all callback type.

Notice: Undefined index: guard

I am getting Notice: Undefined index: guard errors in yohang/finite/src/Finite/Loader/ArrayLoader.php on line 109. It appears that $resolver->setOptional(array('guard')) does not ensure that the 'guard' key exists in the resolved configuration.

I am using Finite 1.0.3 and Symfony/config 2.7.1

Rename the bundle `FiniteFiniteBundle`

thanks for this,
I really like this project

Maybe the name of the bundle should follow the symfony best practice what do you think?

instead of FiniteFiniteBundle
eg: YohangBundle

thanks.

Override/Add transitions

Similar to #40, currently it is not possible to add new transitions to an existing graph.
However states is able to extend from pervious config.

Another question, when I try to extend an existing graph, I must define class, property_path and graph again. Is this an expected behaviour?

finite_finite:
    sylius_order_shipping:
        class:         %sylius.model.order.class%
        property_path: shippingState
        graph:         sylius_order_shipping

ping @winzou

Some doc would be usefull

Ok, we have the autodoc. But nothing explaining how I use it with symfony. One example is great, but some explanations on the different internal parts would help other to use this lib.

[Enhancement] More examples ?

@yohang Can you add more examples like State Machine and this one ?

E.g. Interaction with Events, before and after Transitions hooks/callbacks, parameters in Transitions Events ...

And do you have a method to know if the current state is equal to the state we expect ? E.g.

// Is the current state equal to 's4' state ?
$sm->is('s4'); //=> true or false

By the way, many thanks for this package ! (French: Continue comme ça, ne lâche rien ✊)

Edit: Updated with links who answer my questions

Bug in Transition guard logic

Howdy, I've been using the state machine setup heavily for a project I've been working on (thanks very much, it's been quite useful). Think I ran into a bug in logic related to how guards on transitions work.

The code in question is in the StateMachine can method:

public function can($transition)
{
    $transition = $transition instanceof TransitionInterface ? $transition : $this->getTransition($transition);

    // this if statement is the code in question
    if (null !== $transition->getGuard()) {
        return call_user_func($transition->getGuard());
    }

    if (!in_array($transition->getName(), $this->getCurrentState()->getTransitions())) {
        return false;
    }

    $event = new TransitionEvent($this->getCurrentState(), $transition, $this);
    $this->dispatcher->dispatch(FiniteEvents::TEST_TRANSITION, $event);
    $this->dispatcher->dispatch(FiniteEvents::TEST_TRANSITION . '.' . $transition->getName(), $event);

    return !$event->isRejected();
}

Below is the config in question that I'm sending in to the ArrayLoader:

return array(
    ...
    'transitions' => array(
        ...
        self::TRANSITION_BUY_TO_REVISED => array(
            'from' => array(self::STATE_BUY),
            'to' => self::STATE_REVISED,
            'guard' => array($this, 'guardWhoCanRevise'),
        ),
        ...
    ),
);

And the callback:

public function guardWhoCanRevise()
{
    // only this specific user is allowed to make the transition from BUY to REVISED
    if($this->user_id == Auth::user()->id) {
        return true;
    }

    return false;
}

Expected behavior

That the guard callback will apply in addition to the from / to logic

// if the logged in user (Auth::user()->id) doesn't match, this returns false properly
$model->can(ModelName::TRANSITION_BUY_TO_PLANNING);

// if my model isn't in the BUY state, then this query returns true if my logged in user matches
// even though my from/to logic dictates that it should return false
$model->can(ModelName::TRANSITION_BUY_TO_PLANNING);

Bug fix

If we change the can method as below, then the from/to states will act as an additional filter in addition to the guard instead of only if the guard doesn't exist.

public function can($transition)
{
    $transition = $transition instanceof TransitionInterface ? $transition : $this->getTransition($transition);

    if (null !== $transition->getGuard()) {
-        return call_user_func($transition->getGuard());
+        if(!$return = call_user_func($transition->getGuard())) {
+            return false;
+        }
    }

    if (!in_array($transition->getName(), $this->getCurrentState()->getTransitions())) {
        return false;
    }
    ...
}

I can send in a pull request (though I may need help writing the tests) if this is indeed a bug that you want to fix and not how you intend the state machine to work. :-)

Web page example is not working

If I try the example on the webpage at http://yohan.giarel.li/Finite/

It FAILs:

Uncaught exception 'Finite\Exception\StateException' with message 'Unable to find a state called ' in /Library/WebServer/Documents/nomadica/apps/vreasy/vendor/yohang/finite/src/Finite/StateMachine/StateMachine.php:166
Stack trace:
#0 /Library/WebServer/Documents/nomadica/apps/vreasy/vendor/yohang/finite/src/Finite/StateMachine/StateMachine.php(60): Finite\StateMachine\StateMachine->getState(NULL)
#1 /Library/WebServer/Documents/nomadica/apps/vreasy/t.php(37): Finite\StateMachine\StateMachine->initialize()
#2 {main}
  thrown in /Library/WebServer/Documents/nomadica/apps/vreasy/vendor/yohang/finite/src/Finite/StateMachine/StateMachine.php on line 166

Fatal error: Uncaught exception 'Finite\Exception\StateException' with message 'Unable to find a state called ' in /Library/WebServer/Documents/nomadica/apps/vreasy/vendor/yohang/finite/src/Finite/StateMachine/StateMachine.php on line 166

Finite\Exception\StateException: Unable to find a state called  in /Library/WebServer/Documents/nomadica/apps/vreasy/vendor/yohang/finite/src/Finite/StateMachine/StateMachine.php on line 166

Call Stack:
    0.0007     236352   1. {main}() /Library/WebServer/Documents/nomadica/apps/vreasy/t.php:0
    0.0042     416744   2. Finite\StateMachine\StateMachine->initialize() /Library/WebServer/Documents/nomadica/apps/vreasy/t.php:37
    0.0043     416856   3. Finite\StateMachine\StateMachine->getState() /Library/WebServer/Documents/nomadica/apps/vreasy/vendor/yohang/finite/src/Finite/StateMachine/StateMachine.php:60

It seems that there is no proper initialisation happening (?/)

Graph visualisation

Inspired by a talk on https://github.com/Metabor/Statemachine I've created a similar rendering of Finite using Graphviz. Such a visualisation of a state machine can be really helpful when discussing with customers.

See here:

https://github.com/bonndan/Finite/tree/feature-visualisation
https://github.com/bonndan/Finite/blob/feature-visualisation/examples/rendered-graph.png

Before creating a PR I would like to know your opinion and if there are should be added more label like events, properties or the like.

Warning and unexpected behaviour after rejecting a transaction

Only today I came across this library, after a few hours of study and running a few examples, I came across the following:

  • Warning if I do not pass a guard option when defining a transition: PHP Notice: Undefined index: guard in vendor/yohang/finite/src/Finite/Loader/ArrayLoader.php on line 109. I did not see any reference of this property in the examples.
  • I was expecting that by calling the method reject() on the TransitionEvent, this would abort the transition, but not the case, it seems it has no impact. The method apply() on StateMachine, after dispatching the pre events, call process() on the Transition, but that method has an empty body, it does not return any value, but still, we use that as the return value of the apply(). Is this by design, are we suppose to create/extend the Transition class and implement our logic in the process method()?

[Symfony bundle configuration] different name and value for the persistence

Should be better decouple the value of the state from its name,
the value could have different type from the name eg number.

eg:

      draft:
          type:       initial
          value: 100    # this is the value that will be stored into the db
          properties:
              deletable: true
              editable: true
      enabled:
          type:       initial
          value: 200   # this is the value that will be stored into the db
          properties:
              printable: true
              editable: true 

The name could advantage the readability, instead the value could be a number.
This could be very good for legacy Classes that have unreadable state code.

No ability to get states array

I currently use this library with Symfony and define some properties for each state. But it's impossible to access these.

finite_finite:
    product:
        class: StoreBundle\Entity\Product
        states:
            draft:
                type: initial
                properties:
                    label: 'Draft'
                    colour: 'c6c6c6' # Grey
            live:
                properties:
                    label: 'Live'
                    colour: '428bca' # Blue
            successful:
                properties:
                    label: 'Successful'
                    colour: '45B6AF' # Green
            archived:
                type: final
                properties:
                    label: 'Archived'
                    colour: '000000' # Black
        transitions:
            ...

Controller code:

$sm = $this->get('finite.factory')->get($product);

Without access to this I'd have to define all my states twice, which would only make maintenance more difficult.

I previously added a bit of a hack in to get round this as I was in a hurry: phillipsnick@477f9ba

Is there any reason why this isn't accessible?

v1.1.0 is not backwards compatible with v1.0.3

There have been at least 4 method signature changes in new version 1.1.0 that break code that was valid for v1.0.3 - which should only happen in a major version change...

Personally I had problems with:
StateMachineInterface::apply()
PropertiesAwareInterface::get()
TransitionInterface::process()
CaseStateMachineLoader::supports()

All those methods have changed their signatures so that a fatal PHP error "Declaration of ... must be compatible with..." will be thrown...

Support multiple states per object?

Hi Yohan, very nice project!

We have been looking at it from over at Sylius/Sylius#1037, but one problem we have that the use of the StatefulInterface limits each object to only one state. In Sylius we have an Order class which has several states, such as ShippingState, and PaymentState.

Would it not be possible to get rid of the interface and instead rely on the PropertyAccess component to access whichever property represents the state?

Another (more explicit) possibility would be to rely on a new StateExtractorInterface which would be used to extract a single state from an object..

If you agree that this is a limitation that we should/could address, I would be happy to help with the implementation..

readme error

quick fix...
the readme says to add this to composer:

{
  "require": {
    "yohang/finite": "~1.1"
  }
}

but that version do not exists.

It should be

{
  "require": {
    "yohang/finite": "~1.0"
  }
}

Find a way to replace `StatefulInterface`

Since #28, and as noticed in #39, objects managed by Finite no longer needs to implement StatefulInterface. That's a problem as we have no way to throw an exception when trying to retrieve a state machine bound to a non-stateful object.

We have to find a way to address this issue.

cc @winzou, @cordoval

Need Help "Finite_initialize is not fired."

I have added the susbscriber class that implements the 'EventSubricerInterface' as follows:-

class TestSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents()
    {
        return array(
            FiniteEvents::INITIALIZE       => array('onSomethingStart', 0),
            FiniteEvents::POST_TRANSITION  => array('onSomethingChange', 0),
       );
    }

  public function onSomethingStart()
  {  //do something   }

  public function onSomethingChnage()
  {  //do something   }

}

And my services.yml is as follows:-

    <service id="sample.event.release_subscriber" class="TestSubscriber">
        <tag name="kernel.event_subscriber" />
    </service>

And Injected the service id as follows :-:

    <service id="sample.command" class="SampleCommand">
        <argument type="service" id="sample.event.release_subscriber" />
    </service>

Am i missing anything ???

Update packagist

Please update packagist version.

Last version available is from May 5, 2014.

Thank you!

Proposal of tools arround Finite

Do you think it would be nice to provide a system for testing the worflow predetermined by finite ? Some people respond that there Behat to do , but it is not really made ​​for that. Tested individually throughout a workflow by checking step by step can be really nice and valuable IMO . What use case ? Communicated easily with non-technical parties to the project, client and other involved parts of project.

Another thing that would be nice, would provide a graphical tool for simple displays, viewable in the symfony web profiler, or for non symfony project, generate html file with the graphical representation of each workflow. What use case ? Quickly and easily communicate with new developers or external developers , so with this general view can easily understand how the system operates and how it will feel knowing how to achieve each step. Other use case, extract technical documentation about the workflow directly, without write it (because it's painful !)

If another person sees a real interest in one of it's ideas (which requires a lot of development) I'd love to contribute to it by adding these tools around Finite.

Public properties in Finite\StateMachine\StateMachine

There are a number of public properties in Finite\StateMachine\StateMachine, most notably $states and $transitions. Are they public for any reason? I can effectively bring down the application by setting them to something bad.

Surely they should be protected?

Make the graph name available from StateMachine

With the recent awesome addition of multiple graphs, we need a way to retrieve from the StateMachine the graph we are working on. For example, when you work with event, you can't know on which graph you are working on, which is a blocking point for us.

Currently, StateMachine stores this information through the StateAccessor it is given in its constructor. But there is no way to retrieve the graph name from it.

What is the best way to make the graph name available?

Thanks.

[Feature request] Add custom properties for transition

It will be very nice to add custom properties to Transition class with method(s?) to retrieve them all or their values from Transition object. Custom properties ONLY on states is not enough.
I need to hold many additional information about transitions, used in my buisness-processes.
Custom properties in transition is very good place to store such kind of information.
IMHO, it will be a great additional feature to your bundle and also it helps me a lot in my project.
@yohang What do you think about it ?

Wildcard transition state

There can be some cases when one part of the transition should be a wildcard, so that the state can change TO ANY or can change FROM ANY.

Example:
Customer service operator takes a phone call and starts a customer process. Then the customer suddenly hangs up the phone. What can the operator do? Interrupt the process, no matter where it was before. Then the customer calls again. What can the operator do? Start a new process, or put the interrupted process into a specific state (of course contolled by the application, based on the previous processes).

Finite don't work on Linux box

It does work on my windows development machine (php version 5.4.27) but it doesn't work on linux test or production server with php 5.4.33
The error I'm getting is:

request.CRITICAL: Uncaught PHP Exception Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: "The option "disabled" does not exist. Known options are: "exclude_from", "exclude_to", "from", "on", "to"" at /var/www/vhosts/xxxxxxx.local/httpdocs/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php line 255 {"exception":"[object](Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: The option "disabled" does not exist. Known options are: "exclude_from", "exclude_to", "from", "on", "to" at /var/www/vhosts/xxxxxxx.local/httpdocs/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php:255)"

state-machine.yml is

    callbacks:
      after:
        callback1:
          do:
            [@xxxxxxx_finite.transition_events, transitionEverytimeAfter]

Which direction was this library going?

I moved from the winzou/statemachine to this one because I wanted to add an interface to my stateful objects and have methods manipulate these. Now I've been looking at what has been committed into this library and I see those things have been changed in master. It looks like it was moving towards the winzou/statemachine approach.

I'd like to known the bigger picture about where this statemachine library is going. For now I'm planning to fork it at the last 1.0 release and apply my own patches from there.

Flow machine?

Hi Yohang, thank you for the great work. I wonder if you can give an example using State Machine for controlling the flow?

I need to build a checkout process work flow, so I can have different states such as: add_shipping_address, add_shipping_method, add_billing_address, add_billing_method,....

Users should be able to go back and forth between states, each state can only be accessed when all previous states are passed.

I'm kinda stuck with how callbacks should be triggered before and after each "transition", and how a transition can be applied only if certain conditions are met

Release a stable version

Do you think you could tag a stable release? Would be great since more recent projects using Composer do only use stable releases by default. Also gives somewhat more confidence to use the project by other people.

Deprecated feature of Symfony's OptionsResolver

Got this E_DEPRECATED when launched my test suite on fresh package install today, using "yohang/finite": "~1.1" in composer.json.

ErrorException: Calling the Symfony\Component\OptionsResolver\OptionsResolver::setAllowedTypes method with an array of options is deprecated since version 2.6 and will be removed in 3.0. Use the new signature with a single option instead.

.../vendor/symfony/options-resolver/Symfony/Component/OptionsResolver/OptionsResolver.php:579
.../vendor/yohang/finite/src/Finite/Event/CallbackHandler.php:54
.../vendor/yohang/finite/src/Finite/Loader/ArrayLoader.php:56

Am I doing something wrong or has symfony pushed an update today, since yesterday test suite was passing without any errors?

at what stage should i load my state from db persistence?

how do I override my initial state when i load the object into the statemachine?
My class instance has a state that was persisted, how can i get the initial state to be that?

Do i need to change the initial state in the loader per object?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.