These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\AdminBundle\Controller; |
||
4 | |||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
||
6 | use Symfony\Component\Routing\Annotation\Route; |
||
7 | use Symfony\Component\Security\Core\Exception\AccessDeniedException; |
||
8 | |||
9 | /** |
||
10 | * Main settings controller |
||
11 | */ |
||
12 | class SettingsController extends BaseSettingsController |
||
13 | { |
||
14 | /** |
||
15 | * Index page for the settings |
||
16 | * |
||
17 | * @Route("/", name="KunstmaanAdminBundle_settings") |
||
18 | * @Template("@KunstmaanAdmin/Settings/index.html.twig") |
||
19 | * |
||
20 | * @throws AccessDeniedException |
||
21 | * |
||
22 | * @return array |
||
23 | */ |
||
24 | public function indexAction() |
||
25 | { |
||
26 | $this->denyAccessUnlessGranted('ROLE_ADMIN'); |
||
27 | |||
28 | return []; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Show bundles version update information |
||
33 | * |
||
34 | * @Route("/bundle-version", name="KunstmaanAdminBundle_settings_bundle_version") |
||
35 | * @Template("@KunstmaanAdmin/Settings/bundleVersion.html.twig") |
||
36 | * |
||
37 | * @throws AccessDeniedException |
||
38 | * |
||
39 | * @return array |
||
0 ignored issues
–
show
|
|||
40 | */ |
||
41 | public function bundleVersionAction() |
||
42 | { |
||
43 | $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); |
||
44 | |||
45 | $versionChecker = $this->container->get('kunstmaan_admin.versionchecker'); |
||
46 | if (!$versionChecker->isEnabled()) { |
||
47 | return ['data' => null]; |
||
48 | } |
||
49 | |||
50 | $data = null; |
||
51 | |||
52 | try { |
||
53 | $data = $versionChecker->check(); |
||
54 | } catch (\Exception $e) { |
||
55 | $this->container->get('logger')->error( |
||
56 | $e->getMessage(), |
||
57 | ['exception' => $e] |
||
58 | ); |
||
59 | } |
||
60 | |||
61 | return [ |
||
62 | 'data' => $data, |
||
63 | ]; |
||
64 | } |
||
65 | } |
||
66 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.