for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace HnrAzevedo\Filter;
class Filter{
use CheckTrait;
protected array $messages = [];
protected array $treat = [];
public function getMessage(string $filter): string
{
return strval($this->messages[$filter]);
}
public function check(string $filter): bool
$this->check_method($filter);
$result = $this->$filter();
return (is_bool($result)) ? $result : false;
protected function addMessage(string $filter, string $message): Filter
$this->messages[$filter] = $message;
return $this;
protected function addTreat(string $filter, string $treat): void
$this->treat[$filter] = $treat;
protected function treat(string $filter): void
if(array_key_exists($filter,$this->treat)){
$treat = $this->treat[$filter];
$this->$treat();