File tree Expand file tree Collapse file tree 7 files changed +39
-38
lines changed
tests/Unit/Http/Middleware Expand file tree Collapse file tree 7 files changed +39
-38
lines changed Original file line number Diff line number Diff line change @@ -6,21 +6,9 @@ updates:
6
6
directory : " /"
7
7
schedule :
8
8
interval : weekly
9
- time : " 11:00"
10
- labels :
11
- - actions
12
- - dependencies
13
- - auto-squash
14
9
15
10
# Maintain dependencies for Composer
16
11
- package-ecosystem : composer
17
12
directory : " /"
18
13
schedule :
19
14
interval : weekly
20
- time : " 07:00"
21
- open-pull-requests-limit : 10
22
- versioning-strategy : lockfile-only
23
- labels :
24
- - php
25
- - dependencies
26
- - auto-squash
Original file line number Diff line number Diff line change
1
+ name : Lint files
2
+
3
+ on :
4
+ pull_request :
5
+ types : [opened, synchronize, reopened]
6
+
7
+ concurrency :
8
+ group : Lint files ${{ github.ref }}
9
+ cancel-in-progress : true
10
+
11
+ jobs :
12
+ php :
13
+ name : Lint PHP files
14
+ uses : monicahq/workflows/.github/workflows/lint_php.yml@v2
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 25
25
},
26
26
"require-dev" : {
27
27
"guzzlehttp/guzzle" : " ^6.3 || ^7.0" ,
28
- "mockery/mockery " : " ^1.4 " ,
28
+ "jschaedl/composer-git-hooks " : " ^4.0 " ,
29
29
"larastan/larastan" : " ^1.0 || ^2.4" ,
30
+ "laravel/pint" : " ^1.15" ,
31
+ "mockery/mockery" : " ^1.4" ,
30
32
"ocramius/package-versions" : " ^1.5 || ^2.1" ,
31
33
"orchestra/testbench" : " ^6.0 || ^7.0 || ^8.0 || ^9.0" ,
32
34
"phpstan/phpstan-deprecation-rules" : " ^1.0" ,
50
52
"providers" : [
51
53
" Monicahq\\ Cloudflare\\ TrustedProxyServiceProvider"
52
54
]
55
+ },
56
+ "hooks" : {
57
+ "config" : {
58
+ "stop-on-failure" : [
59
+ " pre-commit"
60
+ ]
61
+ },
62
+ "pre-commit" : [
63
+ " files=$(git diff --staged --name-only);\" $(dirname \" $0\" )/../../vendor/bin/pint\" $files; git add $files"
64
+ ]
53
65
}
54
66
},
67
+ "scripts" : {
68
+ "cghooks" : " vendor/bin/cghooks" ,
69
+ "post-install-cmd" : " cghooks add --ignore-lock" ,
70
+ "post-update-cmd" : " cghooks update"
71
+ },
55
72
"suggest" : {
56
73
"guzzlehttp/guzzle" : " Required to get cloudflares ip addresses (^6.5.5|^7.0)."
57
74
},
Original file line number Diff line number Diff line change @@ -16,27 +16,13 @@ class CloudflareProxies
16
16
17
17
public const IP_VERSION_ANY = self ::IP_VERSION_4 | self ::IP_VERSION_6 ;
18
18
19
- /**
20
- * The config repository instance.
21
- *
22
- * @var Repository
23
- */
24
- protected $ config ;
25
-
26
- /**
27
- * The http factory instance.
28
- *
29
- * @var HttpClient
30
- */
31
- protected $ http ;
32
-
33
19
/**
34
20
* Create a new instance of CloudflareProxies.
35
21
*/
36
- public function __construct (Repository $ config , HttpClient $ http )
37
- {
38
- $ this -> config = $ config ;
39
- $ this -> http = $ http ;
22
+ public function __construct (
23
+ protected Repository $ config ,
24
+ protected HttpClient $ http
25
+ ) {
40
26
}
41
27
42
28
/**
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ final class LaravelCloudflare
19
19
*/
20
20
public static function getProxies (): array
21
21
{
22
- if (static ::$ getProxiesCallback !== null ) {
23
- return call_user_func (static ::$ getProxiesCallback );
22
+ if (self ::$ getProxiesCallback !== null ) {
23
+ return call_user_func (self ::$ getProxiesCallback );
24
24
}
25
25
26
26
return CloudflareProxies::load ();
@@ -31,6 +31,6 @@ public static function getProxies(): array
31
31
*/
32
32
public static function getProxiesUsing (?Closure $ callback ): void
33
33
{
34
- static ::$ getProxiesCallback = $ callback ;
34
+ self ::$ getProxiesCallback = $ callback ;
35
35
}
36
36
}
Original file line number Diff line number Diff line change 4
4
5
5
use Illuminate \Http \Request ;
6
6
use Illuminate \Support \Facades \Cache ;
7
- use Illuminate \Support \Facades \Route ;
8
7
use Monicahq \Cloudflare \Http \Middleware \TrustProxies ;
9
8
use Monicahq \Cloudflare \LaravelCloudflare ;
10
9
use Monicahq \Cloudflare \Tests \FeatureTestCase ;
You can’t perform that action at this time.
0 commit comments