1.2.1274. Unresolved Use

The following use instructions cannot be resolved to a known class, interface, trait, constant or function. They should be dropped or fixed.

A known class, interface, trait, constant or function is defined in PHP (standard), an extension, a stub or the current code. Use expression are options for the current namespace.

<?php

namespace A {
    // class B is defined
    class B {}
    // class C is not defined
}

namespace X/Y {

    use A/B;  // This use is valid
    use A/C;  // This use point to nothing.

    new B();
    new C();
}

?>

See also Using namespaces: Aliasing/Importing.

1.2.1274.1. Suggestions

  • Remove the use expression

  • Fix the use expression

1.2.1274.2. Specs

Short name

Namespaces/UnresolvedUse

Rulesets

All, Analyze, Changed Behavior

Exakat since

0.8.4

PHP Version

All

Severity

Major

Time To Fix

Slow (1 hour)

Precision

High

Features

namespace, use

ClearPHP

no-unresolved-use

Available in

Entreprise Edition, Exakat Cloud