Code Duplication    Length = 17-17 lines in 2 locations

PHPCompatibility/Sniffs/PHP/NewClassesSniff.php 1 location

@@ 773-789 (lines=17) @@
770
     *
771
     * @return void
772
     */
773
    private function processReturnTypeToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr)
774
    {
775
        $returnTypeHint   = $this->getReturnTypeHintName($phpcsFile, $stackPtr);
776
        $returnTypeHint   = ltrim($returnTypeHint, '\\');
777
        $returnTypeHintLc = strtolower($returnTypeHint);
778
779
        if (isset($this->newClasses[$returnTypeHintLc]) === false) {
780
            return;
781
        }
782
783
        // Still here ? Then this is a return type declaration using a new class.
784
        $itemInfo = array(
785
            'name'   => $returnTypeHint,
786
            'nameLc' => $returnTypeHintLc,
787
        );
788
        $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
789
    }
790
791
792
    /**

PHPCompatibility/Sniffs/PHP/NewInterfacesSniff.php 1 location

@@ 285-301 (lines=17) @@
282
     *
283
     * @return void
284
     */
285
    private function processReturnTypeToken(\PHP_CodeSniffer_File $phpcsFile, $stackPtr)
286
    {
287
        $returnTypeHint   = $this->getReturnTypeHintName($phpcsFile, $stackPtr);
288
        $returnTypeHint   = ltrim($returnTypeHint, '\\');
289
        $returnTypeHintLc = strtolower($returnTypeHint);
290
291
        if (isset($this->newInterfaces[$returnTypeHintLc]) === false) {
292
            return;
293
        }
294
295
        // Still here ? Then this is a return type declaration using a new interface.
296
        $itemInfo = array(
297
            'name'   => $returnTypeHint,
298
            'nameLc' => $returnTypeHintLc,
299
        );
300
        $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
301
    }
302
303
304
    /**