Skip to content

Commit

Permalink
Fix proto_path params order (#106)
Browse files Browse the repository at this point in the history
* Update ProtocCommandBuilder.php

* Fix test case
  • Loading branch information
roxblnfk authored Aug 2, 2024
1 parent 3bdc13c commit f86982f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/GRPC/ProtocCommandBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ private function getProtoFiles(string $protoDir): array
private function buildDirs(string $protoDir): string
{
$dirs = \array_filter([
$this->config->getServicesBasePath(),
// The current directory must be first in the import path list to avoid proto-file name conflicts.
$protoDir,
$this->config->getServicesBasePath(),
]);

if ($dirs === []) {
Expand Down
2 changes: 1 addition & 1 deletion tests/src/GRPC/ProtocCommandBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testBuild(): void
]);

$this->assertSame(
"protoc --plugin=path3 --php_out='path2' --php-grpc_out='path2' -I='path4' -I='path1' 'message.proto' 'service.proto' 2>&1",
"protoc --plugin=path3 --php_out='path2' --php-grpc_out='path2' -I='path1' -I='path4' 'message.proto' 'service.proto' 2>&1",
$builder->build('path1', 'path2')
);
}
Expand Down

0 comments on commit f86982f

Please sign in to comment.