File tree 3 files changed +30
-2
lines changed
3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ parameters:
8
8
- ' #Instantiated class Drupal.Core #'
9
9
- ' #PHPPM.Laravel.SessionGuard #'
10
10
- ' #Property Illuminate.Auth.SessionGuard #'
11
+ - ' #Method Illuminate\\Foundation\\Application::register.. invoked with 3 parameters , 1-2 required. #'
Original file line number Diff line number Diff line change 22
22
# Unit test
23
23
- ./vendor/bin/phpunit
24
24
# Static analyzer check
25
- - ./vendor/bin/phpstan analyze -c .phpstan.neon --level=4 --no-progress Bootstraps Bridges Laravel || true
25
+ - ./vendor/bin/phpstan analyze -c .phpstan.neon --level=4 --no-progress Bootstraps Bridges Laravel
26
26
# Check the code style
27
27
- IFS=$'\n'; COMMIT_SCA_FILES=($(git diff --name-only --diff-filter=ACMRTUXB "${TRAVIS_COMMIT_RANGE}")); unset IFS
28
28
- ./vendor/bin/php-cs-fixer fix --config=.php_cs.php -v --dry-run --diff --stop-on-violation --using-cache=no --path-mode=intersection -- "${COMMIT_SCA_FILES[@]}"
Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ class Laravel implements
28
28
*/
29
29
protected $ app ;
30
30
31
+ /**
32
+ * Laravel Application->register() parameter count
33
+ *
34
+ * @var int
35
+ */
36
+ private $ appRegisterParameters ;
37
+
31
38
/**
32
39
* Instantiate the bootstrap, storing the $appenv
33
40
*
@@ -143,6 +150,26 @@ protected function resetProvider($providerName)
143
150
return ;
144
151
}
145
152
146
- $ this ->app ->register ($ providerName , [], true );
153
+ $ this ->appRegister ($ providerName , true );
154
+ }
155
+
156
+ /**
157
+ * Register application provider
158
+ * Workaround for BC break in https://github.com/laravel/framework/pull/25028
159
+ * @param string $providerName
160
+ * @param bool $force
161
+ */
162
+ protected function appRegister ($ providerName , $ force = false )
163
+ {
164
+ if (!$ this ->appRegisterParameters ) {
165
+ $ method = new \ReflectionMethod (get_class ($ this ->app ), ['name ' => 'register ' ]);
166
+ $ this ->appRegisterParameters = count ($ method ->getParameters ());
167
+ }
168
+
169
+ if ($ this ->appRegisterParameters == 3 ) {
170
+ $ this ->app ->register ($ providerName , [], $ force );
171
+ } else {
172
+ $ this ->app ->register ($ providerName , $ force );
173
+ }
147
174
}
148
175
}
You can’t perform that action at this time.
0 commit comments