1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,83 +0,0 @@ |
1 |
-<?php declare(strict_types=1); |
|
2 |
-/** |
|
3 |
- * Part of Windwalker project. |
|
4 |
- * |
|
5 |
- * @copyright Copyright (C) 2019 LYRASOFT. |
|
6 |
- * @license LGPL-2.0-or-later |
|
7 |
- */ |
|
8 |
- |
|
9 |
-namespace Windwalker\Renderer\Test\Stub; |
|
10 |
- |
|
11 |
-/** |
|
12 |
- * The StubTwigExtension class. |
|
13 |
- * |
|
14 |
- * @since 2.0 |
|
15 |
- */ |
|
16 |
-class StubTwigExtension extends \Twig_Extension |
|
17 |
-{ |
|
18 |
- /** |
|
19 |
- * Returns the name of the extension. |
|
20 |
- * |
|
21 |
- * @return string The extension name |
|
22 |
- */ |
|
23 |
- public function getName() |
|
24 |
- { |
|
25 |
- return 'stub'; |
|
26 |
- } |
|
27 |
- |
|
28 |
- /** |
|
29 |
- * Returns a list of filters to add to the existing list. |
|
30 |
- * |
|
31 |
- * @return array An array of filters |
|
32 |
- */ |
|
33 |
- public function getFilters() |
|
34 |
- { |
|
35 |
- return [ |
|
36 |
- new \Twig_SimpleFilter('armor', [$this, 'armor']), |
|
37 |
- ]; |
|
38 |
- } |
|
39 |
- |
|
40 |
- /** |
|
41 |
- * Returns a list of functions to add to the existing list. |
|
42 |
- * |
|
43 |
- * @return array An array of functions |
|
44 |
- */ |
|
45 |
- public function getFunctions() |
|
46 |
- { |
|
47 |
- return [ |
|
48 |
- new \Twig_SimpleFunction('flower', [$this, 'flower']), |
|
49 |
- ]; |
|
50 |
- } |
|
51 |
- |
|
52 |
- /** |
|
53 |
- * Returns a list of global variables to add to the existing list. |
|
54 |
- * |
|
55 |
- * @return array An array of global variables |
|
56 |
- */ |
|
57 |
- public function getGlobals() |
|
58 |
- { |
|
59 |
- return [ |
|
60 |
- 'olive' => 'peace', |
|
61 |
- ]; |
|
62 |
- } |
|
63 |
- |
|
64 |
- /** |
|
65 |
- * flower |
|
66 |
- * |
|
67 |
- * @return string |
|
68 |
- */ |
|
69 |
- public function flower() |
|
70 |
- { |
|
71 |
- return 'sakura'; |
|
72 |
- } |
|
73 |
- |
|
74 |
- /** |
|
75 |
- * armor |
|
76 |
- * |
|
77 |
- * @return string |
|
78 |
- */ |
|
79 |
- public function armor() |
|
80 |
- { |
|
81 |
- return 'Iron Man'; |
|
82 |
- } |
|
83 |
-} |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,83 @@ |
1 |
+<?php declare(strict_types=1); |
|
2 |
+/** |
|
3 |
+ * Part of Windwalker project. |
|
4 |
+ * |
|
5 |
+ * @copyright Copyright (C) 2019 LYRASOFT. |
|
6 |
+ * @license LGPL-2.0-or-later |
|
7 |
+ */ |
|
8 |
+ |
|
9 |
+namespace Windwalker\Renderer\Test\Stub; |
|
10 |
+ |
|
11 |
+/** |
|
12 |
+ * The StubTwigExtension class. |
|
13 |
+ * |
|
14 |
+ * @since 2.0 |
|
15 |
+ */ |
|
16 |
+class StubTwigExtension extends \Twig_Extension |
|
17 |
+{ |
|
18 |
+ /** |
|
19 |
+ * Returns the name of the extension. |
|
20 |
+ * |
|
21 |
+ * @return string The extension name |
|
22 |
+ */ |
|
23 |
+ public function getName() |
|
24 |
+ { |
|
25 |
+ return 'stub'; |
|
26 |
+ } |
|
27 |
+ |
|
28 |
+ /** |
|
29 |
+ * Returns a list of filters to add to the existing list. |
|
30 |
+ * |
|
31 |
+ * @return array An array of filters |
|
32 |
+ */ |
|
33 |
+ public function getFilters() |
|
34 |
+ { |
|
35 |
+ return [ |
|
36 |
+ new \Twig_SimpleFilter('armor', [$this, 'armor']), |
|
37 |
+ ]; |
|
38 |
+ } |
|
39 |
+ |
|
40 |
+ /** |
|
41 |
+ * Returns a list of functions to add to the existing list. |
|
42 |
+ * |
|
43 |
+ * @return array An array of functions |
|
44 |
+ */ |
|
45 |
+ public function getFunctions() |
|
46 |
+ { |
|
47 |
+ return [ |
|
48 |
+ new \Twig_SimpleFunction('flower', [$this, 'flower']), |
|
49 |
+ ]; |
|
50 |
+ } |
|
51 |
+ |
|
52 |
+ /** |
|
53 |
+ * Returns a list of global variables to add to the existing list. |
|
54 |
+ * |
|
55 |
+ * @return array An array of global variables |
|
56 |
+ */ |
|
57 |
+ public function getGlobals() |
|
58 |
+ { |
|
59 |
+ return [ |
|
60 |
+ 'olive' => 'peace', |
|
61 |
+ ]; |
|
62 |
+ } |
|
63 |
+ |
|
64 |
+ /** |
|
65 |
+ * flower |
|
66 |
+ * |
|
67 |
+ * @return string |
|
68 |
+ */ |
|
69 |
+ public function flower() |
|
70 |
+ { |
|
71 |
+ return 'sakura'; |
|
72 |
+ } |
|
73 |
+ |
|
74 |
+ /** |
|
75 |
+ * armor |
|
76 |
+ * |
|
77 |
+ * @return string |
|
78 |
+ */ |
|
79 |
+ public function armor() |
|
80 |
+ { |
|
81 |
+ return 'Iron Man'; |
|
82 |
+ } |
|
83 |
+} |