1 | <?php |
||
2 | |||
3 | namespace Dynamic\Foxy\Integrations\Extension; |
||
4 | |||
5 | use Dynamic\Foxy\Model\Setting; |
||
6 | use GuzzleHttp\Client; |
||
0 ignored issues
–
show
|
|||
7 | use Psr\Log\LoggerInterface; |
||
8 | use SilverStripe\Core\Injector\Injector; |
||
9 | use SilverStripe\Core\Extension; |
||
10 | |||
11 | class FoxyIntegrationsExtension extends Extension |
||
12 | { |
||
13 | /** |
||
14 | * @param $FoxyData |
||
15 | * @throws \SilverStripe\ORM\ValidationException |
||
16 | */ |
||
17 | public function addIntegrations(&$encryptedData) |
||
18 | { |
||
19 | $config = Setting::current_foxy_setting(); |
||
20 | |||
21 | if (!$config->Integrations()->exists()) { |
||
22 | Injector::inst()->get(LoggerInterface::class)->debug("No integrations at this time."); |
||
23 | } |
||
24 | |||
25 | foreach ($config->Integrations() as $integration) { |
||
26 | // relay Datafeed to each Integration via guzzle |
||
27 | $client = new Client(); |
||
28 | $response = $client->request('POST', $integration->URL, [ |
||
29 | 'form_params' => ['FoxyData' => $encryptedData], |
||
30 | ]); |
||
31 | |||
32 | if ($response->getBody() != 'foxy') { |
||
33 | echo '<p>' . $integration->Title . ' failed</p>'; |
||
34 | } |
||
35 | |||
36 | Injector::inst()->get(LoggerInterface::class) |
||
37 | ->debug($integration->Title . " responded " . $response->getBody()); |
||
38 | } |
||
39 | } |
||
40 | } |
||
41 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths