Test Failed
Push — master ( 13c287...5c6ec1 )
by Ricardo
10:29
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 11 2
1
<?php
2
3
namespace RicardoSierra\Translation;
4
5
class Factory extends \Illuminate\Validation\Factory {
6
7
    // Change this method
8
    /**
9
     * Resolve a new Validator instance.
10
     *
11
     * @param  array  $data
12
     * @param  array  $rules
13
     * @param  array  $messages
14
     * @return \MyLib\Validation\Validator
0 ignored issues
show
Bug introduced by
The type MyLib\Validation\Validator 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...
15
     */
16
    protected function resolve($data, $rules, $messages)
17
    {
18
        if (is_null($this->resolver))
19
        {
20
            // THIS WILL NOW RETURN YOUR NEW SERVICE PROVIDER SINCE YOU'RE
21
            // IN THE MyLib\Validation NAMESPACE
22
            return new Validator($this->translator, $data, $rules, $messages);
0 ignored issues
show
Bug Best Practice introduced by
The expression return new RicardoSierra...ata, $rules, $messages) returns the type RicardoSierra\Translation\Validator which is incompatible with the documented return type MyLib\Validation\Validator.
Loading history...
23
        }
24
        else
25
        {
26
            return call_user_func($this->resolver, $this->translator, $data, $rules, $messages);
27
        }
28
    }
29
30
}