Common files
This commit is contained in:
21
common/Helper/Merger.php
Normal file
21
common/Helper/Merger.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user