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
Pull Request — master (#14)
by Toby
31:11 queued 12:50
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 1
Bugs 0 Features 0
Metric Value
eloc 34
c 1
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 796
    public function register()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function register()
Loading history...
134
    {
135 796
        $this->bindContracts();
136 796
        $this->registerObserversFramework($this->app);
137 796
        $this->registerCachedRepositories($this->app);
138 796
        $this->registerCommands();
139 796
        $this->registerMigrations();
140 796
        $this->registerConfig();
141 796
        $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 796
        });
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 796
    }
146
147 796
    public function boot()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function boot()
Loading history...
148
    {
149 796
        $this->setupRouteModelBinding();
150 796
        $this->setupRoutes();
151 796
        $this->setupObservers();
152 796
    }
153
154
    /**
155
     * Register config
156
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
157 796
    protected function registerConfig()
158
    {
159 796
        $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 796
        ], '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 796
        $this->mergeConfigFrom(
162 796
            __DIR__ .'/../config/control.php', 'control'
163
        );
164 796
    }
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 796
    public function registerFactories()
172
    {
173 796
        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 796
            $this->app->make(Factory::class)->load(__DIR__ .'/../database/factories');
175
        }
176 796
    }
177
    
178 796
    public function registerMigrations()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function registerMigrations()
Loading history...
179
    {
180 796
        $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
181 796
    }
182
183 796
    public function bindContracts()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function bindContracts()
Loading history...
184
    {
185
        // Base Models
186 796
        $this->app->bind(GroupModelContract::class, GroupModel::class);
187 796
        $this->app->bind(RoleModelContract::class, RoleModel::class);
188 796
        $this->app->bind(UserContract::class, UserModel::class);
189 796
        $this->app->bind(PositionContract::class, PositionModel::class);
190 796
        $this->app->bind(DataUserContract::class, DataUser::class);
191 796
        $this->app->bind(DataGroupContract::class, DataGroup::class);
192 796
        $this->app->bind(DataRoleContract::class, DataRole::class);
193 796
        $this->app->bind(DataPositionContract::class, DataPosition::class);
194
195
        // Base Repositories
196 796
        $this->app->bind(GroupRepositoryContract::class, GroupRepository::class);
197 796
        $this->app->bind(RoleRepositoryContract::class, RoleRepository::class);
198 796
        $this->app->bind(UserRepositoryContract::class, UserRepository::class);
199 796
        $this->app->bind(PositionRepositoryContract::class, PositionRepository::class);
200 796
        $this->app->bind(DataUserRepositoryContract::class, DataUserRepository::class);
201 796
        $this->app->bind(DataGroupRepositoryContract::class, DataGroupRepository::class);
202 796
        $this->app->bind(DataRoleRepositoryContract::class, DataRoleRepository::class);
203 796
        $this->app->bind(DataPositionRepositoryContract::class, DataPositionRepository::class);
204
        
205
        // Tag Models
206 796
        $this->app->bind(GroupTagModelContract::class, GroupTagModel::class);
207 796
        $this->app->bind(GroupTagCategoryModelContract::class, GroupTagCategoryModel::class);
208 796
        $this->app->bind(UserTagModelContract::class, UserTagModel::class);
209 796
        $this->app->bind(UserTagCategoryModelContract::class, UserTagCategoryModel::class);
210 796
        $this->app->bind(RoleTagModelContract::class, RoleTagModel::class);
211 796
        $this->app->bind(RoleTagCategoryModelContract::class, RoleTagCategoryModel::class);
212 796
        $this->app->bind(PositionTagModelContract::class, PositionTagModel::class);
213 796
        $this->app->bind(PositionTagCategoryModelContract::class, PositionTagCategoryModel::class);
214
215
        // Tag Repositories
216 796
        $this->app->bind(GroupTagRepositoryContract::class, GroupTagRepository::class);
217 796
        $this->app->bind(GroupTagCategoryRepositoryContract::class, GroupTagCategoryRepository::class);
218 796
        $this->app->bind(UserTagRepositoryContract::class, UserTagRepository::class);
219 796
        $this->app->bind(UserTagCategoryRepositoryContract::class, UserTagCategoryRepository::class);
220 796
        $this->app->bind(RoleTagRepositoryContract::class, RoleTagRepository::class);
221 796
        $this->app->bind(RoleTagCategoryRepositoryContract::class, RoleTagCategoryRepository::class);
222 796
        $this->app->bind(PositionTagRepositoryContract::class, PositionTagRepository::class);
223 796
        $this->app->bind(PositionTagCategoryRepositoryContract::class, PositionTagCategoryRepository::class);
224
        
225
        // Additional Properties
226 796
        $this->app->singleton(AdditionalPropertyStore::class, AdditionalPropertySingletonStore::class);
227
        
228
        // Pivot Repositories
229 796
        $this->app->bind(UserGroupContract::class, UserGroup::class);
230 796
        $this->app->bind(UserRoleContract::class, UserRole::class);
231 796
        $this->app->bind(GroupGroupTagContract::class, GroupGroupTag::class);
232 796
        $this->app->bind(UserUserTagContract::class, UserUserTag::class);
233 796
        $this->app->bind(RoleRoleTagContract::class, RoleRoleTag::class);
234 796
        $this->app->bind(PositionPositionTagContract::class, PositionPositionTag::class);
235
        
236 796
        $this->app->singleton(ObserverStore::class);
237
238 796
    }
239
240 796
    public function registerCommands()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function registerCommands()
Loading history...
241
    {
242 796
        $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 796
            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 796
    }
247
248 796
    public function setupRouteModelBinding()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function setupRouteModelBinding()
Loading history...
249
    {
250 796
        Route::model('control_group', GroupModel::class);
251 796
        Route::model('control_role', RoleModel::class);
252 796
        Route::model('control_user', UserModel::class);
253 796
        Route::model('control_position', PositionModel::class);
254 796
        Route::model('control_group_tag', GroupTagModel::class);
255 796
        Route::model('control_role_tag', RoleTagModel::class);
256 796
        Route::model('control_user_tag', UserTagModel::class);
257 796
        Route::model('control_position_tag', PositionTagModel::class);
258 796
        Route::model('control_group_tag_category', GroupTagCategoryModel::class);
259 796
        Route::model('control_role_tag_category', RoleTagCategoryModel::class);
260 796
        Route::model('control_user_tag_category', UserTagCategoryModel::class);
261 796
        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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
        });
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 796
    }
302
303 796
    public function setupRoutes()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function setupRoutes()
Loading history...
304
    {
305 796
        Route::prefix(config('control.api_prefix'))
306 796
            ->middleware(config('control.api_middleware'))
307 796
            ->namespace('BristolSU\ControlDB\Http\Controllers')
308 796
            ->group(__DIR__ . '/../routes/api.php');
309 796
    }
310
311 796
    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 796
        Observe::attach(RoleRepositoryContract::class, RoleObserverClearCache::class);
314 796
        Observe::attach(UserRepositoryContract::class, UserObserverClearCache::class);
315 796
        Observe::attach(GroupRepositoryContract::class, GroupObserverClearCache::class);
316 796
        Observe::attach(PositionRepositoryContract::class, PositionObserverClearCache::class);
317
318 796
        Observe::attach(DataUserRepositoryContract::class, DataUserObserverClearCache::class);
319 796
        Observe::attach(DataGroupRepositoryContract::class, DataGroupObserverClearCache::class);
320 796
        Observe::attach(DataRoleRepositoryContract::class, DataRoleObserverClearCache::class);
321 796
        Observe::attach(DataPositionRepositoryContract::class, DataPositionObserverClearCache::class);
322
323 796
        Observe::attach(GroupTagRepositoryContract::class, GroupTagObserverClearCache::class);
324 796
        Observe::attach(RoleTagRepositoryContract::class, RoleTagObserverClearCache::class);
325 796
        Observe::attach(UserTagRepositoryContract::class, UserTagObserverClearCache::class);
326 796
        Observe::attach(PositionTagRepositoryContract::class, PositionTagObserverClearCache::class);
327
        
328 796
        Observe::attach(GroupTagCategoryRepositoryContract::class, GroupTagCategoryObserverClearCache::class);
329 796
        Observe::attach(RoleTagCategoryRepositoryContract::class, RoleTagCategoryObserverClearCache::class);
330 796
        Observe::attach(UserTagCategoryRepositoryContract::class, UserTagCategoryObserverClearCache::class);
331 796
        Observe::attach(PositionTagCategoryRepositoryContract::class, PositionTagCategoryObserverClearCache::class);
332
333 796
        Observe::attach(UserGroupContract::class, UserGroupObserverClearCache::class);
334 796
        Observe::attach(UserRoleContract::class, UserRoleObserverClearCache::class);
335
336 796
        Observe::attach(GroupGroupTagContract::class, GroupGroupTagObserverClearCache::class);
337 796
        Observe::attach(UserUserTagContract::class, UserUserTagObserverClearCache::class);
338 796
        Observe::attach(RoleRoleTagContract::class, RoleRoleTagObserverClearCache::class);
339 796
        Observe::attach(PositionPositionTagContract::class, PositionPositionTagObserverClearCache::class);
340
341 796
        Observe::attach(GroupTagRepositoryContract::class, GroupTagObserverCascadeDelete::class);
342 796
        Observe::attach(UserTagRepositoryContract::class, UserTagObserverCascadeDelete::class);
343 796
        Observe::attach(RoleTagRepositoryContract::class, RoleTagObserverCascadeDelete::class);
344 796
        Observe::attach(PositionTagRepositoryContract::class, PositionTagObserverCascadeDelete::class);
345
        
346 796
        Observe::attach(GroupTagCategoryRepositoryContract::class, GroupTagCategoryObserverCascadeDelete::class);
347 796
        Observe::attach(UserTagCategoryRepositoryContract::class, UserTagCategoryObserverCascadeDelete::class);
348 796
        Observe::attach(RoleTagCategoryRepositoryContract::class, RoleTagCategoryObserverCascadeDelete::class);
349 796
        Observe::attach(PositionTagCategoryRepositoryContract::class, PositionTagCategoryObserverCascadeDelete::class);
350
351 796
        Observe::attach(RoleRepositoryContract::class, RoleObserverCascadeDelete::class);
352 796
        Observe::attach(UserRepositoryContract::class, UserObserverCascadeDelete::class);
353 796
        Observe::attach(GroupRepositoryContract::class, GroupObserverCascadeDelete::class);
354 796
        Observe::attach(PositionRepositoryContract::class, PositionObserverCascadeDelete::class);
355 796
    }
356
357
358
}