Skip to content

Windows compatibility #10

@johnsondennis

Description

@johnsondennis

When loading the loadDynamicDTORules method, you have to trim the characters as windows systems add addition characters at the end of each array value at the following section.

$this->dataTypeRules[substr($prop[1], 1)] = $prop[0];

The above section needs to be updated to:

$this->dataTypeRules[trim(substr($prop[1], 1))] = $prop[0];

Error output:
`Symfony\Component\Debug\Exception\FatalThrowableError : Undefined property: PHPExperts\BitrixBot\DTOs\BitrixConfig::$serviceURL.

at C:\Users\dsalewi\Documents\Repositories\automated-bitrix\vendor\phpexperts\simple-dto\src\SimpleDTO.php:274
270| {
271| // dd($property, $value);
272| if (!isset($this->dataTypeRules[$property])) {
273| $self = static::class;

274| throw new Error("Undefined property: {$self}::${$property}.");`

The actual array output
-dataTypeRules: array:3 [ "serviceURL\r" => "?string" "username\r" => "?string" "password\r" => "?string"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions