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 | * @link https://github.com/old-town/old-town-workflow |
||
4 | * @author Malofeykin Andrey <[email protected]> |
||
5 | */ |
||
6 | namespace OldTown\Workflow\PhpUnit\Test; |
||
7 | |||
8 | /** |
||
9 | * Class Paths |
||
10 | * |
||
11 | * @package OldTown\Workflow\PhpUnit\Test |
||
12 | */ |
||
13 | class Paths |
||
14 | { |
||
15 | /** |
||
16 | * Путь до директории с данными для тестов |
||
17 | * |
||
18 | * @var string|null |
||
19 | */ |
||
20 | protected static $pathToDataDir; |
||
21 | |||
22 | /** |
||
23 | * Путь до временной директории, куда могу записывать свои файлы тесты |
||
24 | * |
||
25 | * @var string|null |
||
26 | */ |
||
27 | protected static $pathToTestDataDir; |
||
28 | |||
29 | /** |
||
30 | * Ресурсы используемые разными тестами |
||
31 | * |
||
32 | * @var string|null |
||
33 | */ |
||
34 | protected static $pathToCommonDataDir; |
||
35 | |||
36 | /** |
||
37 | * Корректный конфиг workflow+некорректный файл самого workflow |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected static $pathToInvalidWorkflowDir; |
||
42 | |||
43 | /** |
||
44 | * Каталог с примерами некорректных файлов конфига workflow |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected static $pathToInvalidWorkflowConfig; |
||
49 | |||
50 | /** |
||
51 | * Директория содержит файлы используемые для тестирования сохранения workflow |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected static $pathToSaveWorkflowDir; |
||
56 | |||
57 | /** |
||
58 | * Путь до каталого содержащего тестовые данные для тестирования наборы утилитарного функционала для разбора xml |
||
59 | * |
||
60 | * @var string |
||
61 | */ |
||
62 | protected static $xmlUtilTest; |
||
63 | |||
64 | /** |
||
65 | * Возвращает путь до каталого содержащего тестовые данные для тестирования наборы утилитарного функционала для разбора xml |
||
66 | * |
||
67 | * @return string |
||
68 | */ |
||
69 | public static function getXmlUtilTest() |
||
70 | { |
||
71 | if (static::$xmlUtilTest) { |
||
72 | return static::$xmlUtilTest; |
||
73 | } |
||
74 | |||
75 | static::$xmlUtilTest = __DIR__ . '/_files/xml-util'; |
||
76 | |||
77 | return static::$xmlUtilTest; |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * Возвращает путь до директории с данными для тестов |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public static function getPathToSaveWorkflowDir() |
||
86 | { |
||
87 | if (static::$pathToSaveWorkflowDir) { |
||
88 | return static::$pathToSaveWorkflowDir; |
||
89 | } |
||
90 | |||
91 | static::$pathToSaveWorkflowDir = __DIR__ . '/_files/save-workflow'; |
||
92 | |||
93 | return static::$pathToSaveWorkflowDir; |
||
94 | } |
||
95 | |||
96 | /** |
||
97 | * Возвращает путь до директории с данными для тестов |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | public static function getPathToDataDir() |
||
102 | { |
||
103 | if (static::$pathToDataDir) { |
||
0 ignored issues
–
show
|
|||
104 | return static::$pathToDataDir; |
||
105 | } |
||
106 | |||
107 | static::$pathToDataDir = __DIR__ . '/_files'; |
||
108 | |||
109 | return static::$pathToDataDir; |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * Возвращает путь до директории с данными для тестов |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | public static function getPathToCommonDataDir() |
||
118 | { |
||
119 | if (static::$pathToCommonDataDir) { |
||
0 ignored issues
–
show
The expression
static::$pathToCommonDataDir of type string|null is loosely compared to true ; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like For '' == false // true
'' == null // true
'ab' == false // false
'ab' == null // false
// It is often better to use strict comparison
'' === false // false
'' === null // false
![]() |
|||
120 | return static::$pathToCommonDataDir; |
||
121 | } |
||
122 | |||
123 | static::$pathToCommonDataDir = __DIR__ . '/_files/common'; |
||
124 | |||
125 | return static::$pathToCommonDataDir; |
||
126 | } |
||
127 | |||
128 | |||
129 | /** |
||
130 | * Возвращает путь до каталога с примерами некорректных файлов конфига workflow |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | public static function getPathToInvalidWorkflowConfig() |
||
135 | { |
||
136 | if (static::$pathToInvalidWorkflowConfig) { |
||
137 | return static::$pathToInvalidWorkflowConfig; |
||
138 | } |
||
139 | |||
140 | static::$pathToInvalidWorkflowConfig = __DIR__ . '/_files/invalid-workflow-config'; |
||
141 | |||
142 | return static::$pathToInvalidWorkflowConfig; |
||
143 | } |
||
144 | |||
145 | /** |
||
146 | * Возвращает путь до директории содержащий корректный конфиг workflow+некорректный файл самого workflow |
||
147 | * |
||
148 | * @return string |
||
149 | */ |
||
150 | public static function getPathToInvalidWorkflowDir() |
||
151 | { |
||
152 | if (static::$pathToInvalidWorkflowDir) { |
||
153 | return static::$pathToInvalidWorkflowDir; |
||
154 | } |
||
155 | |||
156 | static::$pathToInvalidWorkflowDir = __DIR__ . '/_files/invalid-workflow'; |
||
157 | |||
158 | return static::$pathToInvalidWorkflowDir; |
||
159 | } |
||
160 | |||
161 | /** |
||
162 | * Возвращает путь до директории с данными для тестов |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | public static function getPathToTestDataDir() |
||
167 | { |
||
168 | if (static::$pathToTestDataDir) { |
||
0 ignored issues
–
show
The expression
static::$pathToTestDataDir of type string|null is loosely compared to true ; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.
In PHP, under loose comparison (like For '' == false // true
'' == null // true
'ab' == false // false
'ab' == null // false
// It is often better to use strict comparison
'' === false // false
'' === null // false
![]() |
|||
169 | return static::$pathToTestDataDir; |
||
170 | } |
||
171 | |||
172 | static::$pathToTestDataDir = __DIR__ . '/../../data/test'; |
||
173 | |||
174 | return static::$pathToTestDataDir; |
||
175 | } |
||
176 | } |
||
177 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: