This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
1 | <?php |
||||||
2 | |||||||
3 | namespace App\Providers; |
||||||
4 | |||||||
5 | use Illuminate\Support\ServiceProvider; |
||||||
6 | use Illuminate\Support\Facades\Schema; |
||||||
7 | use Illuminate\Support\Facades\Validator; |
||||||
8 | |||||||
9 | class AppServiceProvider extends ServiceProvider |
||||||
10 | { |
||||||
11 | /** |
||||||
12 | * Bootstrap any application services. |
||||||
13 | * |
||||||
14 | * @return void |
||||||
15 | */ |
||||||
16 | 5 | public function boot() |
|||||
17 | { |
||||||
18 | // Fixes incompatibility with MySQL < 5.7.7 |
||||||
19 | 5 | Schema::defaultStringLength(191); |
|||||
20 | |||||||
21 | // Create {{ $view_name }} provider in blade templates |
||||||
22 | 5 | view()->composer('*', function($view) { |
|||||
23 | $view_name = str_replace('.', '-', $view->getName()); |
||||||
24 | view()->share('view_name', $view_name); |
||||||
25 | 5 | }); |
|||||
26 | |||||||
27 | 5 | Validator::extend('phone', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
28 | return preg_match('%^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$%i', $value) && strlen($value) >= 10; |
||||||
29 | 5 | }); |
|||||
30 | |||||||
31 | 5 | Validator::replacer('phone', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
32 | return str_replace(':attribute', $attribute, ':attribute is invalid phone number'); |
||||||
33 | 5 | }); |
|||||
34 | |||||||
35 | //Validator rule for names |
||||||
36 | 5 | Validator::extend('name', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
37 | return preg_match('#(^[[:alnum:]])([\w\-\.\' ]*)([\w\-\.\']$)#', $value); |
||||||
38 | 5 | }); |
|||||
39 | |||||||
40 | 5 | Validator::replacer('name', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
41 | return str_replace(':attribute', $attribute, ':attribute is invalid you can only use letters, numbers, underscores, dashes, spaces, periods and it must start with a letter or number'); |
||||||
42 | 5 | }); |
|||||
43 | |||||||
44 | //Validator rule for user full names |
||||||
45 | 5 | Validator::extend('full_name', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
46 | return preg_match('#(^[[:alpha:]])([[:alpha:]\_\-\. ]*)([[:alpha:]\_\-\.]$)#', $value); |
||||||
47 | 5 | }); |
|||||
48 | |||||||
49 | 5 | Validator::replacer('full_name', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
50 | return str_replace(':attribute', $attribute, ':attribute is invalid you can only use letters, underscores, dashes, spaces, periods and it must start with a letter'); |
||||||
51 | 5 | }); |
|||||
52 | |||||||
53 | //Validator rule for values |
||||||
54 | 5 | Validator::extend('value_string', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
55 | return preg_match('#(^[[:alnum:]\+\-])([\w\+\-\.\'\, ]*$)#', $value); |
||||||
56 | 5 | }); |
|||||
57 | |||||||
58 | 5 | Validator::replacer('value_string', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
59 | return str_replace(':attribute', $attribute, ':attribute is invalid you can only use alphanumerics spaces +-_.\', and it must start with a alphanumeric or a plus or minus'); |
||||||
60 | 5 | }); |
|||||
61 | |||||||
62 | //Validator rule for types |
||||||
63 | 5 | Validator::extend('type_name', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
64 | return preg_match('#(^[[:alpha:]\_])([\w]*$)#', $value); |
||||||
65 | 5 | }); |
|||||
66 | |||||||
67 | 5 | Validator::replacer('type_name', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
68 | return str_replace(':attribute', $attribute, ':attribute is invalid you can only use alphanumerics, underscores and it must start with a letter or underscore'); |
||||||
69 | 5 | }); |
|||||
70 | |||||||
71 | //Validator rule for error messages |
||||||
72 | 5 | Validator::extend('error_string', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
73 | return preg_match('#(^[\w])([\w\-\.\'\, ]*$)#', $value); |
||||||
74 | 5 | }); |
|||||
75 | |||||||
76 | 5 | Validator::replacer('error_string', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
77 | return str_replace(':attribute', $attribute, ':attribute is invalid you can only use alphanumerics spaces _.\', and it must start with a alphanumeric or underscore'); |
||||||
78 | 5 | }); |
|||||
79 | |||||||
80 | //Validator rule for mac addresses |
||||||
81 | 5 | Validator::extend('mac', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
82 | return preg_match('#^(([[:xdigit:]]{2}){6})$#', $value); |
||||||
83 | 5 | }); |
|||||
84 | |||||||
85 | 5 | Validator::replacer('mac', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
86 | return str_replace(':attribute', $attribute, ':attribute is invalid you must provide a valid mac address like 000000000000'); |
||||||
87 | 5 | }); |
|||||
88 | |||||||
89 | //Validator rule for versions |
||||||
90 | 5 | Validator::extend('version', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
91 | return preg_match('#(^[0-9])(([\+\-\.][[:alnum:]]+)*$)#', $value); |
||||||
92 | 5 | }); |
|||||
93 | |||||||
94 | 5 | Validator::replacer('version', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
95 | return str_replace(':attribute', $attribute, ':attribute is invalid you can only use alphanumerics +-. and it must start with a number and end with an alphanumeric'); |
||||||
96 | 5 | }); |
|||||
97 | |||||||
98 | //Validator rule for uuid |
||||||
99 | 5 | Validator::extend('uuid', function($attribute, $value, $parameters, $validator) { |
|||||
0 ignored issues
–
show
The parameter
$validator is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
100 | return preg_match('#^([[:xdigit:]]{8})(-[[:xdigit:]]{4}){3}(-[[:xdigit:]]{12})$#', $value); |
||||||
101 | 5 | }); |
|||||
102 | |||||||
103 | 5 | Validator::replacer('uuid', function($message, $attribute, $rule, $parameters) { |
|||||
0 ignored issues
–
show
The parameter
$rule is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$parameters is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
104 | return str_replace(':attribute', $attribute, ':attribute is invalid you must provide five groups of hexadecimals in the form 8-4-4-4-12'); |
||||||
105 | 5 | }); |
|||||
106 | 5 | } |
|||||
107 | |||||||
108 | /** |
||||||
109 | * Register any application services. |
||||||
110 | * |
||||||
111 | * @return void |
||||||
112 | */ |
||||||
113 | 5 | public function register() |
|||||
114 | { |
||||||
115 | // |
||||||
116 | 5 | } |
|||||
117 | } |
||||||
118 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.