Plugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 30
rs 10
c 2
b 1
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A pluginDetails() 0 9 1
A register() 0 7 1
1
<?php
2
3
namespace Autumn\Api;
4
5
use App;
6
use System\Classes\PluginBase;
7
use Autumn\Api\Console\CreateApi;
8
use Autumn\Api\Providers\ServiceProvider;
9
use Barryvdh\Cors\ServiceProvider as CorsServiceProvider;
10
11
/**
12
 * Api Plugin Information File.
13
 */
14
class Plugin extends PluginBase
15
{
16
    /**
17
     * Returns information about this plugin.
18
     *
19
     * @return array
20
     */
21
    public function pluginDetails()
22
    {
23
        return [
24
            'name' => 'Api',
25
            'description' => 'Tools for building RESTful HTTP + JSON APIs.',
26
            'author' => 'Autumn',
27
            'icon' => 'icon-paper-plane',
28
        ];
29
    }
30
31
    /**
32
     * Register method, called when the plugin is first registered.
33
     *
34
     * @return void
35
     */
36
    public function register()
37
    {
38
        App::register(CorsServiceProvider::class);
39
        App::register(ServiceProvider::class);
40
41
        $this->registerConsoleCommand('create.api', CreateApi::class);
42
    }
43
}
44