FormatHelper::formatData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Helper;
4
5
/**
6
 * Class FormatHelper
7
 * @package App\Helper
8
 * @author Lars <[email protected]> Riße
9
 */
10
class FormatHelper
11
{
12
    public static function formatData($data, $success = true, $status = 200)
13
    {
14
        $content = array("success" => $success, "data" => $data);
15
16
        return response($content, $status);
0 ignored issues
show
Bug introduced by
$content of type array is incompatible with the type string expected by parameter $content of response(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

16
        return response(/** @scrutinizer ignore-type */ $content, $status);
Loading history...
17
    }
18
}