Vous êtes connecté en tant que anonymous Se Deconnecter
Browse code

Application modulaire fonctionnelle !

Emmanuel ROY authored on 12/08/2019 15:10:25
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,230 +0,0 @@
1
-<?php
2
-
3
-namespace Illuminate\View\Compilers\Concerns;
4
-
5
-trait CompilesConditionals
6
-{
7
-    /**
8
-     * Identifier for the first case in switch statement.
9
-     *
10
-     * @var bool
11
-     */
12
-    protected $firstCaseInSwitch = true;
13
-
14
-    /**
15
-     * Compile the if-auth statements into valid PHP.
16
-     *
17
-     * @param  string|null  $guard
18
-     * @return string
19
-     */
20
-    protected function compileAuth($guard = null)
21
-    {
22
-        $guard = is_null($guard) ? '()' : $guard;
23
-
24
-        return "<?php if(auth()->guard{$guard}->check()): ?>";
25
-    }
26
-
27
-    /**
28
-     * Compile the else-auth statements into valid PHP.
29
-     *
30
-     * @param  string|null  $guard
31
-     * @return string
32
-     */
33
-    protected function compileElseAuth($guard = null)
34
-    {
35
-        $guard = is_null($guard) ? '()' : $guard;
36
-
37
-        return "<?php elseif(auth()->guard{$guard}->check()): ?>";
38
-    }
39
-
40
-    /**
41
-     * Compile the end-auth statements into valid PHP.
42
-     *
43
-     * @return string
44
-     */
45
-    protected function compileEndAuth()
46
-    {
47
-        return '<?php endif; ?>';
48
-    }
49
-
50
-    /**
51
-     * Compile the if-guest statements into valid PHP.
52
-     *
53
-     * @param  string|null  $guard
54
-     * @return string
55
-     */
56
-    protected function compileGuest($guard = null)
57
-    {
58
-        $guard = is_null($guard) ? '()' : $guard;
59
-
60
-        return "<?php if(auth()->guard{$guard}->guest()): ?>";
61
-    }
62
-
63
-    /**
64
-     * Compile the else-guest statements into valid PHP.
65
-     *
66
-     * @param  string|null  $guard
67
-     * @return string
68
-     */
69
-    protected function compileElseGuest($guard = null)
70
-    {
71
-        $guard = is_null($guard) ? '()' : $guard;
72
-
73
-        return "<?php elseif(auth()->guard{$guard}->guest()): ?>";
74
-    }
75
-
76
-    /**
77
-     * Compile the end-guest statements into valid PHP.
78
-     *
79
-     * @return string
80
-     */
81
-    protected function compileEndGuest()
82
-    {
83
-        return '<?php endif; ?>';
84
-    }
85
-
86
-    /**
87
-     * Compile the has-section statements into valid PHP.
88
-     *
89
-     * @param  string  $expression
90
-     * @return string
91
-     */
92
-    protected function compileHasSection($expression)
93
-    {
94
-        return "<?php if (! empty(trim(\$__env->yieldContent{$expression}))): ?>";
95
-    }
96
-
97
-    /**
98
-     * Compile the if statements into valid PHP.
99
-     *
100
-     * @param  string  $expression
101
-     * @return string
102
-     */
103
-    protected function compileIf($expression)
104
-    {
105
-        return "<?php if{$expression}: ?>";
106
-    }
107
-
108
-    /**
109
-     * Compile the unless statements into valid PHP.
110
-     *
111
-     * @param  string  $expression
112
-     * @return string
113
-     */
114
-    protected function compileUnless($expression)
115
-    {
116
-        return "<?php if (! {$expression}): ?>";
117
-    }
118
-
119
-    /**
120
-     * Compile the else-if statements into valid PHP.
121
-     *
122
-     * @param  string  $expression
123
-     * @return string
124
-     */
125
-    protected function compileElseif($expression)
126
-    {
127
-        return "<?php elseif{$expression}: ?>";
128
-    }
129
-
130
-    /**
131
-     * Compile the else statements into valid PHP.
132
-     *
133
-     * @return string
134
-     */
135
-    protected function compileElse()
136
-    {
137
-        return '<?php else: ?>';
138
-    }
139
-
140
-    /**
141
-     * Compile the end-if statements into valid PHP.
142
-     *
143
-     * @return string
144
-     */
145
-    protected function compileEndif()
146
-    {
147
-        return '<?php endif; ?>';
148
-    }
149
-
150
-    /**
151
-     * Compile the end-unless statements into valid PHP.
152
-     *
153
-     * @return string
154
-     */
155
-    protected function compileEndunless()
156
-    {
157
-        return '<?php endif; ?>';
158
-    }
159
-
160
-    /**
161
-     * Compile the if-isset statements into valid PHP.
162
-     *
163
-     * @param  string  $expression
164
-     * @return string
165
-     */
166
-    protected function compileIsset($expression)
167
-    {
168
-        return "<?php if(isset{$expression}): ?>";
169
-    }
170
-
171
-    /**
172
-     * Compile the end-isset statements into valid PHP.
173
-     *
174
-     * @return string
175
-     */
176
-    protected function compileEndIsset()
177
-    {
178
-        return '<?php endif; ?>';
179
-    }
180
-
181
-    /**
182
-     * Compile the switch statements into valid PHP.
183
-     *
184
-     * @param  string  $expression
185
-     * @return string
186
-     */
187
-    protected function compileSwitch($expression)
188
-    {
189
-        $this->firstCaseInSwitch = true;
190
-
191
-        return "<?php switch{$expression}:";
192
-    }
193
-
194
-    /**
195
-     * Compile the case statements into valid PHP.
196
-     *
197
-     * @param  string  $expression
198
-     * @return string
199
-     */
200
-    protected function compileCase($expression)
201
-    {
202
-        if ($this->firstCaseInSwitch) {
203
-            $this->firstCaseInSwitch = false;
204
-
205
-            return "case {$expression}: ?>";
206
-        }
207
-
208
-        return "<?php case {$expression}: ?>";
209
-    }
210
-
211
-    /**
212
-     * Compile the default statements in switch case into valid PHP.
213
-     *
214
-     * @return string
215
-     */
216
-    protected function compileDefault()
217
-    {
218
-        return '<?php default: ?>';
219
-    }
220
-
221
-    /**
222
-     * Compile the end switch statements into valid PHP.
223
-     *
224
-     * @return string
225
-     */
226
-    protected function compileEndSwitch()
227
-    {
228
-        return '<?php endswitch; ?>';
229
-    }
230
-}
Browse code

