Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/query/PhabricatorOwnersPackageQuery.php
| Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Lines | public function getControllingPackagesForPath($repository_phid, $path) { | ||||
| $packages = $this->controlResults; | $packages = $this->controlResults; | ||||
| $matches = array(); | $matches = array(); | ||||
| foreach ($packages as $package_id => $package) { | foreach ($packages as $package_id => $package) { | ||||
| $best_match = null; | $best_match = null; | ||||
| $include = false; | $include = false; | ||||
| foreach ($package->getPaths() as $package_path) { | foreach ($package->getPaths() as $package_path) { | ||||
| if ($package_path->getRepositoryPHID() != $repository_phid) { | |||||
| // If this path is for some other repository, skip it. | |||||
| continue; | |||||
| } | |||||
| $strength = $package_path->getPathMatchStrength($path); | $strength = $package_path->getPathMatchStrength($path); | ||||
| if ($strength > $best_match) { | if ($strength > $best_match) { | ||||
| $best_match = $strength; | $best_match = $strength; | ||||
| $include = !$package_path->getExcluded(); | $include = !$package_path->getExcluded(); | ||||
| } | } | ||||
| } | } | ||||
| if ($best_match && $include) { | if ($best_match && $include) { | ||||
| Show All 14 Lines | |||||