for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ORM\Dbal;
class Column
{
/** @var string */
protected $name;
/** @var Type */
protected $type;
/** @var bool */
protected $hasDefault;
protected $isNullable;
/**
* Column constructor.
*
* @param string $name
* @param Type $type
* @param bool $hasDefault
* @param bool $isNullable
*/
public function __construct($name, Type $type, $hasDefault, $isNullable)
$this->name = $name;
$this->type = $type;
$this->hasDefault = $hasDefault;
$this->isNullable = $isNullable;
}
public static function factory($columnDefinition, $type)
$name = $columnDefinition['column_name'];
$hasDefault = $columnDefinition['column_default'] !== null;
$isNullable = $columnDefinition['is_nullable'];
return new static($name, $type, $hasDefault, $isNullable);
* @return string
public function getName()
return $this->name;
* @return Type
public function getType()
return $this->type;
* @return bool
public function hasDefault()
return $this->hasDefault;
public function isNullable()
return $this->isNullable;