mirror of
https://github.com/php/php-src.git
synced 2024-10-01 23:06:11 +00:00
c5ba229617
- aliases that are not actually matching anything are treated as errors now. This will make sure that all methods that are expected to be in a class are actually there, or in case a trait changed for instance, that the code breaks already on composition - Precedence declarations are also checked to ensure that the method which is supposed to take precedence actually exists, however, the other traits mentioned in the declaration are not regarded. We are more lenient here, since this avoids unnecessary fragility. - fixed another seamingly unrelated test which broke in the progress but wasn't clear before either.
18 lines
329 B
PHP
18 lines
329 B
PHP
--TEST--
|
|
Bug #60165 (Aliasing unexisting trait should throw/trigger the exception/error)
|
|
--FILE--
|
|
<?php
|
|
|
|
trait A {
|
|
public function bar() {}
|
|
}
|
|
|
|
class MyClass {
|
|
use A {
|
|
A::nonExistent as barA;
|
|
}
|
|
}
|
|
|
|
--EXPECTF--
|
|
Fatal error: An alias was defined for A::nonExistent but this method does not exist in %s on line %d
|