Code Duplication    Length = 9-9 lines in 2 locations

src/Utility/StringUtils.php 2 locations

@@ 97-105 (lines=9) @@
94
     *
95
     * @return bool
96
     */
97
    public function beginsWith($haystack, $needle, $modifiers = null)
98
    {
99
        $this->prepareHaystackAndNeedle($haystack, $needle, $modifiers);
100
        $parsedModifiers = $this->parseModifiers($modifiers);
101
102
        $pattern = '/^' . preg_quote($needle) . '/';
103
104
        return (bool)preg_match($pattern . $parsedModifiers, $haystack);
105
    }
106
107
    /**
108
     * @param string $string
@@ 124-132 (lines=9) @@
121
     *
122
     * @return bool
123
     */
124
    public function endsWith($haystack, $needle, $modifiers = null)
125
    {
126
        self::prepareHaystackAndNeedle($haystack, $needle, $modifiers);
127
        $parsedModifiers = $this->parseModifiers($modifiers);
128
129
        $pattern = '/' . preg_quote($needle) . '$/';
130
131
        return (bool)preg_match($pattern . $parsedModifiers, $haystack);
132
    }
133
134
    /**
135
     * @param string $string