4.2.33. Rename Class

Rename a trait into another one.

The rename applies the new name to the trait, and its usage : use cases in classes and traits, static calls (PHP 8.0-).

4.2.33.1. Before

<?php
trait t {}

class x {
     use t;
}

?>

4.2.33.2. After

<?php
trait newT {}

class x {
     use newT;
}

?>

4.2.33.3. Parameters

Name

Default

Type

Description

origin

string

The class to rename

destination

string

The destination’s class name

4.2.33.4. Specs

Short Name

Traits/RenameTrait

Exakat version

2.3.0

Available in