temporalio / temporalio/sdk-php

Improve PHP files generated from proto

Open
#318 0 comments 0 reactions 1 assignee View on GitHub

@roxblnfk is already working on this.

Since Sep 1, 2023.

enhancement
Dominant language
PHP
Stars
421
Forks
64
Avg merge
1d 1h
Merged PRs (30d)
11

Description

Is your feature request related to a problem? Please describe.

There are a lot of Psalm issues related with usage of PHP files generated from proto (messages).
For example:

$details = $info->hasDetails()
    // psalm: PossiblyNullArgument: Argument 1 of EncodedValues::fromPayloads cannot be null, possibly null value provided
    ? EncodedValues::fromPayloads($info->getDetails(), $converter)
    : EncodedValues::empty();
Describe the solution you'd like

That case will be fixed if we add additional annotations in generated files fike this:

/**
 * ...
 * @psalm-mutation-free
 */
public function getDetails() { ... }

/**
 * @psalm-assert-if-true !null $this->getDetails()
 * @psalm-mutation-free
 */
public function hasDetails() { ... }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.