Passed
Branch master (3ea22d)
by Fariz
03:08
created

TestService   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 25
rs 10
c 2
b 0
f 0
wmc 11

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRegisteredUsers() 0 3 1
A hello() 0 3 1
B calculate() 0 12 9
1
<?php
2
/**
3
 * StupidlySimple - A PHP Framework For Lazy Developers.
4
 *
5
 * @author		Fariz Luqman <[email protected]>
6
 * @copyright	2017 Fariz Luqman
7
 * @license		MIT
8
 *
9
 * @link		https://stupidlysimple.github.io/
10
 */
11
12
namespace Service\Test;
13
14
use ServiceContainer;
0 ignored issues
show
Bug introduced by
The type ServiceContainer 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
class TestService extends ServiceContainer
17
{
18
    public function hello()
19
    {
20
        return 'Hello';
21
    }
22
23
    public function calculate($var1, $operation, $var2)
24
    {
25
        if ($operation == 'plus' || $operation == '+') {
26
            return $var1 + $var2;
27
        } elseif ($operation == 'minus' || $operation == '-') {
28
            return $var1 - $var2;
29
        } elseif ($operation == 'multiply' || $operation == '*') {
30
            return $var1 * $var2;
31
        } elseif ($operation == 'divide' || $operation == '/') {
32
            return $var1 / $var2;
33
        } else {
34
            return 'Invalid Operation';
35
        }
36
    }
37
38
    public function getRegisteredUsers()
39
    {
40
        return \Model\User::all();
41
    }
42
}
43