Passed
Push — main ( c58d36...2917d5 )
by Paul
03:53
created

str_starts_with()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 1
b 1
f 0
nc 1
nop 2
dl 0
loc 2
rs 10
1
<?php
2
3
defined('WPINC') || exit;
4
5
if (!function_exists('str_starts_with')) {
6
    function str_starts_with(?string $haystack, ?string $needle): bool {
7
        return 0 === strncmp((string) $haystack, (string) $needle, strlen((string) $needle));
8
    }
9
}
10
11
/*
12
 * @return array
13
 * @see https://docs.gravityforms.com/gform_noconflict_scripts/
14
 */
15
add_filter('gform_noconflict_scripts', function (array $scripts) {
16
    $scripts[] = 'blackbar';
17
    return $scripts;
18
});
19
20
/*
21
 * @return array
22
 * @see https://docs.gravityforms.com/gform_noconflict_styles/
23
 */
24
add_filter('gform_noconflict_styles', function (array $styles) {
25
    $styles[] = 'blackbar';
26
    $styles[] = 'blackbar-syntax';
27
    return $styles;
28
});
29