for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File containing the {@see Mailcode_Parser} class.
*
* @package Mailcode
* @subpackage Parser
* @see Mailcode_Parser
*/
declare(strict_types=1);
namespace Mailcode;
* Mailcode parser match, container for a command found
* while parsing a string.
* @author Sebastian Mordziol <[email protected]>
class Mailcode_Parser_Match
{
* @var string
protected $name;
protected $type;
protected $params;
protected $matchedString;
public function __construct(string $name, string $type, string $params, string $matchedString)
$this->name = strtolower($name);
$this->type = strtolower($type);
$this->params = trim($params);
$this->matchedString = $matchedString;
$this->applyFilters();
}
public function getName() : string
return $this->name;
public function getType() : string
return $this->type;
public function getParams() : string
return $this->params;
public function getMatchedString() : string
return $this->matchedString;
private function applyFilters() : void
$this->params = $this->removeNonBreakingSpaces($this->params);
private function removeNonBreakingSpaces(string $subject) : string
return str_replace(array(' ', ' '), ' ', $subject);