public function ScanResultController::analyze in Upgrade Status 8.2
Same name and namespace in other branches
- 8.3 src/Controller/ScanResultController.php \Drupal\upgrade_status\Controller\ScanResultController::analyze()
Analyze a specific project in its own HTTP request.
Parameters
string $type: Type of the extension, it can be either 'module' or 'theme' or 'profile'.
string $project_machine_name: The machine name of the project.
Return value
\Symfony\Component\HttpFoundation\JsonResponse Response object.
1 string reference to 'ScanResultController::analyze'
File
- src/
Controller/ ScanResultController.php, line 133
Class
Namespace
Drupal\upgrade_status\ControllerCode
public function analyze(string $type, string $project_machine_name) {
if ($type == 'upgrade_status_request_test' && $project_machine_name == 'upgrade_status_request_test') {
// Handle the special case of a request test which is testing the
// HTTP sandboxing capability.
return new JsonResponse([
'message' => 'Request test success',
]);
}
else {
// Dealing with a real project.
$extension = $this->projectCollector
->loadProject($type, $project_machine_name);
\Drupal::service('upgrade_status.deprecation_analyzer')
->analyze($extension);
return new JsonResponse([
'message' => $this
->t('Scanned @project', [
'@project' => $extension
->getName(),
]),
]);
}
}