This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /* |
||
3 | * This file is part of Yolk - Gamer Network's PHP Framework. |
||
4 | * |
||
5 | * Copyright (c) 2015 Gamer Network Ltd. |
||
6 | * |
||
7 | * Distributed under the MIT License, a copy of which is available in the |
||
8 | * LICENSE file that was bundled with this package, or online at: |
||
9 | * https://github.com/gamernetwork/yolk-support |
||
10 | */ |
||
11 | |||
12 | namespace yolk\support; |
||
13 | |||
14 | class TwigExtension extends \Twig_Extension { |
||
15 | |||
16 | public function getName() { |
||
17 | return 'Yolk Twig Extension'; |
||
18 | } |
||
19 | |||
20 | public function getTests() { |
||
21 | return [ |
||
22 | new \Twig_SimpleTest('numeric', function( $value ) { |
||
0 ignored issues
–
show
|
|||
23 | return is_numeric($value); |
||
24 | }), |
||
25 | new \Twig_SimpleTest('integer', function( $value ) { |
||
0 ignored issues
–
show
The class
Twig_SimpleTest has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
26 | return is_numeric($value) && ($value == (int) $value); |
||
27 | }), |
||
28 | new \Twig_SimpleTest('string', function( $value ) { |
||
0 ignored issues
–
show
The class
Twig_SimpleTest has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
29 | return is_string($value); |
||
30 | }), |
||
31 | new \Twig_SimpleTest('array', function( $value ) { |
||
0 ignored issues
–
show
The class
Twig_SimpleTest has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
32 | return is_array($value); |
||
33 | }), |
||
34 | new \Twig_SimpleTest('object', function( $value, $class = '' ) { |
||
0 ignored issues
–
show
The class
Twig_SimpleTest has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
35 | $result = is_object($value); |
||
36 | if( $class ) |
||
37 | $result = $result && ($value instanceof $class); |
||
38 | return $result; |
||
39 | }), |
||
40 | ]; |
||
41 | } |
||
42 | |||
43 | public function getFilters() { |
||
44 | |||
45 | $filters = [ |
||
46 | new \Twig_SimpleFilter('md5', 'md5'), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
47 | new \Twig_SimpleFilter('sha1', 'sha1'), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
48 | new \Twig_SimpleFilter('truncate', function( $str, $length, $replace = '...' ) { |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
49 | if( isset($str) ) |
||
50 | return strlen($str) <= $length ? $str : substr($str, 0, $length - strip_tags($replace)) . $replace; |
||
51 | return null; |
||
52 | }), |
||
53 | new \Twig_SimpleFilter('sum', 'array_sum'), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
54 | new \Twig_SimpleFilter('shuffle', 'shuffle'), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
55 | ]; |
||
56 | |||
57 | // include some helpful shit from yolk-core/StringHelper if we have it available |
||
58 | if( class_exists ('\\yolk\\helpers\\StringHelper') ) { |
||
59 | $filters = array_merge( |
||
60 | $filters, |
||
61 | [ |
||
62 | new \Twig_SimpleFilter('slugify', ['\\yolk\\helpers\\StringHelper', 'slugify']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
63 | new \Twig_SimpleFilter('uncamelise', ['\\yolk\\helpers\\StringHelper', 'uncamelise']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
64 | new \Twig_SimpleFilter('removeAccents', ['\\yolk\\helpers\\StringHelper', 'removeAccents']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
65 | new \Twig_SimpleFilter('ordinal', ['\\yolk\\helpers\\StringHelper', 'ordinal']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
66 | new \Twig_SimpleFilter('sizeFormat', ['\\yolk\\helpers\\StringHelper', 'sizeFormat']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
67 | new \Twig_SimpleFilter('stripControlChars', ['\\yolk\\helpers\\StringHelper', 'stripControlChars']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
68 | new \Twig_SimpleFilter('normaliseLineEndings', ['\\yolk\\helpers\\StringHelper', 'normaliseLineEndings']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
69 | ] |
||
70 | ); |
||
71 | } |
||
72 | |||
73 | // more helpful shit from yolk-core/Inflector if we have it available |
||
74 | if( class_exists ('\\yolk\\helpers\\Inflector') ) { |
||
75 | $filters = array_merge( |
||
76 | $filters, |
||
77 | [ |
||
78 | new \Twig_SimpleFilter('pluralise', ['\\yolk\\helpers\\Inflector', 'pluralise']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
79 | new \Twig_SimpleFilter('singularise', ['\\yolk\\helpers\\Inflector', 'singularise']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFilter has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
80 | ] |
||
81 | ); |
||
82 | } |
||
83 | |||
84 | return $filters; |
||
85 | |||
86 | } |
||
87 | |||
88 | public function getFunctions() { |
||
89 | |||
90 | $functions = [ |
||
91 | new \Twig_SimpleFunction('ceil', 'ceil'), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: to be removed in 3.0
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 | new \Twig_SimpleFunction('floor', 'floor'), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
93 | ]; |
||
94 | |||
95 | // include some helpful shit from yolk-core/StringHelper if we have it available |
||
96 | if( class_exists ('\\yolk\\helpers\\StringHelper') ) { |
||
97 | $functions = array_merge( |
||
98 | $functions, |
||
99 | [ |
||
100 | new \Twig_SimpleFunction('randomHex', ['\\yolk\\helpers\\StringHelper', 'randomHex']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: to be removed in 3.0
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 | new \Twig_SimpleFunction('randomString', ['\\yolk\\helpers\\StringHelper', 'randomString']), |
||
0 ignored issues
–
show
The class
Twig_SimpleFunction has been deprecated with message: to be removed in 3.0
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. ![]() |
|||
102 | ] |
||
103 | ); |
||
104 | } |
||
105 | |||
106 | return $functions; |
||
107 | |||
108 | } |
||
109 | |||
110 | } |
||
111 | |||
112 | // EOF |
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.