for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MadWeb\Enum;
/**
* @mixin \MadWeb\Enum\Enum
* @internal Uses for custom casting implementation
*/
trait EnumCastable
{
abstract public function __construct($value = null);
abstract public function getValue();
public function get($model, string $key, $value, array $attributes)
$model
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$key
$attributes
return new static($value);
}
public function set($model, string $key, $value, array $attributes)
if ($value instanceof static) {
return $value->getValue();
return (new static($value))->getValue();
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.