Skip to content

Possibly Null Argument in bcdiv() scale #10103

@TheDevick

Description

@TheDevick

This Code:

<?php

class Math
{
    public function __construct(
        public readonly ?int $scale = null
    ) {
    }

    /**
     * @param numeric-string $x
     * @param numeric-string $y
     *
     * @return numeric-string
     */
    public function div(string $x, string $y): string
    {
        return bcdiv($x, $y, $this->scale);
    }
}

image

In the bcdiv() docs, we can see that the scale can be Nullable

  • Psalm Version: 5.14.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions