File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,11 @@ public function output(array $tree): array
29
29
foreach ($ tree ['controllers ' ] as $ controller ) {
30
30
foreach ($ controller ->methods () as $ method => $ statements ) {
31
31
foreach ($ statements as $ statement ) {
32
- if (!$ statement instanceof SendStatement) {
32
+ if (! $ statement instanceof SendStatement) {
33
33
continue ;
34
34
}
35
35
36
- if ($ statement ->type () !== SendStatement::TYPE_NOTIFICATION_WITH_FACADE
37
- && $ statement ->type () !== SendStatement::TYPE_NOTIFICATION_WITH_MODEL
38
- ) {
36
+ if (! $ statement ->isNotification ()) {
39
37
continue ;
40
38
}
41
39
Original file line number Diff line number Diff line change @@ -116,9 +116,7 @@ protected function buildTestCases(Controller $controller)
116
116
117
117
foreach ($ statements as $ statement ) {
118
118
if ($ statement instanceof SendStatement) {
119
- if ($ statement ->type () === SendStatement::TYPE_NOTIFICATION_WITH_FACADE
120
- || $ statement ->type () === SendStatement::TYPE_NOTIFICATION_WITH_MODEL
121
- ) {
119
+ if ($ statement ->isNotification ()) {
122
120
$ this ->addImport ($ controller , 'Illuminate \\Support \\Facades \\Notification ' );
123
121
$ this ->addImport ($ controller , config ('blueprint.namespace ' ) . '\\Notification \\' . $ statement ->mail ());
124
122
Original file line number Diff line number Diff line change 6
6
class SendStatement
7
7
{
8
8
const TYPE_MAIL = 'mail ' ;
9
-
10
9
const TYPE_NOTIFICATION_WITH_FACADE = 'notification_with_facade ' ;
11
-
12
10
const TYPE_NOTIFICATION_WITH_MODEL = 'notification_with_model ' ;
13
11
14
12
/**
@@ -75,6 +73,11 @@ public function output()
75
73
return $ this ->mailOutput ();
76
74
}
77
75
76
+ public function isNotification ()
77
+ {
78
+ return $ this ->type () === SendStatement::TYPE_NOTIFICATION_WITH_FACADE || $ this ->type () === SendStatement::TYPE_NOTIFICATION_WITH_MODEL ;
79
+ }
80
+
78
81
private function mailOutput ()
79
82
{
80
83
$ code = 'Mail:: ' ;
You can’t perform that action at this time.
0 commit comments