1.2.22. Aliases

This rule lists all aliases. Aliases are used file by file, although some classes may have different aliases depending on the context.

<?php

// This is an alias
use stdClass as aClass;

// This is not an alias : it is not explicit
use stdClass;

trait t {
    // This is not an alias, it's a trait usage
    use otherTrait;
}

?>

See also Using namespaces: Aliasing/Importing and A Complete Guide to PHP Namespaces.

1.2.22.1. Specs

Short name

Namespaces/Alias

Rulesets

All, Appinfo, CE, Changed Behavior

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

namespace

Available in

Entreprise Edition, Community Edition, Exakat Cloud