28 lines
861 B
PHP
28 lines
861 B
PHP
<?php
|
|
|
|
namespace KupShop\GraphQLBundle\Inspections\Compile;
|
|
|
|
use KupShop\SystemInspectionBundle\Inspections\Compile\CompileInspectionInterface;
|
|
use KupShop\SystemInspectionBundle\Inspections\Inspection;
|
|
use KupShop\SystemInspectionBundle\InspectionWriters\MessageTypes\SimpleMessage;
|
|
|
|
class GraphQLInspection extends Inspection implements CompileInspectionInterface
|
|
{
|
|
public function runInspection(): ?array
|
|
{
|
|
$errors = [];
|
|
|
|
$composer = json_decode(file_get_contents('composer.json'));
|
|
|
|
if (!isset($composer->autoload->{'psr-4'}->{'KupShop\\'})) {
|
|
$errors[] = new SimpleMessage('Upravte v composer.json hodnotu "autoload.psr-4" na:
|
|
"psr-4": {
|
|
"Shop\\\\": ["bundles"],
|
|
"KupShop\\\\": ["../engine/bundles/KupShop"]
|
|
}');
|
|
}
|
|
|
|
return $errors;
|
|
}
|
|
}
|