Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Formatter | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| fixSoftDelete | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace San\Crud\Formatters; |
| 4 | |
| 5 | use San\Crud\Generators\BaseGen; |
| 6 | |
| 7 | class Formatter extends BaseGen { |
| 8 | |
| 9 | public function fixSoftDelete(?string $str) { |
| 10 | if (!$this->hasSoftDeletes()) { |
| 11 | $str = preg_replace('#//@softdelete.*?@endsoftdelete#s', '', $str); |
| 12 | } |
| 13 | |
| 14 | return $str; |
| 15 | } |
| 16 | } |