Common files

This commit is contained in:
2020-12-15 17:45:27 -03:00
parent 736eb72254
commit 6c945e915f
5 changed files with 104 additions and 0 deletions

21
common/Helper/Merger.php Normal file
View File

@ -0,0 +1,21 @@
<?php
namespace ProVM\Common\Helper;
class Merger {
protected $separator;
public function __construct(string $separator) {
$this->separator = $separator;
}
protected $array;
public function start(): Merger {
$this->array = [];
return $this;
}
public function add($element): Merger {
$this->array []= $element;
return $this;
}
public function merge() {
return implode($this->separator, $this->array);
}
}