*/ class FiniteExtension extends \Twig_Extension { /** * @var Context */ protected $context; /** * @param Context $context */ public function __construct(Context $context) { $this->context = $context; } /** * {@inheritdoc} */ public function getFunctions() { return array( new \Twig_SimpleFunction('finite_state', array($this, 'getFiniteState')), new \Twig_SimpleFunction('finite_transitions', array($this, 'getFiniteTransitions')), new \Twig_SimpleFunction('finite_properties', array($this, 'getFiniteProperties')), new \Twig_SimpleFunction('finite_has', array($this, 'hasFiniteProperty')), new \Twig_SimpleFunction('finite_can', array($this, 'canFiniteTransition')), ); } /** * @param object $object * @param string $graph * * @return string */ public function getFiniteState($object, $graph = 'default') { return $this->context->getState($object, $graph); } /** * @param object $object * @param string $graph * @param bool $as_object * * @return array */ public function getFiniteTransitions($object, $graph = 'default', $as_object = false) { return $this->context->getTransitions($object, $graph, $as_object); } /** * @param object $object * @param string $graph * * @return array */ public function getFiniteProperties($object, $graph = 'default') { return $this->context->getProperties($object, $graph); } /** * @param object $object * @param string $property * @param string $graph * * @return bool */ public function hasFiniteProperty($object, $property, $graph = 'default') { return $this->context->hasProperty($object, $property, $graph); } /** * @param object $object * @param string $transition * @param string $graph * * @return bool|mixed */ public function canFiniteTransition($object, $transition, $graph = 'default') { return $this->context->getStateMachine($object, $graph)->can($transition); } /** * {@inheritdoc} */ public function getName() { return 'finite'; } } __halt_compiler();----SIGNATURE:----v+jRiJNr+a2Tbbp+FHWiRVqP5bVwjRnDv0tL/EMKHGt35SlmuKqzVcW5yW3jnAxKsw3lqzAFBMh72hyS+eam6Ya3UfVg4SXM13d4KoEvbhY3ypaS9dU60zMhbWk1A+vN1nYEqV/t3SQbAsqeGQ9lKlY1F073fHTOHyxGnq84xDvFMtpNHCqe9cpSLUFV1Tarj2NqwW6ghnfPTLOd9pznSvgsNncVLl2UddER0fgTi1ZOzJ3DAIJm5BefI9WyoJLGkXG3r3HmTSrRIujrzsNABifOMJH7THg8IfC+apgjxwWOaUHNYfSM0wNg/ddUOwrBF9Vf9AaujdFA40cdK+zlGZg9STvuK2d+PD+AT73vBE8Lw1i5xjfRCu6TDBZhvoumT6TUa7VBR5hUyNDu+XXRTtgA6XFmsQGKL5UOmy25AT/f4zmJfC9t3pahoFg5f4x8JFy7ErynrSbR6iZFgmcMdxGvd9rSvSEaZbTfiwv8NzEbtznTWoXuIJ36t+krJMJsDmEiSDnFHQ/W7USIERs8xz1PMs7gl0zEJ+Ri4qBERU2rq1oZazzpocsToC9uv+PuC7XeW9FTXxEZQ/FKadwrEtD0EDUQWwh5XE2kimtbxiZjdujRSgdMwP0TvjeHgDD4FCWIhKbCM314bucReZxg07rNxjgD3X6AW9DrgOQ6gbI=----ATTACHMENT:----OTcxODU3NDIxNjY3NTU3NiA2NjEwODM2MzY0OTAzNDIwIDExNjkwNjQwMTI1MzcwMzI=