PHP code example of phariscope / doctrineenumtype
1. Go to this page and download the library: Download phariscope/doctrineenumtype library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phariscope / doctrineenumtype example snippets
enum Example: string
{
case EXAMPLE = 'EXAMPLE';
case FAKE = 'FAKE';
case REAL = 'REAL';
}
class ExampleTypeTest extends TestCase
{
public function testGetName(): void
{
$this->assertEquals('enum_example', (new ExampleType())->getName());
}
use Phariscope\DoctrineEnumType\EnumType;
class ExampleType extends EnumType
{
protected string $name = "enum_example";
protected string $className = EnumExample::class;
}