for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Matks\Vivian\Border;
use Exception;
/**
* Border element
*/
class Border
{
const TYPE_UNDERLINE = 'underline';
const TYPE_FRAME = 'frame';
* @var string
private $type;
private $lineCharacter;
private $columnCharacter;
private $crossCharacter;
* @param string $type
* @param string $lineCharacter
* @param string $columnCharacter
* @param string $crossCharacter
public function __construct($type, $lineCharacter = '-', $columnCharacter = '|', $crossCharacter = '+')
if (!in_array($type, $this->getAllowedTypes())) {
throw new Exception("Unknown border type $type");
}
$this->type = $type;
$this->lineCharacter = $lineCharacter;
$this->columnCharacter = $columnCharacter;
$this->crossCharacter = $crossCharacter;
* @return string
public function getType()
return $this->type;
public function getColumnCharacter()
return $this->columnCharacter;
public function getCrossCharacter()
return $this->crossCharacter;
public function getLineCharacter()
return $this->lineCharacter;
* @return string[]
private function getAllowedTypes()
$types = array(
static::TYPE_UNDERLINE,
static::TYPE_FRAME,
);
return $types;