Code Duplication    Length = 13-13 lines in 2 locations

src/Graviton/SecurityBundle/Authentication/Strategies/CookieFieldStrategy.php 2 locations

@@ 80-92 (lines=13) @@
77
     *
78
     * @return string
79
     */
80
    protected function extractAdUsername(Request $request, $value)
81
    {
82
        $pattern = "/((?m)(?<=\b".self::COOKIE_FIELD_NAME."=)[^;]*)/i";
83
        preg_match($pattern, $value, $matches);
84
85
        if ($matches) {
86
            $request->attributes->set(self::CONFIGURATION_PARAMETER_USER_ID, $matches[0]);
87
88
            return $matches[0];
89
        }
90
91
        return $value;
92
    }
93
94
    /**
95
     * Finds and extracts the core system id from tha cookie.
@@ 102-114 (lines=13) @@
99
     *
100
     * @return string
101
     */
102
    protected function extractCoreId(Request $request, $text)
103
    {
104
        $pattern = "/((?m)(?<=\b".self::COOKIE_VALUE_CORE_ID."=)[^;]*)/i";
105
        preg_match($pattern, $text, $matches);
106
107
        if ($matches) {
108
            $request->attributes->set(self::CONFIGURATION_PARAMETER_CORE_ID, $matches[0]);
109
110
            return $matches[0];
111
        }
112
113
        return $text;
114
    }
115
}
116