for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the "elao/enum" package.
*
* Copyright (C) Elao
* @author Elao <[email protected]>
*/
namespace Elao\Enum\Bridge\Doctrine\DBAL\Types;
use Doctrine\DBAL\Platforms\AbstractPlatform;
/**
* Base class for string enumerations with an `ENUM(...values)` column definition
abstract class AbstractEnumSQLDeclarationType extends AbstractEnumType
{
* {@inheritdoc}
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
$values = implode(', ', array_map(static function (string $value): string {
return "'$value'";
}, ($this->getEnumClass())::values()));
values
$this->getEnumClass()
string
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
return "ENUM($values)";
}
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.