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 = 22-22 lines in 2 locations

src/Form/Element/MultiSelectAjax.php 1 location

@@ 167-188 (lines=22) @@
164
165
        $options = $options->get();
166
167
        if (is_callable($makeDisplay = $this->getDisplay())) {
168
            // make dynamic display text
169
            if ($options instanceof Collection) {
170
                $options = $options->all();
171
            }
172
173
            // iterate for all options and redefine it as
174
            // list of KEY and TEXT pair
175
            $options = array_map(function ($opt) use ($key, $makeDisplay) {
176
                // get the KEY and make the display text
177
                return [data_get($opt, $key), $makeDisplay($opt)];
178
            }, $options);
179
180
            // take options as array with KEY => VALUE pair
181
            $options = array_pluck($options, 1, 0);
182
        } elseif ($options instanceof Collection) {
183
            // take options as array with KEY => VALUE pair
184
            $options = array_pluck($options->all(), $this->getDisplay(), $key);
185
        } else {
186
            // take options as array with KEY => VALUE pair
187
            $options = array_pluck($options, $this->getDisplay(), $key);
188
        }
189
190
        return $options;
191
    }

src/Traits/SelectOptionsFromModel.php 1 location

@@ 225-246 (lines=22) @@
222
223
        $options = $options->get();
224
225
        if (is_callable($makeDisplay = $this->getDisplay())) {
226
            // make dynamic display text
227
            if ($options instanceof Collection) {
228
                $options = $options->all();
229
            }
230
231
            // iterate for all options and redefine it as
232
            // list of KEY and TEXT pair
233
            $options = array_map(function ($opt) use ($key, $makeDisplay) {
234
                // get the KEY and make the display text
235
                return [data_get($opt, $key), $makeDisplay($opt)];
236
            }, $options);
237
238
            // take options as array with KEY => VALUE pair
239
            $options = array_pluck($options, 1, 0);
240
        } elseif ($options instanceof Collection) {
241
            // take options as array with KEY => VALUE pair
242
            $options = array_pluck($options->all(), $this->getDisplay(), $key);
243
        } else {
244
            // take options as array with KEY => VALUE pair
245
            $options = array_pluck($options, $this->getDisplay(), $key);
246
        }
247
248
        return $options;
249
    }