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,161 +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\Twig;
10
-
11
-/**
12
- * The GlobalContainer class.
13
- *
14
- * @since  2.0
15
- */
16
-abstract class GlobalContainer
17
-{
18
-    /**
19
-     * Property extensions.
20
-     *
21
-     * @var  \Twig_ExtensionInterface[]
22
-     */
23
-    protected static $extensions = [];
24
-
25
-    /**
26
-     * Property data.
27
-     *
28
-     * @var  array
29
-     */
30
-    protected static $globals = [];
31
-
32
-    /**
33
-     * addExtension
34
-     *
35
-     * @param string                   $name
36
-     * @param \Twig_ExtensionInterface $extension
37
-     *
38
-     * @return  void
39
-     */
40
-    public static function addExtension($name, \Twig_ExtensionInterface $extension)
41
-    {
42
-        static::$extensions[$name] = $extension;
43
-    }
44
-
45
-    /**
46
-     * getExtension
47
-     *
48
-     * @param   string $name
49
-     *
50
-     * @return  \Twig_ExtensionInterface
51
-     */
52
-    public static function getExtension($name)
53
-    {
54
-        if (!empty(static::$extensions[$name])) {
55
-            return static::$extensions[$name];
56
-        }
57
-
58
-        return null;
59
-    }
60
-
61
-    /**
62
-     * removeExtension
63
-     *
64
-     * @param string $name
65
-     *
66
-     * @return  void
67
-     */
68
-    public static function removeExtension($name)
69
-    {
70
-        if (isset(static::$extensions[$name])) {
71
-            unset(static::$extensions[$name]);
72
-        }
73
-    }
74
-
75
-    /**
76
-     * Method to get property Extensions
77
-     *
78
-     * @return  \Twig_ExtensionInterface[]
79
-     */
80
-    public static function getExtensions()
81
-    {
82
-        return static::$extensions;
83
-    }
84
-
85
-    /**
86
-     * Method to set property extensions
87
-     *
88
-     * @param   \Twig_ExtensionInterface[] $extensions
89
-     *
90
-     * @return  void
91
-     */
92
-    public static function setExtensions(array $extensions)
93
-    {
94
-        static::$extensions = $extensions;
95
-    }
96
-
97
-    /**
98
-     * setGlobal
99
-     *
100
-     * @param string $name
101
-     * @param mixed  $value
102
-     *
103
-     * @return  void
104
-     */
105
-    public static function addGlobal($name, $value)
106
-    {
107
-        static::$globals[$name] = $value;
108
-    }
109
-
110
-    /**
111
-     * getGlobal
112
-     *
113
-     * @param string $name
114
-     *
115
-     * @return  mixed
116
-     */
117
-    public static function getGlobal($name)
118
-    {
119
-        if (array_key_exists($name, static::$globals)) {
120
-            return static::$globals[$name];
121
-        }
122
-
123
-        return null;
124
-    }
125
-
126
-    /**
127
-     * removeGlobal
128
-     *
129
-     * @param   string $name
130
-     *
131
-     * @return  void
132
-     */
133
-    public static function removeGlobal($name)
134
-    {
135
-        if (isset(static::$globals[$name])) {
136
-            unset(static::$globals[$name]);
137
-        }
138
-    }
139
-
140
-    /**
141
-     * Method to get property Globals
142
-     *
143
-     * @return  array
144
-     */
145
-    public static function getGlobals()
146
-    {
147
-        return static::$globals;
148
-    }
149
-
150
-    /**
151
-     * Method to set property globals
152
-     *
153
-     * @param   array $globals
154
-     *
155
-     * @return  void
156
-     */
157
-    public static function setGlobals(array $globals)
158
-    {
159
-        static::$globals = $globals;
160
-    }
161
-}
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,161 @@
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\Twig;
10
+
11
+/**
12
+ * The GlobalContainer class.
13
+ *
14
+ * @since  2.0
15
+ */
16
+abstract class GlobalContainer
17
+{
18
+    /**
19
+     * Property extensions.
20
+     *
21
+     * @var  \Twig_ExtensionInterface[]
22
+     */
23
+    protected static $extensions = [];
24
+
25
+    /**
26
+     * Property data.
27
+     *
28
+     * @var  array
29
+     */
30
+    protected static $globals = [];
31
+
32
+    /**
33
+     * addExtension
34
+     *
35
+     * @param string                   $name
36
+     * @param \Twig_ExtensionInterface $extension
37
+     *
38
+     * @return  void
39
+     */
40
+    public static function addExtension($name, \Twig_ExtensionInterface $extension)
41
+    {
42
+        static::$extensions[$name] = $extension;
43
+    }
44
+
45
+    /**
46
+     * getExtension
47
+     *
48
+     * @param   string $name
49
+     *
50
+     * @return  \Twig_ExtensionInterface
51
+     */
52
+    public static function getExtension($name)
53
+    {
54
+        if (!empty(static::$extensions[$name])) {
55
+            return static::$extensions[$name];
56
+        }
57
+
58
+        return null;
59
+    }
60
+
61
+    /**
62
+     * removeExtension
63
+     *
64
+     * @param string $name
65
+     *
66
+     * @return  void
67
+     */
68
+    public static function removeExtension($name)
69
+    {
70
+        if (isset(static::$extensions[$name])) {
71
+            unset(static::$extensions[$name]);
72
+        }
73
+    }
74
+
75
+    /**
76
+     * Method to get property Extensions
77
+     *
78
+     * @return  \Twig_ExtensionInterface[]
79
+     */
80
+    public static function getExtensions()
81
+    {
82
+        return static::$extensions;
83
+    }
84
+
85
+    /**
86
+     * Method to set property extensions
87
+     *
88
+     * @param   \Twig_ExtensionInterface[] $extensions
89
+     *
90
+     * @return  void
91
+     */
92
+    public static function setExtensions(array $extensions)
93
+    {
94
+        static::$extensions = $extensions;
95
+    }
96
+
97
+    /**
98
+     * setGlobal
99
+     *
100
+     * @param string $name
101
+     * @param mixed  $value
102
+     *
103
+     * @return  void
104
+     */
105
+    public static function addGlobal($name, $value)
106
+    {
107
+        static::$globals[$name] = $value;
108
+    }
109
+
110
+    /**
111
+     * getGlobal
112
+     *
113
+     * @param string $name
114
+     *
115
+     * @return  mixed
116
+     */
117
+    public static function getGlobal($name)
118
+    {
119
+        if (array_key_exists($name, static::$globals)) {
120
+            return static::$globals[$name];
121
+        }
122
+
123
+        return null;
124
+    }
125
+
126
+    /**
127
+     * removeGlobal
128
+     *
129
+     * @param   string $name
130
+     *
131
+     * @return  void
132
+     */
133
+    public static function removeGlobal($name)
134
+    {
135
+        if (isset(static::$globals[$name])) {
136
+            unset(static::$globals[$name]);
137
+        }
138
+    }
139
+
140
+    /**
141
+     * Method to get property Globals
142
+     *
143
+     * @return  array
144
+     */
145
+    public static function getGlobals()
146
+    {
147
+        return static::$globals;
148
+    }
149
+
150
+    /**
151
+     * Method to set property globals
152
+     *
153
+     * @param   array $globals
154
+     *
155
+     * @return  void
156
+     */
157
+    public static function setGlobals(array $globals)
158
+    {
159
+        static::$globals = $globals;
160
+    }
161
+}