File tree 6 files changed +62
-7
lines changed 6 files changed +62
-7
lines changed Original file line number Diff line number Diff line change 1
1
preset : laravel
2
2
3
+ risky : true
4
+
3
5
disabled :
4
6
- single_class_element_per_statement
5
7
- self_accessor
Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ matrix:
51
51
- php : 7.4
52
52
env : LARAVEL=^7.0 TESTBENCH=^5.0 PHPUNIT=~8.5
53
53
54
+ # Laravel 8.x
55
+ - php : 7.3
56
+ env : LARAVEL=^8.0 TESTBENCH=^6.0 PHPUNIT=~9.3
57
+ - php : 7.4
58
+ env : LARAVEL=^8.0 TESTBENCH=^6.0 PHPUNIT=~9.3
59
+
54
60
before_install :
55
61
- phpenv config-rm xdebug.ini
56
62
- composer self-update --stable --no-interaction
Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to ` laravel-sri ` will be documented in this file
4
4
5
+ ## 2.2.0 - 2020-09-07
6
+
7
+ - Add support for Laravel 8
8
+
5
9
## 2.1.0 - 2020-03-03
6
10
7
11
- Add support for Laravel 7
Original file line number Diff line number Diff line change 9
9
"type" : " library" ,
10
10
"require" : {
11
11
"php" : " ^7.1" ,
12
- "laravel/framework" : " ^5.5|^6.0|^7.0"
12
+ "laravel/framework" : " ^5.5|^6.0|^7.0|^8.0 "
13
13
},
14
14
"require-dev" : {
15
- "phpunit/phpunit" : " ^6.0|^7.0|^8.0" ,
15
+ "phpunit/phpunit" : " ^6.0|^7.0|^8.0|^9.3 " ,
16
16
"mockery/mockery" : " ^1.0" ,
17
- "orchestra/testbench" : " ^3.5|^4.0|^5.0"
17
+ "orchestra/testbench" : " ^3.5|^4.0|^5.0|^6.0 "
18
18
},
19
19
"autoload" : {
20
20
"files" : [
Original file line number Diff line number Diff line change 2
2
3
3
use Sebdesign \SRI \Hasher ;
4
4
5
+ if (! function_exists ('elixir ' )) {
6
+ /**
7
+ * Get the path to a versioned Elixir file.
8
+ *
9
+ * @param string $file
10
+ * @param string $buildDirectory
11
+ * @return string
12
+ *
13
+ * @throws \InvalidArgumentException
14
+ *
15
+ * @deprecated Use Laravel Mix instead.
16
+ */
17
+ function elixir ($ file , $ buildDirectory = 'build ' )
18
+ {
19
+ static $ manifest = [];
20
+ static $ manifestPath ;
21
+
22
+ if (empty ($ manifest ) || $ manifestPath !== $ buildDirectory ) {
23
+ $ path = public_path ($ buildDirectory .'/rev-manifest.json ' );
24
+
25
+ if (file_exists ($ path )) {
26
+ $ manifest = json_decode (file_get_contents ($ path ), true );
27
+ $ manifestPath = $ buildDirectory ;
28
+ }
29
+ }
30
+
31
+ $ file = ltrim ($ file , '/ ' );
32
+
33
+ if (isset ($ manifest [$ file ])) {
34
+ return '/ ' .trim ($ buildDirectory .'/ ' .$ manifest [$ file ], '/ ' );
35
+ }
36
+
37
+ $ unversioned = public_path ($ file );
38
+
39
+ if (file_exists ($ unversioned )) {
40
+ return '/ ' .trim ($ file , '/ ' );
41
+ }
42
+
43
+ throw new InvalidArgumentException ("File {$ file } not defined in asset manifest. " );
44
+ }
45
+ }
46
+
5
47
if (! function_exists ('integrity ' )) {
6
48
/**
7
49
* Get the integrity hash for a file.
Original file line number Diff line number Diff line change 2
2
3
3
namespace Sebdesign \SRI \Test ;
4
4
5
+ use PHPUnit \Framework \Constraint \RegularExpression ;
5
6
use Sebdesign \SRI \Hasher ;
6
7
7
8
class HasherTest extends TestCase
@@ -109,15 +110,15 @@ public function it_accepts_multiple_algorithms()
109
110
110
111
// assert
111
112
112
- $ this ->assertRegExp ( '/^sha256-.+ sha384-.+$/ ' , $ hash );
113
+ $ this ->assertThat ( $ hash , new RegularExpression ( '/^sha256-.+ sha384-.+$/ ' ) );
113
114
114
115
// act
115
116
116
117
$ hash = $ hasher ->make ($ css , ['algorithms ' => ['sha384 ' , 'sha512 ' ]]);
117
118
118
119
// assert
119
120
120
- $ this ->assertRegExp ( '/^sha384-.+ sha512-.+$/ ' , $ hash );
121
+ $ this ->assertThat ( $ hash , new RegularExpression ( '/^sha384-.+ sha512-.+$/ ' ) );
121
122
}
122
123
123
124
/**
@@ -138,15 +139,15 @@ public function it_accepts_a_different_delimiter()
138
139
139
140
// assert
140
141
141
- $ this ->assertRegExp ( '/^sha256-.+_sha384-.+$/ ' , $ hash );
142
+ $ this ->assertThat ( $ hash , new RegularExpression ( '/^sha256-.+_sha384-.+$/ ' ) );
142
143
143
144
// act
144
145
145
146
$ hash = $ hasher ->make ($ css , ['delimiter ' => ': ' ]);
146
147
147
148
// assert
148
149
149
- $ this ->assertRegExp ( '/^sha256-.+:sha384-.+$/ ' , $ hash );
150
+ $ this ->assertThat ( $ hash , new RegularExpression ( '/^sha256-.+:sha384-.+$/ ' ) );
150
151
}
151
152
152
153
/**
You can’t perform that action at this time.
0 commit comments