Skip to main content

generate_php_protobuf

Function generate_php_protobuf 

Source
pub fn generate_php_protobuf(
    schema: &ProtobufSchema,
    target: &ProtobufTarget,
) -> Result<String>
Expand description

Generate PHP Protobuf code from a schema

Parses the Protobuf schema and generates complete PHP code with message type definitions, service clients, and server implementations based on the target specification. Generated code uses PSR-4 namespacing with PHP 8.1+ typed properties and the google/protobuf library.

§Arguments

  • schema - Parsed Protobuf schema
  • target - Generation target: ProtobufTarget::All (complete), ProtobufTarget::Messages (messages only), or ProtobufTarget::Services (services only)

§Returns

Generated PHP code as a string, or an error if generation fails