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.

Code Duplication    Length = 26-28 lines in 2 locations

src/Display/Column/Filter/Date.php 1 location

@@ 146-173 (lines=28) @@
143
     *
144
     * @return string
145
     */
146
    public function parseValue($date)
147
    {
148
        if (empty($date)) {
149
            return;
150
        }
151
152
        try {
153
            $date = Carbon::parse($date);
154
        } catch (Exception $e) {
155
            \Log::info('unable to parse date, re-trying with given format', [
156
                'exception' => $e,
157
                'date'      => $date,
158
            ]);
159
            try {
160
                $date = Carbon::createFromFormat($this->getPickerFormat(), $date);
161
            } catch (Exception $e) {
162
                \Log::error('unable to parse date!', [
163
                    'exception'     => $e,
164
                    'pickerFormat'  => $this->getPickerFormat(),
165
                    'date'          => $date,
166
                ]);
167
168
                return;
169
            }
170
        }
171
172
        return $date->format($this->getFormat());
173
    }
174
}
175

src/Form/Element/DateTime.php 1 location

@@ 168-193 (lines=26) @@
165
     *
166
     * @return string|void
167
     */
168
    protected function parseValue($value)
169
    {
170
        try {
171
            $time = Carbon::parse($value);
172
        } catch (Exception $e) {
173
            \Log::info('unable to parse date, re-trying with given format', [
174
                'exception' => $e,
175
                'date'      => $value,
176
            ]);
177
            try {
178
                $time = Carbon::createFromFormat($this->getPickerFormat(), $value);
179
            } catch (Exception $e) {
180
                \Log::error('unable to parse date!', [
181
                    'exception'     => $e,
182
                    'pickerFormat'  => $this->getPickerFormat(),
183
                    'date'          => $value,
184
                ]);
185
186
                return;
187
            }
188
        }
189
190
        return $time->timezone($this->getTimezone())->format(
191
            $this->getPickerFormat()
192
        );
193
    }
194
}
195