Uses Traits is one of the interactive graphs Understand can draw of your code — call trees, dependencies, control flow, and more.
Uses Traits
Languages: WebTargets: Classes
Variants: Classic, Cluster, Compare, Relationship, Simplified
Show the PHP traits a selected class or trait uses, directly or indirectly.
For a selected PHP class or trait, this shows an edge to each trait it uses in a use statement, then recurses into each of those traits’ own uses, building a multi-level tree.
Rooted at Trackable below, the graph shows it using Auditable and Sluggable, which use Timestampable and Identifiable respectively, neither of which uses anything further. The inverse graph, Used By, shows the reverse relationship — everything that uses the selected class or trait, directly or indirectly.
See the following code and corresponding graph
trait Trackable {
use Auditable;
use Sluggable;
}
trait Auditable {
use Timestampable;
}
trait Sluggable {
use Identifiable;
}
trait Timestampable {
}
trait Identifiable {
}
Uses Traits - Classic
The Classic variant is similar to the Simplified variant, showing all relationships in a simple tree, but it uses a custom layout algorithm instead of Graphviz.
Uses Traits - Cluster
The Cluster variant groups entities by their containing class/file/architecture.
Uses Traits - Compare
The Compare variant shows how the graph has changed relative to the project's comparison database.
Uses Traits - Relationship
The Relationship variant filters the graph to only paths connecting the two entities.
Uses Traits - Simplified
The Simplified variant shows all relationships in a simple tree (no clusters)