Completed
Push — master ( 92a554...58f732 )
by Manel
05:05
created

PaymentsServiceProvider::loadMigrations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 17 and the first side effect is on line 6.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace Scool\EnrollmentMobile\Providers;
4
5
use Acacha\Names\Providers\NamesServiceProvider;
6
<<<<<<< HEAD:src/Providers/EnrollmentMobileServiceProvider.php
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_SL
Loading history...
7
use Acacha\Stateful\Providers\StatefulServiceProvider;
8
=======
9
>>>>>>> 92a55437464d45d8f28bae26a5a84fc695a03898:src/Providers/PaymentsServiceProvider.php
10
use Illuminate\Support\ServiceProvider;
11
use Scool\EnrollmentMobile\ScoolEnrollmentMobile;
12
13
/**
14
     * Class EnrollmentServiceProvider
15
     * @package Scool\Enrollment\Providers
16
     */
17
    class PaymentsServiceProvider extends ServiceProvider
18
    {
19
        public function register()
20
        {
21
            if (!defined('SCOOL_ENROLLMENT_MOBILE_PATH')) {
22
                define('SCOOL_ENROLLMENT_MOBILE_PATH', realpath(__DIR__.'/../../'));
23
            }
24
25
<<<<<<< HEAD:src/Providers/EnrollmentMobileServiceProvider.php
26
            $this->registerNameServiceProvider();
27
28
            $this->registerStatefulEloquentServiceProvider();
29
=======
30
            $this->app->register(NamesServiceProvider::class);
31
>>>>>>> 92a55437464d45d8f28bae26a5a84fc695a03898:src/Providers/PaymentsServiceProvider.php
32
33
            $this->app->bind(\Scool\EnrollmentMobile\Repositories\EnrollmentRepository::class, \Scool\EnrollmentMobile\Repositories\EnrollmentRepositoryEloquent::class);
34
35
//            $this->app->bind(StatsRepositoryInterface::class,function() {
0 ignored issues
show
Unused Code Comprehensibility introduced by
59% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
36
//                return new CacheableStatsRepository(new StatsRepository());
37
//            });
38
        }
39
40
        public function boot()
41
        {
42
            $this->defineRoutes();
43
            $this->loadMigrations();
44
            $this->publishFactories();
45
            $this->publishConfig();
46
            $this->publishTests();
47
        }
48
49
        protected function defineRoutes()
50
        {
51
            if (!$this->app->routesAreCached()) {
52
                $router = app('router');
53
                $router->group(['namespace' => 'Scool\EnrollmentMobile\Http\Controllers'], function () {
54
                    require __DIR__.'/../Http/routes.php';
55
                });
56
            }
57
        }
58
59
60
        public function loadMigrations()
61
        {
62
            $this->loadMigrationsFrom(SCOOL_ENROLLMENT_MOBILE_PATH . '/database/migrations');
63
        }
64
65
        public function publishFactories()
66
        {
67
            $this->publishes(
68
                ScoolEnrollmentMobile::factories(), "scool_enrollment_mobile"
69
        );
70
        }
71
72
73
        private function publishConfig()
74
        {
75
            $this->publishes(
76
                    ScoolEnrollmentMobile::configs(), "scool_enrollment_mobile"
77
                );
78
            $this->mergeConfigFrom(
79
                SCOOL_ENROLLMENT_MOBILE_PATH . '/config/payment.php', 'scool_enrollment_mobile'
80
            );
81
        }
82
83
        public function publishTests()
84
        {
85
            $this->publishes(
86
                [
87
                    SCOOL_ENROLLMENT_MOBILE_PATH .'/tests/EnrollmentMobileTest.php' => 'tests/EnrollmentMobileTest.php'
88
                ], "scool_enrollment_mobile"
89
            );
90
        }
91
92
        /*
93
         * Register acacha/names Service Provider.
94
         *
95
         */
96
        protected function registerNameServiceProvider()
97
        {
98
            $this->app->register(NamesServiceProvider::class);
99
        }
100
101
        /*
102
         * Register acacha/stateful-eloquent Service Provider.
103
         *
104
         */
105
        protected function registerStatefulEloquentServiceProvider()
106
        {
107
            $this->app->register(StatefulServiceProvider::class);
108
        }
109
    }
110