for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author: RunnerLee
* @email: [email protected]
* @time: 2018-02
*/
namespace Runner\Heshen;
class State
{
const TYPE_INITIAL = 'initial';
const TYPE_NORMAL = 'normal';
const TYPE_FINAL = 'final';
* @var string
protected $name;
protected $type;
* State constructor.
*
* @param string $name
* @param string $type
public function __construct($name, $type)
$this->name = $name;
$this->type = $type;
}
* @return string
public function getName(): string
return $this->name;
public function getType(): string
return $this->type;
* @return bool
public function isInitial(): bool
return self::TYPE_INITIAL === $this->type;
public function isNormal(): bool
return self::TYPE_NORMAL === $this->type;
public function isFinal(): bool
return self::TYPE_FINAL === $this->type;