initial commit

Emmanuel ROY authored on 09/08/2019 08:39:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,230 @@
1
+<?php
2
+
3
+namespace Illuminate\View\Compilers\Concerns;
4
+
5
+trait CompilesConditionals
6
+{
7
+    /**
8
+     * Identifier for the first case in switch statement.
9
+     *
10
+     * @var bool
11
+     */
12
+    protected $firstCaseInSwitch = true;
13
+
14
+    /**
15
+     * Compile the if-auth statements into valid PHP.
16
+     *
17
+     * @param  string|null  $guard
18
+     * @return string
19
+     */
20
+    protected function compileAuth($guard = null)
21
+    {
22
+        $guard = is_null($guard) ? '()' : $guard;
23
+
24
+        return "<?php if(auth()->guard{$guard}->check()): ?>";
25
+    }
26
+
27
+    /**
28
+     * Compile the else-auth statements into valid PHP.
29
+     *
30
+     * @param  string|null  $guard
31
+     * @return string
32
+     */
33
+    protected function compileElseAuth($guard = null)
34
+    {
35
+        $guard = is_null($guard) ? '()' : $guard;
36
+
37
+        return "<?php elseif(auth()->guard{$guard}->check()): ?>";
38
+    }
39
+
40
+    /**
41
+     * Compile the end-auth statements into valid PHP.
42
+     *
43
+     * @return string
44
+     */
45
+    protected function compileEndAuth()
46
+    {
47
+        return '<?php endif; ?>';
48
+    }
49
+
50
+    /**
51
+     * Compile the if-guest statements into valid PHP.
52
+     *
53
+     * @param  string|null  $guard
54
+     * @return string
55
+     */
56
+    protected function compileGuest($guard = null)
57
+    {
58
+        $guard = is_null($guard) ? '()' : $guard;
59
+
60
+        return "<?php if(auth()->guard{$guard}->guest()): ?>";
61
+    }
62
+
63
+    /**
64
+     * Compile the else-guest statements into valid PHP.
65
+     *
66
+     * @param  string|null  $guard
67
+     * @return string
68
+     */
69
+    protected function compileElseGuest($guard = null)
70
+    {
71
+        $guard = is_null($guard) ? '()' : $guard;
72
+
73
+        return "<?php elseif(auth()->guard{$guard}->guest()): ?>";
74
+    }
75
+
76
+    /**
77
+     * Compile the end-guest statements into valid PHP.
78
+     *
79
+     * @return string
80
+     */
81
+    protected function compileEndGuest()
82
+    {
83
+        return '<?php endif; ?>';
84
+    }
85
+
86
+    /**
87
+     * Compile the has-section statements into valid PHP.
88
+     *
89
+     * @param  string  $expression
90
+     * @return string
91
+     */
92
+    protected function compileHasSection($expression)
93
+    {
94
+        return "<?php if (! empty(trim(\$__env->yieldContent{$expression}))): ?>";
95
+    }
96
+
97
+    /**
98
+     * Compile the if statements into valid PHP.
99
+     *
100
+     * @param  string  $expression
101
+     * @return string
102
+     */
103
+    protected function compileIf($expression)
104
+    {
105
+        return "<?php if{$expression}: ?>";
106
+    }
107
+
108
+    /**
109
+     * Compile the unless statements into valid PHP.
110
+     *
111
+     * @param  string  $expression
112
+     * @return string
113
+     */
114
+    protected function compileUnless($expression)
115
+    {
116
+        return "<?php if (! {$expression}): ?>";
117
+    }
118
+
119
+    /**
120
+     * Compile the else-if statements into valid PHP.
121
+     *
122
+     * @param  string  $expression
123
+     * @return string
124
+     */
125
+    protected function compileElseif($expression)
126
+    {
127
+        return "<?php elseif{$expression}: ?>";
128
+    }
129
+
130
+    /**
131
+     * Compile the else statements into valid PHP.
132
+     *
133
+     * @return string
134
+     */
135
+    protected function compileElse()
136
+    {
137
+        return '<?php else: ?>';
138
+    }
139
+
140
+    /**
141
+     * Compile the end-if statements into valid PHP.
142
+     *
143
+     * @return string
144
+     */
145
+    protected function compileEndif()
146
+    {
147
+        return '<?php endif; ?>';
148
+    }
149
+
150
+    /**
151
+     * Compile the end-unless statements into valid PHP.
152
+     *
153
+     * @return string
154
+     */
155
+    protected function compileEndunless()
156
+    {
157
+        return '<?php endif; ?>';
158
+    }
159
+
160
+    /**
161
+     * Compile the if-isset statements into valid PHP.
162
+     *
163
+     * @param  string  $expression
164
+     * @return string
165
+     */
166
+    protected function compileIsset($expression)
167
+    {
168
+        return "<?php if(isset{$expression}): ?>";
169
+    }
170
+
171
+    /**
172
+     * Compile the end-isset statements into valid PHP.
173
+     *
174
+     * @return string
175
+     */
176
+    protected function compileEndIsset()
177
+    {
178
+        return '<?php endif; ?>';
179
+    }
180
+
181
+    /**
182
+     * Compile the switch statements into valid PHP.
183
+     *
184
+     * @param  string  $expression
185
+     * @return string
186
+     */
187
+    protected function compileSwitch($expression)
188
+    {
189
+        $this->firstCaseInSwitch = true;
190
+
191
+        return "<?php switch{$expression}:";
192
+    }
193
+
194
+    /**
195
+     * Compile the case statements into valid PHP.
196
+     *
197
+     * @param  string  $expression
198
+     * @return string
199
+     */
200
+    protected function compileCase($expression)
201
+    {
202
+        if ($this->firstCaseInSwitch) {
203
+            $this->firstCaseInSwitch = false;
204
+
205
+            return "case {$expression}: ?>";
206
+        }
207
+
208
+        return "<?php case {$expression}: ?>";
209
+    }
210
+
211
+    /**
212
+     * Compile the default statements in switch case into valid PHP.
213
+     *
214
+     * @return string
215
+     */
216
+    protected function compileDefault()
217
+    {
218
+        return '<?php default: ?>';
219
+    }
220
+
221
+    /**
222
+     * Compile the end switch statements into valid PHP.
223
+     *
224
+     * @return string
225
+     */
226
+    protected function compileEndSwitch()
227
+    {
228
+        return '<?php endswitch; ?>';
229
+    }
230
+}