GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — develop ( e6912b...498113 )
by Toby
13:04
created

ControlDBServiceProvider::setupObservers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 44
Code Lines 34

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 35
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 34
c 0
b 0
f 0
dl 0
loc 44
ccs 35
cts 35
cp 1
rs 9.376
cc 1
nc 1
nop 0
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB;
4
5
use BristolSU\ControlDB\AdditionalProperties\AdditionalPropertySingletonStore;
6
use BristolSU\ControlDB\AdditionalProperties\AdditionalPropertyStore;
7
use BristolSU\ControlDB\Bootstrap\RegistersCachedRepositories;
8
use BristolSU\ControlDB\Bootstrap\RegistersObserverFramework;
9
use BristolSU\ControlDB\Commands\SeedDatabase;
10
use BristolSU\ControlDB\Contracts\Repositories\DataUser as DataUserRepositoryContract;
11
use BristolSU\ControlDB\Contracts\Repositories\DataGroup as DataGroupRepositoryContract;
12
use BristolSU\ControlDB\Contracts\Repositories\DataRole as DataRoleRepositoryContract;
13
use BristolSU\ControlDB\Contracts\Repositories\DataPosition as DataPositionRepositoryContract;
14
use BristolSU\ControlDB\Contracts\Models\DataUser as DataUserContract;
15
use BristolSU\ControlDB\Contracts\Models\DataGroup as DataGroupContract;
16
use BristolSU\ControlDB\Contracts\Models\DataRole as DataRoleContract;
17
use BristolSU\ControlDB\Contracts\Models\DataPosition as DataPositionContract;
18
use BristolSU\ControlDB\Contracts\Repositories\Pivots\Tags\GroupGroupTag as GroupGroupTagContract;
19
use BristolSU\ControlDB\Contracts\Repositories\Pivots\Tags\UserUserTag as UserUserTagContract;
20
use BristolSU\ControlDB\Contracts\Repositories\Pivots\Tags\RoleRoleTag as RoleRoleTagContract;
21
use BristolSU\ControlDB\Contracts\Repositories\Pivots\Tags\PositionPositionTag as PositionPositionTagContract;
22
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserGroup as UserGroupContract;
23
use BristolSU\ControlDB\Contracts\Repositories\Pivots\UserRole as UserRoleContract;
24
use BristolSU\ControlDB\Export\ExportControlCommand;
25
use BristolSU\ControlDB\Export\ExportManager;
26
use BristolSU\ControlDB\Models\DataUser;
27
use BristolSU\ControlDB\Models\DataGroup;
28
use BristolSU\ControlDB\Models\DataRole;
29
use BristolSU\ControlDB\Models\DataPosition;
30
use BristolSU\ControlDB\Models\Group as GroupModel;
31
use BristolSU\ControlDB\Models\Position as PositionModel;
32
use BristolSU\ControlDB\Models\Role as RoleModel;
33
use BristolSU\ControlDB\Models\Tags\GroupTag as GroupTagModel;
34
use BristolSU\ControlDB\Models\Tags\GroupTagCategory as GroupTagCategoryModel;
35
use BristolSU\ControlDB\Models\Tags\PositionTag as PositionTagModel;
36
use BristolSU\ControlDB\Models\Tags\PositionTagCategory as PositionTagCategoryModel;
37
use BristolSU\ControlDB\Models\Tags\RoleTag as RoleTagModel;
38
use BristolSU\ControlDB\Models\Tags\RoleTagCategory as RoleTagCategoryModel;
39
use BristolSU\ControlDB\Models\Tags\UserTag as UserTagModel;
40
use BristolSU\ControlDB\Models\Tags\UserTagCategory as UserTagCategoryModel;
41
use BristolSU\ControlDB\Models\User as UserModel;
42
use BristolSU\ControlDB\Observers\DataGroupObserverClearCache;
43
use BristolSU\ControlDB\Observers\DataPositionObserverClearCache;
44
use BristolSU\ControlDB\Observers\DataRoleObserverClearCache;
45
use BristolSU\ControlDB\Observers\DataUserObserverClearCache;
46
use BristolSU\ControlDB\Observers\GroupObserverCascadeDelete;
47
use BristolSU\ControlDB\Observers\GroupObserverClearCache;
48
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\Observe;
49
use BristolSU\ControlDB\Observers\NotifyObservers\Framework\ObserverStore;
50
use BristolSU\ControlDB\Observers\Pivots\Tags\GroupGroupTagObserverClearCache;
51
use BristolSU\ControlDB\Observers\Pivots\Tags\PositionPositionTagObserverClearCache;
52
use BristolSU\ControlDB\Observers\Pivots\Tags\RoleRoleTagObserverClearCache;
53
use BristolSU\ControlDB\Observers\Pivots\Tags\UserUserTagObserverClearCache;
54
use BristolSU\ControlDB\Observers\Pivots\UserGroupObserverClearCache;
55
use BristolSU\ControlDB\Observers\Pivots\UserRoleObserverClearCache;
56
use BristolSU\ControlDB\Observers\PositionObserverCascadeDelete;
57
use BristolSU\ControlDB\Observers\PositionObserverClearCache;
58
use BristolSU\ControlDB\Observers\RoleObserverCascadeDelete;
59
use BristolSU\ControlDB\Observers\RoleObserverClearCache;
60
use BristolSU\ControlDB\Observers\Tags\GroupTagCategoryObserverCascadeDelete;
61
use BristolSU\ControlDB\Observers\Tags\GroupTagCategoryObserverClearCache;
62
use BristolSU\ControlDB\Observers\Tags\GroupTagObserverCascadeDelete;
63
use BristolSU\ControlDB\Observers\Tags\GroupTagObserverClearCache;
64
use BristolSU\ControlDB\Observers\Tags\PositionTagCategoryObserverCascadeDelete;
65
use BristolSU\ControlDB\Observers\Tags\PositionTagCategoryObserverClearCache;
66
use BristolSU\ControlDB\Observers\Tags\PositionTagObserverCascadeDelete;
67
use BristolSU\ControlDB\Observers\Tags\PositionTagObserverClearCache;
68
use BristolSU\ControlDB\Observers\Tags\RoleTagCategoryObserverCascadeDelete;
69
use BristolSU\ControlDB\Observers\Tags\RoleTagCategoryObserverClearCache;
70
use BristolSU\ControlDB\Observers\Tags\RoleTagObserverCascadeDelete;
71
use BristolSU\ControlDB\Observers\Tags\RoleTagObserverClearCache;
72
use BristolSU\ControlDB\Observers\Tags\UserTagCategoryObserverCascadeDelete;
73
use BristolSU\ControlDB\Observers\Tags\UserTagCategoryObserverClearCache;
74
use BristolSU\ControlDB\Observers\Tags\UserTagObserverCascadeDelete;
75
use BristolSU\ControlDB\Observers\Tags\UserTagObserverClearCache;
76
use BristolSU\ControlDB\Observers\UserObserverCascadeDelete;
77
use BristolSU\ControlDB\Observers\UserObserverClearCache;
78
use BristolSU\ControlDB\Repositories\DataUser as DataUserRepository;
79
use BristolSU\ControlDB\Repositories\DataGroup as DataGroupRepository;
80
use BristolSU\ControlDB\Repositories\DataRole as DataRoleRepository;
81
use BristolSU\ControlDB\Repositories\DataPosition as DataPositionRepository;
82
use BristolSU\ControlDB\Repositories\Group as GroupRepository;
83
use BristolSU\ControlDB\Repositories\Pivots\Tags\GroupGroupTag;
84
use BristolSU\ControlDB\Repositories\Pivots\Tags\PositionPositionTag;
85
use BristolSU\ControlDB\Repositories\Pivots\Tags\RoleRoleTag;
86
use BristolSU\ControlDB\Repositories\Pivots\Tags\UserUserTag;
87
use BristolSU\ControlDB\Repositories\Pivots\UserGroup;
88
use BristolSU\ControlDB\Repositories\Pivots\UserRole;
89
use BristolSU\ControlDB\Repositories\Position as PositionRepository;
90
use BristolSU\ControlDB\Repositories\Role as RoleRepository;
91
use BristolSU\ControlDB\Repositories\Tags\GroupTag as GroupTagRepository;
92
use BristolSU\ControlDB\Repositories\Tags\GroupTagCategory as GroupTagCategoryRepository;
93
use BristolSU\ControlDB\Repositories\Tags\PositionTag as PositionTagRepository;
94
use BristolSU\ControlDB\Repositories\Tags\PositionTagCategory as PositionTagCategoryRepository;
95
use BristolSU\ControlDB\Repositories\Tags\RoleTag as RoleTagRepository;
96
use BristolSU\ControlDB\Repositories\Tags\RoleTagCategory as RoleTagCategoryRepository;
97
use BristolSU\ControlDB\Repositories\Tags\UserTag as UserTagRepository;
98
use BristolSU\ControlDB\Repositories\Tags\UserTagCategory as UserTagCategoryRepository;
99
use BristolSU\ControlDB\Repositories\User as UserRepository;
100
use BristolSU\ControlDB\Contracts\Models\Group as GroupModelContract;
101
use BristolSU\ControlDB\Contracts\Models\Position as PositionContract;
102
use BristolSU\ControlDB\Contracts\Models\Role as RoleModelContract;
103
use BristolSU\ControlDB\Contracts\Models\Tags\GroupTag as GroupTagModelContract;
104
use BristolSU\ControlDB\Contracts\Models\Tags\GroupTagCategory as GroupTagCategoryModelContract;
105
use BristolSU\ControlDB\Contracts\Models\Tags\PositionTag as PositionTagModelContract;
106
use BristolSU\ControlDB\Contracts\Models\Tags\PositionTagCategory as PositionTagCategoryModelContract;
107
use BristolSU\ControlDB\Contracts\Models\Tags\RoleTag as RoleTagModelContract;
108
use BristolSU\ControlDB\Contracts\Models\Tags\RoleTagCategory as RoleTagCategoryModelContract;
109
use BristolSU\ControlDB\Contracts\Models\Tags\UserTag as UserTagModelContract;
110
use BristolSU\ControlDB\Contracts\Models\Tags\UserTagCategory as UserTagCategoryModelContract;
111
use BristolSU\ControlDB\Contracts\Models\User as UserContract;
112
use BristolSU\ControlDB\Contracts\Repositories\Group as GroupRepositoryContract;
113
use BristolSU\ControlDB\Contracts\Repositories\Position as PositionRepositoryContract;
114
use BristolSU\ControlDB\Contracts\Repositories\Role as RoleRepositoryContract;
115
use BristolSU\ControlDB\Contracts\Repositories\Tags\GroupTag as GroupTagRepositoryContract;
116
use BristolSU\ControlDB\Contracts\Repositories\Tags\GroupTagCategory as GroupTagCategoryRepositoryContract;
117
use BristolSU\ControlDB\Contracts\Repositories\Tags\PositionTag as PositionTagRepositoryContract;
118
use BristolSU\ControlDB\Contracts\Repositories\Tags\PositionTagCategory as PositionTagCategoryRepositoryContract;
119
use BristolSU\ControlDB\Contracts\Repositories\Tags\RoleTag as RoleTagRepositoryContract;
120
use BristolSU\ControlDB\Contracts\Repositories\Tags\RoleTagCategory as RoleTagCategoryRepositoryContract;
121
use BristolSU\ControlDB\Contracts\Repositories\Tags\UserTag as UserTagRepositoryContract;
122
use BristolSU\ControlDB\Contracts\Repositories\Tags\UserTagCategory as UserTagCategoryRepositoryContract;
123
use BristolSU\ControlDB\Contracts\Repositories\User as UserRepositoryContract;
124
use Illuminate\Contracts\Container\BindingResolutionException;
125
use Illuminate\Database\Eloquent\Factory;
126
use Illuminate\Support\Facades\Route;
127
use Illuminate\Support\ServiceProvider;
128
129
class ControlDBServiceProvider extends ServiceProvider
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class ControlDBServiceProvider
Loading history...
130
{
131
    use RegistersCachedRepositories, RegistersObserverFramework;
132
    
133 599
    public function register()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function register()
Loading history...
134
    {
135 599
        $this->bindContracts();
136 599
        $this->registerObserversFramework($this->app);
137 599
        $this->registerCachedRepositories($this->app);
138 599
        $this->registerCommands();
139 599
        $this->registerMigrations();
140 599
        $this->registerConfig();
141 599
        $this->registerFactories();
142
        $this->app->singleton('control-exporter', function() {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
143 5
            return new ExportManager($this->app);
144 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
145 599
    }
146
147 599
    public function boot()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function boot()
Loading history...
148
    {
149 599
        $this->setupRouteModelBinding();
150 599
        $this->setupRoutes();
151 599
        $this->setupObservers();
152 599
    }
153
154
    /**
155
     * Register config
156
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
157 599
    protected function registerConfig()
158
    {
159 599
        $this->publishes([__DIR__ .'/../config/control.php' => config_path('control.php'),
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
160 599
        ], 'config');
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
161 599
        $this->mergeConfigFrom(
162 599
            __DIR__ .'/../config/control.php', 'control'
163
        );
164 599
    }
165
166
    /**
167
     * Register factories in a non-production environment
168
     *
169
     * @throws BindingResolutionException
170
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
171 599
    public function registerFactories()
172
    {
173 599
        if (!app()->environment('production') && class_exists(\Faker\Factory::class)) {
0 ignored issues
show
introduced by
The method environment() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

173
        if (!app()->/** @scrutinizer ignore-call */ environment('production') && class_exists(\Faker\Factory::class)) {
Loading history...
174 599
            $this->app->make(Factory::class)->load(__DIR__ .'/../database/factories');
175
        }
176 599
    }
177
    
178 599
    public function registerMigrations()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function registerMigrations()
Loading history...
179
    {
180 599
        $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
181 599
    }
182
183 599
    public function bindContracts()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function bindContracts()
Loading history...
184
    {
185
        // Base Models
186 599
        $this->app->bind(GroupModelContract::class, GroupModel::class);
187 599
        $this->app->bind(RoleModelContract::class, RoleModel::class);
188 599
        $this->app->bind(UserContract::class, UserModel::class);
189 599
        $this->app->bind(PositionContract::class, PositionModel::class);
190 599
        $this->app->bind(DataUserContract::class, DataUser::class);
191 599
        $this->app->bind(DataGroupContract::class, DataGroup::class);
192 599
        $this->app->bind(DataRoleContract::class, DataRole::class);
193 599
        $this->app->bind(DataPositionContract::class, DataPosition::class);
194
195
        // Base Repositories
196 599
        $this->app->bind(GroupRepositoryContract::class, GroupRepository::class);
197 599
        $this->app->bind(RoleRepositoryContract::class, RoleRepository::class);
198 599
        $this->app->bind(UserRepositoryContract::class, UserRepository::class);
199 599
        $this->app->bind(PositionRepositoryContract::class, PositionRepository::class);
200 599
        $this->app->bind(DataUserRepositoryContract::class, DataUserRepository::class);
201 599
        $this->app->bind(DataGroupRepositoryContract::class, DataGroupRepository::class);
202 599
        $this->app->bind(DataRoleRepositoryContract::class, DataRoleRepository::class);
203 599
        $this->app->bind(DataPositionRepositoryContract::class, DataPositionRepository::class);
204
        
205
        // Tag Models
206 599
        $this->app->bind(GroupTagModelContract::class, GroupTagModel::class);
207 599
        $this->app->bind(GroupTagCategoryModelContract::class, GroupTagCategoryModel::class);
208 599
        $this->app->bind(UserTagModelContract::class, UserTagModel::class);
209 599
        $this->app->bind(UserTagCategoryModelContract::class, UserTagCategoryModel::class);
210 599
        $this->app->bind(RoleTagModelContract::class, RoleTagModel::class);
211 599
        $this->app->bind(RoleTagCategoryModelContract::class, RoleTagCategoryModel::class);
212 599
        $this->app->bind(PositionTagModelContract::class, PositionTagModel::class);
213 599
        $this->app->bind(PositionTagCategoryModelContract::class, PositionTagCategoryModel::class);
214
215
        // Tag Repositories
216 599
        $this->app->bind(GroupTagRepositoryContract::class, GroupTagRepository::class);
217 599
        $this->app->bind(GroupTagCategoryRepositoryContract::class, GroupTagCategoryRepository::class);
218 599
        $this->app->bind(UserTagRepositoryContract::class, UserTagRepository::class);
219 599
        $this->app->bind(UserTagCategoryRepositoryContract::class, UserTagCategoryRepository::class);
220 599
        $this->app->bind(RoleTagRepositoryContract::class, RoleTagRepository::class);
221 599
        $this->app->bind(RoleTagCategoryRepositoryContract::class, RoleTagCategoryRepository::class);
222 599
        $this->app->bind(PositionTagRepositoryContract::class, PositionTagRepository::class);
223 599
        $this->app->bind(PositionTagCategoryRepositoryContract::class, PositionTagCategoryRepository::class);
224
        
225
        // Additional Properties
226 599
        $this->app->singleton(AdditionalPropertyStore::class, AdditionalPropertySingletonStore::class);
227
        
228
        // Pivot Repositories
229 599
        $this->app->bind(UserGroupContract::class, UserGroup::class);
230 599
        $this->app->bind(UserRoleContract::class, UserRole::class);
231 599
        $this->app->bind(GroupGroupTagContract::class, GroupGroupTag::class);
232 599
        $this->app->bind(UserUserTagContract::class, UserUserTag::class);
233 599
        $this->app->bind(RoleRoleTagContract::class, RoleRoleTag::class);
234 599
        $this->app->bind(PositionPositionTagContract::class, PositionPositionTag::class);
235
        
236 599
        $this->app->singleton(ObserverStore::class);
237
238 599
    }
239
240 599
    public function registerCommands()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function registerCommands()
Loading history...
241
    {
242 599
        $this->commands([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
243 599
            SeedDatabase::class,
244
            ExportControlCommand::class,
245
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
246 599
    }
247
248 599
    public function setupRouteModelBinding()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function setupRouteModelBinding()
Loading history...
249
    {
250 599
        Route::model('control_group', GroupModel::class);
251 599
        Route::model('control_role', RoleModel::class);
252 599
        Route::model('control_user', UserModel::class);
253 599
        Route::model('control_position', PositionModel::class);
254 599
        Route::model('control_group_tag', GroupTagModel::class);
255 599
        Route::model('control_role_tag', RoleTagModel::class);
256 599
        Route::model('control_user_tag', UserTagModel::class);
257 599
        Route::model('control_position_tag', PositionTagModel::class);
258 599
        Route::model('control_group_tag_category', GroupTagCategoryModel::class);
259 599
        Route::model('control_role_tag_category', RoleTagCategoryModel::class);
260 599
        Route::model('control_user_tag_category', UserTagCategoryModel::class);
261 599
        Route::model('control_position_tag_category', PositionTagCategoryModel::class);
262
263
        Route::bind('control_group', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
264 16
            return app(GroupRepositoryContract::class)->getById($id);
265 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
266
        Route::bind('control_role', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
267 14
            return app(RoleRepositoryContract::class)->getById($id);
268 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
269
        Route::bind('control_user', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
270 19
            return app(UserRepositoryContract::class)->getById($id);
271 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
272
        Route::bind('control_position', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
273 11
            return app(PositionRepositoryContract::class)->getById($id);
274 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
275
276
        Route::bind('control_group_tag', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
277 9
            return app(GroupTagRepositoryContract::class)->getById($id);
278 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
279
        Route::bind('control_role_tag', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
280 9
            return app(RoleTagRepositoryContract::class)->getById($id);
281 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
282
        Route::bind('control_user_tag', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
283 9
            return app(UserTagRepositoryContract::class)->getById($id);
284 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
285
        Route::bind('control_position_tag', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
286 9
            return app(PositionTagRepositoryContract::class)->getById($id);
287 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
288
289
        Route::bind('control_group_tag_category', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
290 4
            return app(GroupTagCategoryRepositoryContract::class)->getById($id);
291 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
292
        Route::bind('control_role_tag_category', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
293 4
            return app(RoleTagCategoryRepositoryContract::class)->getById($id);
294 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
295
        Route::bind('control_user_tag_category', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
296 4
            return app(UserTagCategoryRepositoryContract::class)->getById($id);
297 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
298
        Route::bind('control_position_tag_category', function($id) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
299 4
            return app(PositionTagCategoryRepositoryContract::class)->getById($id);
300 599
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
301 599
    }
302
303 599
    public function setupRoutes()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function setupRoutes()
Loading history...
304
    {
305 599
        Route::prefix(config('control.api_prefix'))
306 599
            ->middleware(config('control.api_middleware'))
307 599
            ->namespace('BristolSU\ControlDB\Http\Controllers')
308 599
            ->group(__DIR__ . '/../routes/api.php');
309 599
    }
310
311 599
    private function setupObservers()
0 ignored issues
show
Coding Style introduced by
Private method name "ControlDBServiceProvider::setupObservers" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Missing doc comment for function setupObservers()
Loading history...
312
    {
313 599
        Observe::attach(RoleRepositoryContract::class, RoleObserverClearCache::class);
314 599
        Observe::attach(UserRepositoryContract::class, UserObserverClearCache::class);
315 599
        Observe::attach(GroupRepositoryContract::class, GroupObserverClearCache::class);
316 599
        Observe::attach(PositionRepositoryContract::class, PositionObserverClearCache::class);
317
318 599
        Observe::attach(DataUserRepositoryContract::class, DataUserObserverClearCache::class);
319 599
        Observe::attach(DataGroupRepositoryContract::class, DataGroupObserverClearCache::class);
320 599
        Observe::attach(DataRoleRepositoryContract::class, DataRoleObserverClearCache::class);
321 599
        Observe::attach(DataPositionRepositoryContract::class, DataPositionObserverClearCache::class);
322
323 599
        Observe::attach(GroupTagRepositoryContract::class, GroupTagObserverClearCache::class);
324 599
        Observe::attach(RoleTagRepositoryContract::class, RoleTagObserverClearCache::class);
325 599
        Observe::attach(UserTagRepositoryContract::class, UserTagObserverClearCache::class);
326 599
        Observe::attach(PositionTagRepositoryContract::class, PositionTagObserverClearCache::class);
327
        
328 599
        Observe::attach(GroupTagCategoryRepositoryContract::class, GroupTagCategoryObserverClearCache::class);
329 599
        Observe::attach(RoleTagCategoryRepositoryContract::class, RoleTagCategoryObserverClearCache::class);
330 599
        Observe::attach(UserTagCategoryRepositoryContract::class, UserTagCategoryObserverClearCache::class);
331 599
        Observe::attach(PositionTagCategoryRepositoryContract::class, PositionTagCategoryObserverClearCache::class);
332
333 599
        Observe::attach(UserGroup::class, UserGroupObserverClearCache::class);
334 599
        Observe::attach(UserRole::class, UserRoleObserverClearCache::class);
335
336 599
        Observe::attach(GroupGroupTag::class, GroupGroupTagObserverClearCache::class);
337 599
        Observe::attach(UserUserTag::class, UserUserTagObserverClearCache::class);
338 599
        Observe::attach(RoleRoleTag::class, RoleRoleTagObserverClearCache::class);
339 599
        Observe::attach(PositionPositionTag::class, PositionPositionTagObserverClearCache::class);
340
341 599
        Observe::attach(GroupTagRepositoryContract::class, GroupTagObserverCascadeDelete::class);
342 599
        Observe::attach(UserTagRepositoryContract::class, UserTagObserverCascadeDelete::class);
343 599
        Observe::attach(RoleTagRepositoryContract::class, RoleTagObserverCascadeDelete::class);
344 599
        Observe::attach(PositionTagRepositoryContract::class, PositionTagObserverCascadeDelete::class);
345
        
346 599
        Observe::attach(GroupTagCategoryRepositoryContract::class, GroupTagCategoryObserverCascadeDelete::class);
347 599
        Observe::attach(UserTagCategoryRepositoryContract::class, UserTagCategoryObserverCascadeDelete::class);
348 599
        Observe::attach(RoleTagCategoryRepositoryContract::class, RoleTagCategoryObserverCascadeDelete::class);
349 599
        Observe::attach(PositionTagCategoryRepositoryContract::class, PositionTagCategoryObserverCascadeDelete::class);
350
351 599
        Observe::attach(RoleRepositoryContract::class, RoleObserverCascadeDelete::class);
352 599
        Observe::attach(UserRepositoryContract::class, UserObserverCascadeDelete::class);
353 599
        Observe::attach(GroupRepositoryContract::class, GroupObserverCascadeDelete::class);
354 599
        Observe::attach(PositionRepositoryContract::class, PositionObserverCascadeDelete::class);
355 599
    }
356
357
358
}