Code Duplication    Length = 6-7 lines in 2 locations

src/NodeVisitor/IgnoreNamespaceScoperNodeVisitor.php 1 location

@@ 77-83 (lines=7) @@
74
        /** @var FullyQualified $node */
75
76
        // Is a fully qualified call from the global namespace which is not whitelisted
77
        if (1 === count($node->parts)
78
            && (false === ($this->whitelister)($node->getFirst()))
79
        ) {
80
            $node->setAttribute('phpscoper_ignore', true);
81
82
            return $node;
83
        }
84
85
        if (false === $node->hasAttribute('parent')) {
86
            return $node;

src/NodeVisitor/ScopeWhitelistedElementsFromGlobalNamespaceNodeVisitor.php 1 location

@@ 50-55 (lines=6) @@
47
     */
48
    public function enterNode(Node $node): Node
49
    {
50
        if ($node instanceof Name
51
            && 1 === count($node->parts)
52
            && true === ($this->whitelister)($node->getFirst())
53
        ) {
54
            return Name::concat($this->prefix, $node->getFirst());
55
        }
56
57
        return $node;
58
    }