1 | <?php |
||
34 | class Admin implements ISettings { |
||
35 | |||
36 | /** @var IConfig */ |
||
37 | private $config; |
||
38 | |||
39 | /** @var AppConfig */ |
||
40 | private $appConfig; |
||
41 | |||
42 | /** @var TemplateManager */ |
||
43 | private $manager; |
||
44 | |||
45 | /** @var array */ |
||
46 | private $capabilities; |
||
47 | |||
48 | /** @var DemoService */ |
||
49 | private $demoService; |
||
50 | |||
51 | /** |
||
52 | * Admin template settings |
||
53 | * |
||
54 | * @param IConfig $config |
||
55 | * @param TemplateManager $manager |
||
56 | * @param Capabilities $capabilities |
||
57 | */ |
||
58 | public function __construct( |
||
71 | /** |
||
72 | * @return TemplateResponse |
||
73 | */ |
||
74 | public function getForm() { |
||
75 | $demoServers = []; |
||
|
|||
76 | |||
77 | return new TemplateResponse( |
||
78 | 'richdocuments', |
||
79 | 'admin', |
||
80 | [ |
||
81 | 'settings' => [ |
||
82 | 'wopi_url' => $this->config->getAppValue('richdocuments', 'wopi_url'), |
||
83 | 'edit_groups' => $this->config->getAppValue('richdocuments', 'edit_groups'), |
||
84 | 'use_groups' => $this->config->getAppValue('richdocuments', 'use_groups'), |
||
85 | 'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format'), |
||
86 | 'external_apps' => $this->config->getAppValue('richdocuments', 'external_apps'), |
||
87 | 'canonical_webroot' => $this->config->getAppValue('richdocuments', 'canonical_webroot'), |
||
88 | 'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === 'yes', |
||
89 | 'templates' => $this->manager->getSystemFormatted(), |
||
90 | 'templatesAvailable' => array_key_exists('templates', $this->capabilities) && $this->capabilities['templates'], |
||
91 | 'settings' => $this->appConfig->getAppSettings(), |
||
92 | 'demo_servers' => $this->demoService->fetchDemoServers(), |
||
93 | 'web_server' => strtolower($_SERVER['SERVER_SOFTWARE']), |
||
94 | 'os_family' => PHP_VERSION_ID >= 70200 ? PHP_OS_FAMILY : PHP_OS, |
||
95 | 'platform' => php_uname('m') |
||
96 | ] |
||
97 | ], |
||
98 | 'blank' |
||
99 | ); |
||
100 | } |
||
101 | /** |
||
102 | * @return string the section ID, e.g. 'sharing' |
||
103 | */ |
||
104 | public function getSection() { |
||
107 | /** |
||
108 | * @return int whether the form should be rather on the top or bottom of |
||
109 | * the admin section. The forms are arranged in ascending order of the |
||
110 | * priority values. It is required to return a value between 0 and 100. |
||
111 | * |
||
112 | * keep the server setting at the top, right after "server settings" |
||
113 | */ |
||
114 | public function getPriority() { |
||
117 | |||
118 | } |
||
119 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.