These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the bootstrap-bundle package. |
||
5 | * |
||
6 | * (c) 2018 WEBEWEB |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace WBW\Bundle\BootstrapBundle\Twig\Extension\CSS; |
||
13 | |||
14 | use Twig_SimpleFunction; |
||
15 | use WBW\Library\Core\Argument\ArrayHelper; |
||
16 | |||
17 | /** |
||
18 | * Code Twig extension. |
||
19 | * |
||
20 | * @author webeweb <https://github.com/webeweb/> |
||
21 | * @package WBW\Bundle\BootstrapBundle\Twig\Extension\CSS |
||
22 | * @link https://getbootstrap.com/docs/3.3/css/#code |
||
23 | */ |
||
24 | class CodeTwigExtension extends AbstractCodeTwigExtension { |
||
25 | |||
26 | /** |
||
27 | * Service name. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | const SERVICE_NAME = "webeweb.bootstrap.twig.extension.css.code"; |
||
32 | |||
33 | /** |
||
34 | * Displays a Bootstrap basic block. |
||
35 | * |
||
36 | * @param array $args The arguments. |
||
37 | * @return string Returns the Bootstrap basic block. |
||
38 | */ |
||
39 | public function bootstrapBasicBlockFunction(array $args = []) { |
||
40 | return $this->bootstrapBasicBlock(ArrayHelper::get($args, "content")); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Displays a Bootstrap inline. |
||
45 | * |
||
46 | * @param array $args The arguments. |
||
47 | * @return string Returns the Bootstrap inline. |
||
48 | */ |
||
49 | public function bootstrapInlineFunction(array $args = []) { |
||
50 | return $this->bootstrapInline(ArrayHelper::get($args, "content")); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * Displays a Bootstrap sample output. |
||
55 | * |
||
56 | * @param array $args The arguments. |
||
57 | * @return string Returns the Bootstrap smaple output. |
||
58 | */ |
||
59 | public function bootstrapSampleOutputFunction(array $args = []) { |
||
60 | return $this->bootstrapSampleOutput(ArrayHelper::get($args, "content")); |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Displays a Bootstrap user input. |
||
65 | * |
||
66 | * @param array $args The arguments. |
||
67 | * @return string Returns the Bootstrap user input. |
||
68 | */ |
||
69 | public function bootstrapUserInputFunction(array $args = []) { |
||
70 | return $this->bootstrapUserInput(ArrayHelper::get($args, "content")); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * Displays a Bootstrap variable. |
||
75 | * |
||
76 | * @param array $args The arguments. |
||
77 | * @return string Returns the Bootstrap variable. |
||
78 | */ |
||
79 | public function bootstrapVariableFunction(array $args = []) { |
||
80 | return $this->bootstrapVariable(ArrayHelper::get($args, "content")); |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * Get the Twig functions. |
||
85 | * |
||
86 | * @return array Returns the Twig functions. |
||
87 | */ |
||
88 | public function getFunctions() { |
||
89 | return [ |
||
90 | new Twig_SimpleFunction("bootstrapBasicBlock", [$this, "bootstrapBasicBlockFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
|
|||
91 | new Twig_SimpleFunction("bsBasicBlock", [$this, "bootstrapBasicBlockFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
92 | |||
93 | new Twig_SimpleFunction("bootstrapInline", [$this, "bootstrapInlineFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
94 | new Twig_SimpleFunction("bsInline", [$this, "bootstrapInlineFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
95 | |||
96 | new Twig_SimpleFunction("bootstrapSampleOutput", [$this, "bootstrapSampleOutputFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
97 | new Twig_SimpleFunction("bsSampleOutput", [$this, "bootstrapSampleOutputFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
98 | |||
99 | new Twig_SimpleFunction("bootstrapUserInput", [$this, "bootstrapUserInputFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
100 | new Twig_SimpleFunction("bsUserInput", [$this, "bootstrapUserInputFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
101 | |||
102 | new Twig_SimpleFunction("bootstrapVariable", [$this, "bootstrapVariableFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
103 | new Twig_SimpleFunction("bsVariable", [$this, "bootstrapVariableFunction"], ["is_safe" => ["html"]]), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead. ![]() |
|||
104 | ]; |
||
105 | } |
||
106 | } |
||
107 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.