simplesamlphp /
simplesamlphp-module-examplecomposer
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace SimpleSAML\Module\examplecomposer\Controller; |
||
| 6 | |||
| 7 | use SimpleSAML\Configuration; |
||
| 8 | use SimpleSAML\Session; |
||
| 9 | use Symfony\Component\HttpFoundation\Request; |
||
| 10 | use Symfony\Component\HttpFoundation\Response; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Controller class for the examplecomposer module. |
||
| 14 | * |
||
| 15 | * This class serves the different views available in the module. |
||
| 16 | * |
||
| 17 | * @package simplesamlphp/simplesamlphp-module-examplecomposer |
||
| 18 | */ |
||
| 19 | class ExampleController |
||
| 20 | { |
||
| 21 | /** @var \SimpleSAML\Configuration */ |
||
| 22 | protected Configuration $config; |
||
| 23 | |||
| 24 | /** @var \SimpleSAML\Session */ |
||
| 25 | protected Session $session; |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * Controller constructor. |
||
| 30 | * |
||
| 31 | * It initializes the global configuration and session for the controllers implemented here. |
||
| 32 | * |
||
| 33 | * @param \SimpleSAML\Configuration $config The configuration to use by the controllers. |
||
| 34 | * @param \SimpleSAML\Session $session The session to use by the controllers. |
||
| 35 | * |
||
| 36 | * @throws \Exception |
||
| 37 | */ |
||
| 38 | public function __construct( |
||
| 39 | Configuration $config, |
||
| 40 | Session $session, |
||
| 41 | ) { |
||
| 42 | $this->config = $config; |
||
| 43 | $this->session = $session; |
||
| 44 | } |
||
| 45 | |||
| 46 | |||
| 47 | /** |
||
| 48 | * Say hello to the world |
||
| 49 | * |
||
| 50 | * @param \Symfony\Component\HttpFoundation\Request $request |
||
| 51 | * @return \Symfony\Component\HttpFoundation\Response |
||
| 52 | */ |
||
| 53 | public function example(Request $request): Response |
||
|
0 ignored issues
–
show
|
|||
| 54 | { |
||
| 55 | $response = new Response( |
||
| 56 | 'Hello World!', |
||
| 57 | Response::HTTP_OK, |
||
| 58 | ['content-type' => 'text/plain'], |
||
| 59 | ); |
||
| 60 | |||
| 61 | return $response; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.