Changeset View
Changeset View
Standalone View
Standalone View
src/__tests__/PhutilLibraryTestCase.php
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | foreach ($classes as $class_name => $class) { | ||||
foreach (array_merge($parents, $interfaces) as $extends) { | foreach (array_merge($parents, $interfaces) as $extends) { | ||||
if ($extends->hasMethod($method_name)) { | if ($extends->hasMethod($method_name)) { | ||||
$xmethod = $extends->getMethod($method_name); | $xmethod = $extends->getMethod($method_name); | ||||
if (!$this->compareVisibility($xmethod, $method)) { | if (!$this->compareVisibility($xmethod, $method)) { | ||||
$failures[] = pht( | $failures[] = pht( | ||||
'Class "%s" implements method "%s" with the wrong visibility. '. | 'Class "%s" implements method "%s" with the wrong visibility. '. | ||||
'The method has visibility "%s", but it is defined in parent '. | 'The method has visibility "%s", but it is defined in parent '. | ||||
'"%s" with visibility "%s". In Phabricator, a method which '. | '"%s" with visibility "%s". A method which overrides another '. | ||||
'overrides another must always have the same visibility.', | 'must always have the same visibility.', | ||||
$class_name, | $class_name, | ||||
$method_name, | $method_name, | ||||
$this->getVisibility($method), | $this->getVisibility($method), | ||||
$extends->getName(), | $extends->getName(), | ||||
$this->getVisibility($xmethod)); | $this->getVisibility($xmethod)); | ||||
} | } | ||||
// We found a declaration somewhere, so stop looking. | // We found a declaration somewhere, so stop looking. | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |