Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
TemplateModifierBase
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
2.50
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 modifierBodyImpl
n/a
0 / 0
n/a
0 / 0
0
 getModifierName
n/a
0 / 0
n/a
0 / 0
0
 modifierBody
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\Core\Mvc\Template\Plugin;
6
7use PeServer\Core\Mvc\Template\Plugin\TemplatePluginArgument;
8
9abstract class TemplateModifierBase extends TemplatePluginBase implements ITemplateModifier
10{
11    protected function __construct(TemplatePluginArgument $argument)
12    {
13        parent::__construct($argument);
14    }
15
16    #region function
17
18    abstract protected function modifierBodyImpl(mixed $value, mixed ...$params): mixed;
19
20    #region ITemplateModifier
21
22    abstract public function getModifierName(): string;
23
24    public function modifierBody(mixed $value, mixed ...$params): mixed
25    {
26        return $this->modifierBodyImpl($value, $params);
27    }
28
29    #endregion
30}