Skip to content

Commit 7232944

Browse files
committed
addTrait() second argument is deprecated (BC break)
1 parent 0698ed4 commit 7232944

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/PhpGenerator/Traits/TraitsAware.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function addTrait(string $name): TraitUse
5656
}
5757
$this->traits[$name] = $trait = new TraitUse($name);
5858
if (func_num_args() > 1 && is_array(func_get_arg(1))) { // back compatibility
59+
trigger_error('Passing second argument to ' . __METHOD__ . '() is deprecated, use addResolution() instead.');
5960
array_map(fn($item) => $trait->addResolution($item), func_get_arg(1));
6061
}
6162

0 commit comments

Comments
 (0)