Completed
Pull Request — master (#24)
by yuuki
03:05
created

ConsoleServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 6
cp 0
crap 2
rs 9.4285
1
<?php
2
3
/**
4
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
9
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
10
 * THE SOFTWARE.
11
 */
12
13
namespace Ytake\LaravelCouchbase;
14
15
use Illuminate\Support\ServiceProvider;
16
use Ytake\LaravelCouchbase\Console\IndexFinderCommand;
17
18
/**
19
 * Class ConsoleServiceProvider.
20
 *
21
 * @author Yuuki Takezawa<[email protected]>
22
 */
23
class ConsoleServiceProvider extends ServiceProvider
24
{
25
    /** @var bool */
26
    protected $defer = true;
27
28
    public function boot()
29
    {
30
        $this->registerCommands();
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function register()
37
    {
38
        // TODO: Implement register() method.
39
    }
40
41
    /**
42
     * register laravel-couchbase commands
43
     */
44
    protected function registerCommands()
45
    {
46
        $this->app->singleton('command.couchbase.list-indexes', function ($app) {
47
            return new IndexFinderCommand($app['config']);
48
        });
49
50
        $this->commands([
51
            'command.couchbase.list-indexes',
52
        ]);
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function provides()
59
    {
60
        return [
61
            'command.couchbase.list-indexes',
62
        ];
63
    }
64
}
65