for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace JosKolenberg\Enum;
abstract class EnumWithCodeAndValue extends Enum
{
/**
* The code for the instance.
*
* @var mixed
*/
protected $code;
* The value for the instance.
protected $value;
* AbstractEnumWithIdAndName constructor.
* @param $code
* @param $value
public function __construct($code, $value)
$this->code = $code;
$this->value = $value;
}
* Get the code attribute.
* @return mixed
public function getCode()
return $this->code;
* Get the value attribute.
public function getValue()
return $this->value;
* Return the name of the attribute which stores the identifier.
protected function identifierAttribute()
return 'code';