Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Formatter
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
1 / 1
 fixSoftDelete
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
1<?php
2
3namespace San\Crud\Formatters;
4
5use San\Crud\Generators\BaseGen;
6
7class 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}