Skip to content

Commit

Permalink
Added a compiler warning when a package-namespace mapping is overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
drslump committed Jul 15, 2011
1 parent bb750b3 commit 87a33b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/DrSlump/Protobuf/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ public function compile($data)
foreach($req->getProtoFileList() as $proto) {
$package = $proto->getPackage();
$namespace = $generator->getNamespace($proto);
if (isset($this->packages[$package]) && $namespace !== $this->packages[$package]) {
$this->warning("Package $package was already mapped to {$this->packages[$package]} but has now been overridden to $namespace");
}
$this->packages[$package] = $namespace;
$this->notice("Mapping $package to $namespace");
}
Expand Down

0 comments on commit 87a33b6

Please sign in to comment.