Dm
Я го не знаю, но DI есть же в любом ооп языке
Size: a a a
Dm
D
m
ПК
ЕЧ
m
m
ВШ
ВШ
m
AY
private static
$url;
private static
$headers;
private static
$query;
private static
$response;
public static function initialization($url, $headers, $query)
{
self::
$url = $url;
self::
$headers = $headers;
self::
$query = $query;
}
public static function curlExec()
{
$options = [
CURLOPT_URL => self::
$url,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => self::
$headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => self::
$query,
];
$ch = curl_init();
curl_setopt_array($ch, $options);
self::
$response = curl_exec($ch);
curl_close($ch);
self::
$response = json_decode(self::
$response);
return self::
$response;
}
D
D
D
AY
D
D
ПЛ