GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#60)
by Kevin
09:13
created

ThemeConfiguration::getCacheTargetXpath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Magium\Magento\Themes\Admin;
4
5
use Magium\AbstractConfigurableElement;
6
use Magium\AbstractTestCase;
7
use Magium\Magento\Themes\NavigableThemeInterface;
8
9
class ThemeConfiguration extends AbstractConfigurableElement implements  NavigableThemeInterface
0 ignored issues
show
Coding Style introduced by
Expected 1 space before "NavigableThemeInterface"; 2 found
Loading history...
10
{
11
12
    const THEME = 'Magium\Magento\Themes\Admin\ThemeConfiguration';
13
14
    public $baseUrl = 'http://localhost/admin';
15
16
    public $homeXpath = '//img[@class="logo"]';
17
18
    public $loginUsernameField           = '//input[@type="text" and @id="username"]';
19
    public $loginPasswordField           = '//input[@type="password" and @id="login"]';
20
    public $loginSubmitButton            = '//input[@type="submit" and @value="{{Login}}"]';
21
    
22
    public $navigationBaseXPathSelector          = '//ul[@id="nav"]';
23
//    public $navigationChildXPathSelector1         = 'li/descendant::span[.="{{%s}}"]';
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
24
    public $navigationChildXPathSelector         = 'a[concat(" ",normalize-space(.)," ") = " {{%s}} "]/..';
25
26
    public $adminPopupMessageContainerXpath         = '//*[@id="message-popup-window"]';
27
    public $adminPopupMessageCloseButtonXpath        = '//*[@id="message-popup-window"]/descendant::*[@title="close"]';
28
29
    public $systemConfigTabsXpath                = '//ul[@id="system_config_tabs"]/descendant::a[concat(" ",normalize-space(.)," ") = " {{%s}} "]';
30
    public $systemConfigSectionToggleXpath             = '//form[@id="config_edit_form"]/descendant::div[contains(concat(" ",normalize-space(@class)," ")," section-config ")]/descendant::a[.="{{%s}}"]';
31
    public $systemConfigSectionDisplayCheckXpath            = '//legend[.="{{%s}}"]/ancestor::fieldset';
32
    public $systemConfigToggleEnableXpath            = '//legend[.="{{%s}}"]/../descendant::td[concat(" ",normalize-space(.)," ") = " {{Enabled}} "]/../td/descendant::select/option[@value="%d"]';
33
34
    public $xTreeRootXpath                          = '//ul[contains(concat(" ",normalize-space(@class)," ")," x-tree-root-ct ")]/div/li[contains(concat(" ",normalize-space(@class)," ")," x-tree-node ")]/div/a';
35
    public $xTreeNamedRootXpath                          = '//ul[contains(concat(" ",normalize-space(@class)," ")," x-tree-root-ct ")]/div/li[contains(concat(" ",normalize-space(@class)," ")," x-tree-node ")]/div/a[contains(concat("---",normalize-space(.)), "---{{%s}} (")]';
36
    public $xTreeChildXpath                          = 'ul/li[contains(concat(" ",normalize-space(@class)," ")," x-tree-node ")]/div/a/span[contains(concat("---",normalize-space(.)), "---{{%s}} (")]/..';
37
    public $xTreeChildNodePrefixXpath                = '/../..';
38
    public $xTreeChildNodeExpandPrefixXpath          = '/../img[contains(concat(" ",normalize-space(@class)," ")," x-tree-ec-icon ")]';
39
40
    public $systemConfigurationSaveButtonXpath       = '//div[@class="main-col-inner"]/div[@class="content-header"]/descendant::button[@title="{{Save Config}}"]';
41
42
    public $systemConfigSaveSuccessfulXpath          = '//li[@class="success-msg"]/descendant::span[.="{{The configuration has been saved}}."]';
43
44
    public $testLoggedInAtBaseUrl                     = '//a[@class="active"]/span[.="{{Dashboard}}"]';
45
46
    public $tableButtonXpath                         = '//table[@class="actions"]/descendant::span[.="{{%s}}"]';
47
48
    public $selectOrderXpath                         = '//table[@id="sales_order_grid_table"]/descendant::td[concat(" ",normalize-space(.)," ") = " %s "]/../td/a[.="{{View}}"]';
49
    public $selectCustomerXpath                         = '//table[@id="customerGrid_table"]/descendant::td[concat(" ",normalize-space(.)," ") = " %s "]/../td/a[.="{{Edit}}"]';
50
51
    public $systemConfigSettingLabelXpath            = '//td[@class="label"]/label[.=" {{%s}}"]';
52
53
    public $widgetTabXpath                           = '//a[contains(@class, "tab-item-link")]/span[.="{{%s}}"]';
54
    public $widgetTabHeaderXpath                     = '//div[@class="entry-edit-head"]/h4[.="{{%s}}"]';
55
    public $widgetAttributeByLabelXpath              = '//table[@class="form-list"]/descendant::td[@class="label"]/label[.="{{%s}} *" or .="{{%s}}*" or .="{{%s}} " or .="{{%s}}"]/ancestor::tr/td[@class="value"]/*[@name]';
56
    public $widgetActionButtonXpath                  = '//div[@class="content-header"]/descendant::button/descendant::span[.="{{%s}}"]';
57
58
    public $guaranteedPageLoadedElementDisplayedXpath = '//div[@class="footer"]';
59
60
    public $successfulActionXpath                    = '//li[@class="success-msg"]';
61
    public $errorActionXpath                    = '//li[@class="error-msg"]';
62
63
    public $shippingCarrierXpath                = '//select[@name="tracking[%d][carrier_code]"]';
64
    public $shippingTitleXpath                = '//input[@name="tracking[%d][title]"]';
65
    public $shippingTrackingNumberXpath                = '//input[@name="tracking[%d][number]"]';
66
67
    public $formButtonXpath = '//div[@class="content-header"]/p[@class="form-buttons"]/descendant::span[.="{{%s}}"]';
68
69
    public $cacheNavigationPath = '{{System}}/{{Cache Management}}';
70
71
    public $cacheTargetXpath = '//input[@name="types" and @value="{{%s}}"]';
72
73
    public $cacheAllTargetsXpath = '//input[@name="types"]';
74
75
    public $cacheMassActionOptionXpath = '//select[@id="cache_grid_massaction-select"]/option[@value="{{%s}}"]';
76
77
    public $cacheSubmitXpath = '//button[@title="{{Submit}}"]';
78
79
    /**
80
     * @return string
81
     */
82
    public function getCacheSubmitXpath()
83
    {
84
        return $this->translatePlaceholders($this->cacheSubmitXpath);
85
    }
86
87
88
89
    /**
90
     * @return string
91
     */
92
    public function getCacheMassActionOptionXpath($option)
93
    {
94
        $xpath = sprintf($this->cacheMassActionOptionXpath, $option);
95
        return $this->translatePlaceholders($xpath);
96
    }
97
98
99
100
    /**
101
     * @return string
102
     */
103
    public function getCacheAllTargetsXpath()
104
    {
105
        return $this->translatePlaceholders($this->cacheAllTargetsXpath);
106
    }
107
108
109
110
    /**
111
     * @return string
112
     */
113
    public function getCacheTargetXpath($type)
114
    {
115
        $xpath = sprintf($this->cacheTargetXpath, $type);
116
        return $this->translatePlaceholders($xpath);
117
    }
118
119
120
121
    /**
122
     * @return string
123
     */
124
    public function getCacheNavigationPath()
125
    {
126
        return $this->translatePlaceholders($this->cacheNavigationPath);
127
    }
128
129
130
    public function getFormButtonXpath($button)
131
    {
132
        $xpath = sprintf($this->formButtonXpath, $button);
133
        return $this->translatePlaceholders($xpath);
134
    }
135
136
    /**
137
     * @return string
138
     */
139
    public function getShippingCarrierXpath($count)
140
    {
141
        $xpath = sprintf($this->shippingCarrierXpath, $count);
142
        return $xpath;
143
    }
144
145
    /**
146
     * @return string
147
     */
148
    public function getShippingTitleXpath($count)
149
    {
150
        $xpath = sprintf($this->shippingTitleXpath, $count);
151
        return $xpath;
152
    }
153
154
    /**
155
     * @return string
156
     */
157
    public function getShippingTrackingNumberXpath($count)
158
    {
159
        $xpath = sprintf($this->shippingTrackingNumberXpath, $count);
160
        return $xpath;
161
    }
162
163
164
165
    /**
166
     * @return string
167
     */
168
    public function getXTreeChildNodeExpandPrefixXpath()
169
    {
170
        return $this->translatePlaceholders($this->xTreeChildNodeExpandPrefixXpath);
171
    }
172
173
    /**
174
     * @return string
175
     */
176
    public function getXTreeNamedRootXpath($category)
177
    {
178
        $xpath = sprintf($this->xTreeNamedRootXpath, $category);
179
        return $this->translatePlaceholders($xpath);
180
    }
181
182
183
184
185
    /**
186
     * @return string
187
     */
188
    public function getXTreeChildNodePrefixXpath()
189
    {
190
        return $this->translatePlaceholders($this->xTreeChildNodePrefixXpath);
191
    }
192
193
    /**
194
     * @return string
195
     */
196
    public function getXTreeChildXpath($name)
197
    {
198
        $xpath = sprintf($this->xTreeChildXpath, $name);
199
        return $this->translatePlaceholders($xpath);
200
    }
201
202
    /**
203
     * @return string
204
     */
205
    public function getXTreeRootXpath()
206
    {
207
        return $this->translatePlaceholders($this->xTreeRootXpath);
208
    }
209
210
211
212
    public function set($name, $value)
213
    {
214
        $this->$name = $value;
215
    }
216
217
    /**
218
     * @return string
219
     */
220
    public function getSuccessfulActionXpath()
221
    {
222
        return $this->successfulActionXpath;
223
    }
224
225
    /**
226
     * @return string
227
     */
228
    public function getErrorActionXpath()
229
    {
230
        return $this->errorActionXpath;
231
    }
232
233
234
235
    /**
236
     * @return string
237
     */
238
    public function getWidgetActionButtonXpath($label)
239
    {
240
        return $this->translatePlaceholders(sprintf($this->widgetActionButtonXpath, $label));
241
    }
242
243
    /**
244
     * @return string
245
     */
246
    public function getWidgetAttributeByLabelXpath($attribute)
247
    {
248
        return $this->translatePlaceholders(sprintf($this->widgetAttributeByLabelXpath, $attribute, $attribute, $attribute, $attribute));
249
    }
250
251
252
253
    /**
254
     * @return string
255
     */
256
    public function getWidgetTabHeaderXpath($name)
257
    {
258
        return $this->translatePlaceholders(sprintf($this->widgetTabHeaderXpath, $name));
259
    }
260
261
    /**
262
     * @return string
263
     */
264
    public function getWidgetTabXpath($name)
265
    {
266
        return $this->translatePlaceholders(sprintf($this->widgetTabXpath, $name));
267
    }
268
269
270
271
    public function getGuaranteedPageLoadedElementDisplayedXpath()
272
    {
273
        return $this->translatePlaceholders($this->guaranteedPageLoadedElementDisplayedXpath);
274
    }
275
276
    /**
277
     * @param mixed $guaranteedPageLoadedElementDisplayedXpath
278
     */
279
    public function setGuaranteedPageLoadedElementDisplayedXpath($guaranteedPageLoadedElementDisplayedXpath)
280
    {
281
        $this->guaranteedPageLoadedElementDisplayedXpath = $guaranteedPageLoadedElementDisplayedXpath;
282
    }
283
284
    /**
285
     * @return string
286
     */
287
    public function getHomeXpath()
288
    {
289
        return $this->homeXpath;
290
    }
291
292
    /**
293
     * @return string
294
     */
295
    public function getSystemConfigSettingLabelXpath($label)
296
    {
297
        $return = sprintf($this->systemConfigSettingLabelXpath, $label);
298
        return $this->translatePlaceholders($return);
299
    }
300
301
    /**
302
     * Why is this an option?  So you can have a different theme setup for different languages and still use the same code.
303
     *
304
     * @var string
305
     */
306
307
    public $searchButtonText                         = '{{Search}}';
308
309
    /**
310
     * @return Translator
311
     */
312
    public function getTranslator()
313
    {
314
        return $this->translator;
315
    }
316
317
    /**
318
     * @return string
319
     */
320
    public function getLoginUsernameField()
321
    {
322
        return $this->translatePlaceholders($this->loginUsernameField);
323
    }
324
325
    /**
326
     * @return string
327
     */
328
    public function getLoginPasswordField()
329
    {
330
        return $this->translatePlaceholders($this->loginPasswordField);
331
    }
332
333
    /**
334
     * @return string
335
     */
336
    public function getLoginSubmitButton()
337
    {
338
        return $this->translatePlaceholders($this->loginSubmitButton);
339
    }
340
341
    /**
342
     * @return string
343
     */
344
    public function getNavigationBaseXPathSelector()
345
    {
346
        return $this->translatePlaceholders($this->navigationBaseXPathSelector);
347
    }
348
349
    /**
350
     * @return string
351
     */
352
    public function getNavigationChildXPathSelector($text)
353
    {
354
        $return = sprintf($this->navigationChildXPathSelector, $text);
355
        return $this->translatePlaceholders($return);
356
    }
357
358
    /**
359
     * @return mixed
360
     */
361
    public function getBaseUrl()
362
    {
363
        return $this->baseUrl;
364
    }
365
366
    /**
367
     * @return string
368
     */
369
    public function getSearchButtonText()
370
    {
371
        return $this->translatePlaceholders($this->searchButtonText);
372
    }
373
374
375
376
    /**
377
     * @return string
378
     */
379
    public function getSelectOrderXpath($order)
380
    {
381
        $return = sprintf($this->selectOrderXpath, $order);
382
        return $this->translatePlaceholders($return);
383
    }
384
    /**
385
     * @return string
386
     */
387
    public function getSelectCustomerXpath($value)
388
    {
389
        $xpath = sprintf($this->selectCustomerXpath, $value);
390
        return $this->translatePlaceholders($xpath);
391
    }
392
393
    /**
394
     * @return string
395
     */
396
    public function getTableButtonXpath($buttonValue)
397
    {
398
        $return = sprintf($this->tableButtonXpath, $buttonValue);
399
        return $this->translatePlaceholders($return);
400
    }
401
402
403
404
    /**
405
     * @return string
406
     */
407
    public function getTestLoggedInAtBaseUrl()
408
    {
409
        return $this->translatePlaceholders($this->testLoggedInAtBaseUrl);
410
    }
411
412
413
414
    /**
415
     * @return string
416
     */
417
    public function getSystemConfigSaveSuccessfulXpath()
418
    {
419
        return $this->translatePlaceholders($this->systemConfigSaveSuccessfulXpath);
420
    }
421
422
    /**
423
     * @return string
424
     */
425
    public function getSystemConfigurationSaveButtonXpath()
426
    {
427
        return $this->translatePlaceholders($this->systemConfigurationSaveButtonXpath);
428
    }
429
430
    /**
431
     * @return string
432
     */
433
    public function getSystemConfigSectionToggleXpath($section)
434
    {
435
        $return = sprintf($this->systemConfigSectionToggleXpath, $section);
436
        return $this->translatePlaceholders($return);
437
    }
438
439
    /**
440
     * @return string
441
     */
442
    public function getSystemConfigSectionDisplayCheckXpath($section)
443
    {
444
        $return = sprintf($this->systemConfigSectionDisplayCheckXpath, $section);
445
        return $this->translatePlaceholders($return);
446
    }
447
448
    /**
449
     * @return string
450
     */
451
    public function getSystemConfigToggleEnableXpath($section, $option)
452
    {
453
        $return = sprintf($this->systemConfigToggleEnableXpath, $section, $option);
454
        return $this->translatePlaceholders($return);
455
    }
456
457
    /**
458
     * @return string
459
     */
460
    public function getSystemConfigTabsXpath($tabName)
461
    {
462
        $return = sprintf($this->systemConfigTabsXpath, $tabName);
463
        return $this->translatePlaceholders($return);
464
    }
465
466
467
    public function getAdminPopupMessageContainerXpath()
468
    {
469
        return $this->translatePlaceholders($this->adminPopupMessageContainerXpath);
470
    }
471
472
    public function getAdminPopupMessageCloseButtonXpath()
473
    {
474
        return $this->translatePlaceholders($this->adminPopupMessageCloseButtonXpath);
475
    }
476
477
    public function configure(AbstractTestCase $testCase)
478
    {
479
480
    }
481
482
}