Passed
Push — master ( 8016ac...3325dd )
by Iman
05:45 queued 51s
created

ApiController::hook_api_status()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule;
4
5
use Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule\ApiController\ApiHooks;
6
use Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule\ApiController\ExecuteApi;
7
8
class ApiController extends Controller
0 ignored issues
show
Bug introduced by
The type Crocodicstudio\Crudboost...eratorModule\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
{
10
    use ApiHooks;
11
    
12
    var $method_type;
13
14
    var $permalink;
15
16
    var $hook_api_status;
17
18
    var $hook_api_message;
19
20
    var $validate = false;
21
22
    var $last_id_tmp = [];
23
24
    public function hook_api_status($boolean)
25
    {
26
        $this->hook_api_status = $boolean;
27
    }
28
29
    public function hook_api_message($message)
30
    {
31
        $this->hook_api_message = $message;
32
    }
33
34
    public function execute_api()
35
    {
36
        (new ExecuteApi($this))->execute();
37
    }
38
39
    /**
40
     * @param $name
41
     * @param $row_assign
42
     * @return array
43
     */
44
    /*private function handleFile($name, $row_assign)
45
    {
46
        if (! Request::hasFile($name)) {
47
            return;
48
        }
49
        $file = Request::file($name);
50
        $ext = $file->getClientOriginalExtension();
51
52
        //Create Directory Monthly
53
        Storage::makeDirectory(date('Y-m'));
54
55
        //Move file to storage
56
        $filename = md5(str_random(5)).'.'.$ext;
57
        if ($file->move(storage_path('app'.DIRECTORY_SEPARATOR.date('Y-m')), $filename)) {
58
            $v = 'uploads/'.date('Y-m').'/'.$filename;
59
            $row_assign[$name] = $v;
60
        }
61
62
        return $row_assign;
63
    }*/
64
65
    /**
66
     * @param $value
67
     * @param $uploads_format_candidate
68
     * @param $row_assign
69
     * @param $name
70
     * @return mixed
71
     */
72
   /* private function handleBase64($value, $uploads_format_candidate, $row_assign, $name)
73
    {
74
        $filedata = base64_decode($value);
75
        $f = finfo_open();
76
        $mime_type = finfo_buffer($f, $filedata, FILEINFO_MIME_TYPE);
77
        @$mime_type = explode('/', $mime_type);
78
        @$mime_type = $mime_type[1];
79
80
        if ($mime_type && in_array($mime_type, $uploads_format_candidate)) {
81
            Storage::makeDirectory(date('Y-m'));
82
            $filename = md5(str_random(5)).'.'.$mime_type;
83
            if (file_put_contents(storage_path('app'.DIRECTORY_SEPARATOR.date('Y-m')).'/'.$filename, $filedata)) {
84
                $v = 'uploads/'.date('Y-m').'/'.$filename;
85
                $row_assign[$name] = $v;
86
            }
87
        }
88
89
        return $row_assign;
90
    }*/
91
}
92
93
94
95
96