| Conditions | 4 |
| Paths | 3 |
| Total Lines | 33 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function extendMenu(WP_Admin_Bar $adminBar): void |
||
| 32 | { |
||
| 33 | $isUserAllowed = current_user_can('manage_options'); |
||
| 34 | $isBackend = is_admin(); |
||
| 35 | |||
| 36 | if (!$isUserAllowed || $isBackend) { |
||
| 37 | return; |
||
| 38 | } |
||
| 39 | |||
| 40 | $adminBar->add_menu([ |
||
| 41 | 'id' => 'helick-gtm', |
||
| 42 | 'title' => sprintf( |
||
| 43 | '<span class="ab-icon dashicons-filter"></span> <span class="ab-label">%s</span>', |
||
| 44 | __('Data Layer', DOMAIN) |
||
| 45 | ), |
||
| 46 | ]); |
||
| 47 | |||
| 48 | $dataLayer = dataLayer(); |
||
| 49 | |||
| 50 | // Flatten data layer |
||
| 51 | $iterator = new RecursiveArrayIterator($dataLayer); |
||
| 52 | $iterator = new RecursiveIteratorIterator($iterator); |
||
| 53 | |||
| 54 | $dataLayer = iterator_to_array($iterator); |
||
| 55 | |||
| 56 | foreach ($dataLayer as $key => $value) { |
||
| 57 | $adminBar->add_node([ |
||
| 58 | 'id' => sanitize_key('helick-gtm-' . $key), |
||
| 59 | 'parent' => 'helick-gtm', |
||
| 60 | 'title' => sprintf( |
||
| 61 | '<span style="font-weight: bold">%s:</span> %s', |
||
| 62 | $key, |
||
| 63 | esc_html($value) |
||
| 64 | ), |
||
| 69 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths