FOSSology  4.4.0
Open Source License Compliance by Open Source Software
BadRequestController.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2018 Siemens AG
4  Author: Gaurav Mishra <mishra.gaurav@siemens.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
13 namespace Fossology\UI\Api\Controllers;
14 
18 use Psr\Http\Message\ServerRequestInterface;
19 
25 {
26 
35  public function __invoke($request, $response, $args)
36  {
37  $id = $args['params'];
38  $returnVal = new Info(404, "Unable to find the path '$id'.",
39  InfoType::ERROR);
40  return $response->withJson($returnVal->getArray(), $returnVal->getCode());
41  }
42 }
Base controller for REST calls.
Override Slim response for withJson function.
Different type of infos provided by REST.
Definition: InfoType.php:16
Info model to contain general error and return values.
Definition: Info.php:19