File tree Expand file tree Collapse file tree 6 files changed +30
-27
lines changed Expand file tree Collapse file tree 6 files changed +30
-27
lines changed Original file line number Diff line number Diff line change 1
1
language : php
2
2
3
3
php :
4
+ - 5.6
4
5
- 7.1
5
6
6
7
sudo : false
Original file line number Diff line number Diff line change 26
26
},
27
27
"require-dev" : {
28
28
"mockery/mockery" : " ~0.9" ,
29
- "orchestra/database" : " ~3.0 " ,
30
- "orchestra/testbench" : " ~3.0 " ,
31
- "phpunit/phpunit" : " ~6.0 "
29
+ "orchestra/database" : " ~3.4 " ,
30
+ "orchestra/testbench" : " ~3.4 " ,
31
+ "phpunit/phpunit" : " ~5.7 "
32
32
},
33
33
"suggest" : {
34
34
"nexmo/client" : " Required for sms notifications."
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ protected function upcoming($event)
82
82
if ($ event ->timezone ) {
83
83
$ date ->setTimezone ($ event ->timezone );
84
84
}
85
-
86
- return (CronExpression:: factory ( $ event -> expression )-> getNextRunDate ( $ date -> toDateTimeString ())) ->format ('Y-m-d H:i:s ' );
85
+ $ expression = CronExpression:: factory ( $ event -> expression )-> getNextRunDate ( $ date -> toDateTimeString ());
86
+ return $ expression ->format ('Y-m-d H:i:s ' );
87
87
}
88
88
}
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ class Totem
21
21
*/
22
22
public static function check ($ request )
23
23
{
24
- return ( static ::$ authUsing ?: function () {
24
+ $ callback = static ::$ authUsing ?: function () {
25
25
return app ()->environment ('local ' );
26
- })($ request );
26
+ };
27
+ return $ callback ($ request );
27
28
}
28
29
29
30
/**
Original file line number Diff line number Diff line change 2
2
3
3
namespace Studio \Totem \Tests \Feature ;
4
4
5
+ use Illuminate \Http \Request ;
5
6
use Studio \Totem \Totem ;
6
7
use Studio \Totem \Tests \TestCase ;
7
8
use Studio \Totem \Http \Middleware \Authenticate ;
@@ -30,10 +31,9 @@ public function auth_middleware_works()
30
31
});
31
32
32
33
$ middleware = new Authenticate ;
33
-
34
+ $ object = new Request ;
34
35
$ response = $ middleware ->handle (
35
- new class {
36
- },
36
+ $ object ,
37
37
function ($ value ) {
38
38
return 'response ' ;
39
39
}
@@ -53,10 +53,9 @@ public function auth_middleware_responds_with_403_on_failure()
53
53
});
54
54
55
55
$ middleware = new Authenticate ;
56
-
56
+ $ object = new Request ;
57
57
$ response = $ middleware ->handle (
58
- new class {
59
- },
58
+ $ object ,
60
59
function ($ value ) {
61
60
return 'response ' ;
62
61
}
Original file line number Diff line number Diff line change @@ -52,20 +52,7 @@ protected function getPackageProviders($app)
52
52
*/
53
53
protected function disableExceptionHandling ()
54
54
{
55
- $ this ->app ->instance (ExceptionHandler::class, new class extends Handler {
56
- public function __construct ()
57
- {
58
- }
59
-
60
- public function report (Exception $ e )
61
- {
62
- }
63
-
64
- public function render ($ request , Exception $ e )
65
- {
66
- throw $ e ;
67
- }
68
- });
55
+ app ()->instance (ExceptionHandler::class, new PassThroughHandler );
69
56
70
57
return $ this ;
71
58
}
@@ -84,3 +71,18 @@ public function signIn()
84
71
return $ this ;
85
72
}
86
73
}
74
+
75
+ class PassThroughHandler extends Handler
76
+ {
77
+ public function __construct ()
78
+ {
79
+ }
80
+ public function report (Exception $ e )
81
+ {
82
+ // no-op
83
+ }
84
+ public function render ($ request , Exception $ e )
85
+ {
86
+ throw $ e ;
87
+ }
88
+ }
You can’t perform that action at this time.
0 commit comments