1 | <?php |
||
13 | class SettingModifier |
||
14 | { |
||
15 | |||
16 | const ACTION = 'Admin\Configuration\SettingModifier'; |
||
17 | |||
18 | const SETTING_OPTION_YES = 1; |
||
19 | const SETTING_OPTION_NO = 0; |
||
20 | |||
21 | protected $webDriver; |
||
22 | protected $testCase; |
||
23 | protected $systemConfigurationNavigator; |
||
24 | protected $themeConfiguration; |
||
25 | protected $save; |
||
26 | |||
27 | protected $dataChanged = false; |
||
28 | |||
29 | /** |
||
30 | * SettingModifier constructor. |
||
31 | * @param $webDriver |
||
32 | * @param $testCase |
||
33 | * @param $systemConfigurationNavigator |
||
34 | * @param $themeConfiguration |
||
35 | */ |
||
36 | public function __construct( |
||
37 | WebDriver $webDriver, |
||
38 | AbstractMagentoTestCase $testCase, |
||
39 | SystemConfiguration $systemConfigurationNavigator, |
||
40 | ThemeConfiguration $themeConfiguration, |
||
41 | Save $save |
||
42 | ) |
||
43 | { |
||
44 | $this->webDriver = $webDriver; |
||
45 | $this->testCase = $testCase; |
||
46 | $this->systemConfigurationNavigator = $systemConfigurationNavigator; |
||
47 | $this->themeConfiguration = $themeConfiguration; |
||
48 | $this->save = $save; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Changes a system configuration setting based off of the identifier. The identifier can be specified in 4 |
||
53 | * possible ways. |
||
54 | * |
||
55 | * * Tab/Section::setting_id (will ensure that the correct section is navigated to) |
||
56 | * * setting_id (will not navigate (no section information) |
||
57 | * * Tab/Section::name=Text Of Setting (will ensure that the correct section is navigated to, uses setting name (exact), not ID) |
||
58 | * * name=Text Of Setting (will not navigate, uses setting name (exact) not ID) |
||
59 | * |
||
60 | * @param $identifier |
||
61 | * @param $value |
||
62 | * @throws \Magium\InvalidInstructionException |
||
63 | */ |
||
64 | |||
65 | public function set($identifier, $value, $save = false) |
||
92 | |||
93 | protected function handleElementSetting($elementId, $value) |
||
125 | } |
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.