Completed
Pull Request — master (#2)
by claudio
03:56
created

ResponseCreatorBinder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 16
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: miha
6
 * Date: 20.11.15.
7
 * Time: 15:43
8
 */
9
10
namespace Services\ResponseCreator;
11
12
use Illuminate\Support\ServiceProvider;
13
14
class ResponseCreatorBinder
15
{
16
    /**
17
     * Register the binding
18
     *
19
     * @return void
20
     */
21
    public function register()
22
    {
23
        $app = $this->app;
0 ignored issues
show
Bug introduced by
The property app does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
24
25
        $app->singleton('Services\ServiceCreator\ResponseCreator', function ($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
            return new services\serviceCreator\JsonResponseCreator();
27
        });
28
    }
29
}