smartemailing/types

View on GitHub
src/ExtractableTraits/EnumExtractableTrait.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types = 1);

namespace SmartEmailing\Types\ExtractableTraits;

trait EnumExtractableTrait
{

    use ExtractableTrait;

    /**
     * @return self
     */
    final public static function from(
        mixed $data
    ) {
        if ($data instanceof self) {
            return $data;
        }

        return self::get($data);
    }

}