This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-18
lines changed Expand file tree Collapse file tree 3 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ private function ffprobeFormat($format)
70
70
{
71
71
$ this ->ffprobe ();
72
72
73
- if (count ($ this ->formats ) > 0 ) {
73
+ if (is_array ( $ this -> formats ) && count ($ this ->formats ) > 0 ) {
74
74
$ args = func_get_args ();
75
75
76
76
foreach ($ args as $ arg ) {
Original file line number Diff line number Diff line change 3
3
namespace InfinityNext \Sleuth ;
4
4
5
5
use InfinityNext \Sleuth \Contracts \DetectiveContract ;
6
- use InfinityNext \Sleuth \Detectives \ImageGDDetective ;
7
6
use InfinityNext \Sleuth \Detectives \ffmpegDetective ;
8
- use InfinityNext \Sleuth \Detectives \svgDetective ;
9
7
use InfinityNext \Sleuth \Detectives \ImagickDetective ;
8
+ use InfinityNext \Sleuth \Detectives \ImageGDDetective ;
9
+ use InfinityNext \Sleuth \Detectives \PlaintextDetective ;
10
+ use InfinityNext \Sleuth \Detectives \svgDetective ;
10
11
11
12
class FileSleuth
12
13
{
@@ -17,9 +18,10 @@ class FileSleuth
17
18
*/
18
19
protected $ detectives = [
19
20
ImageGDDetective::class,
20
- ffmpegDetective::class,
21
21
svgDetective::class,
22
22
ImagickDetective::class,
23
+ PlaintextDetective::class,
24
+ ffmpegDetective::class,
23
25
];
24
26
25
27
/**
Original file line number Diff line number Diff line change 5
5
6
6
class SleuthTest extends TestCase
7
7
{
8
- public function testSleuth ()
9
- {
10
- $ files = [
11
- 'jpg ' => __DIR__ . "/files/normal.jpg " ,
12
- 'mp4 ' => __DIR__ . "/files/normal.mp4 " ,
13
- 'svg ' => __DIR__ . "/files/normal.svg " ,
14
- ];
8
+ public function testSleuth ()
9
+ {
10
+ $ files = [
11
+ 'jpg ' => __DIR__ . "/files/normal.jpg " ,
12
+ 'mp4 ' => __DIR__ . "/files/normal.mp4 " ,
13
+ 'svg ' => __DIR__ . "/files/normal.svg " ,
14
+ 'asc ' => __DIR__ . "/files/pubkey.asc " ,
15
+ 'pdf ' => __DIR__ . "/files/normal.pdf " ,
16
+ ];
15
17
16
- foreach ($ files as $ ext => $ file )
17
- {
18
- $ sleuth = new FileSleuth ($ file );
19
- $ case = $ sleuth ->check ($ file );
18
+ foreach ($ files as $ ext => $ file )
19
+ {
20
+ $ sleuth = new FileSleuth ($ file );
21
+ $ case = $ sleuth ->check ($ file );
20
22
21
- $ this ->assertEquals ($ ext , $ case ->getExtension ());
22
- }
23
- }
23
+ $ this ->assertEquals ($ ext , $ case ->getExtension ());
24
+ }
25
+ }
24
26
}
You can’t perform that action at this time.
0 commit comments