Code Duplication    Length = 22-22 lines in 2 locations

PHPCompatibility/Sniffs/PHP/NewExtensionsSniff.php 1 location

@@ 342-363 (lines=22) @@
339
     *
340
     * @return bool
341
     */
342
    protected function isWhiteListed($content)
343
    {
344
        if (isset($this->functionWhitelist) === false) {
345
            return false;
346
        }
347
348
        if (is_string($this->functionWhitelist) === true) {
349
            if (strpos($this->functionWhitelist, ',') !== false) {
350
                $this->functionWhitelist = explode(',', $this->functionWhitelist);
351
            } else {
352
                $this->functionWhitelist = (array) $this->functionWhitelist;
353
            }
354
        }
355
356
        if (is_array($this->functionWhitelist) === true) {
357
            $this->functionWhitelist = array_map('strtolower', $this->functionWhitelist);
358
            return in_array($content, $this->functionWhitelist, true);
359
        }
360
361
        return false;
362
363
    }//end isWhiteListed()
364
365
366
    /**

PHPCompatibility/Sniffs/PHP/RemovedExtensionsSniff.php 1 location

@@ 315-336 (lines=22) @@
312
     *
313
     * @return bool
314
     */
315
    protected function isWhiteListed($content)
316
    {
317
        if (isset($this->functionWhitelist) === false) {
318
            return false;
319
        }
320
321
        if (is_string($this->functionWhitelist) === true) {
322
            if (strpos($this->functionWhitelist, ',') !== false) {
323
                $this->functionWhitelist = explode(',', $this->functionWhitelist);
324
            } else {
325
                $this->functionWhitelist = (array) $this->functionWhitelist;
326
            }
327
        }
328
329
        if (is_array($this->functionWhitelist) === true) {
330
            $this->functionWhitelist = array_map('strtolower', $this->functionWhitelist);
331
            return in_array($content, $this->functionWhitelist, true);
332
        }
333
334
        return false;
335
336
    }//end isWhiteListed()
337
338
339
    /**