nette / neon

🍸 Encodes and decodes NEON file format.
https://ne-on.org
Other
906 stars 32 forks source link

Octal numbers are translated as string #70

Closed h4kuna closed 4 months ago

h4kuna commented 4 months ago

Version: 3.4.2

Bug Description

After update from 3.4.1 neon translate octal numbers as string

Steps To Reproduce

EDIT: missing extension bcmath

Neon configuration

- h4kuna\Uget\File(0o666)
namespace h4kuna\Uget;

final class File
{
    public function __construct(private int $permission)
    {
    }
}

v3.4.1 create container method like

public function createService012(): h4kuna\Uget\File
{
    return new h4kuna\Uget\File(438);
}

v3.4.2 create container method like

public function createService012(): h4kuna\Uget\File
{
    return new h4kuna\Uget\File('438');
}

I get exception TypeError: h4kuna\Uget\File::__construct(): Argument #1 ($permission) must be of type int, string given

Expected Behavior

Same as v3.4.1

h4kuna commented 4 months ago

I found the change commit and I did not have the bcmath extension installed.

If I installed extension, the transform works fine. But here is different behavior for small integers.

dg commented 4 months ago

fixed