Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with doctrine/lexer v3 #21

Open
mortenscheel opened this issue Sep 7, 2023 · 4 comments · May be fixed by #22
Open

Not compatible with doctrine/lexer v3 #21

mortenscheel opened this issue Sep 7, 2023 · 4 comments · May be fixed by #22

Comments

@mortenscheel
Copy link

In v3, doctrine/lexer's Token class, the value has to be either string or int. So it throws a type error when you pass it a float.
A workaround is to downgrade doctrine/lexer to 2.1.0

Is this project still maintained?

@marcelthole marcelthole linked a pull request Feb 13, 2024 that will close this issue
@captain-igloo
Copy link

If you're not aware, @longitude-one has forked creof's wkt-parser and doctrine-spatial.

I have opened a PR to add support for doctrine/lexer 3 to wkt-parser. I would like to see doctrine-spatial updated as well but it depends on creof/geo-parser. Ideally longitude-one would fork creof/geo-parser as well (including your changes). Then wkt-parser, doctrine-spatial and geo-parser would be in one place.

longitude-one/wkt-parser#5

@Alexandre-T
Copy link

I just forked the geo-parser. This week, I will attempt to update the code (namespaces, GitHub action, code climate, etc.). Once I've made the changes, could you please push your PR to the new repository's dev branch? I'll take a look at it. Feel free to provide me with some information about the differences between these versions of doctrine/lexer

@captain-igloo
Copy link

Thanks Alexandre. The differences between doctrine/lexer 2 and 3:

  1. In doctrine/lexer 2, Token implements ArrayAccess and properties can be accessed like this $token['value']. In version 3 this has been dropped so they must be accessed as properties: $token->value.
  2. Token::$value is now typed as string|int, so float cannot be passed.

https://github.com/doctrine/lexer/blob/3.0.x/UPGRADE.md

@Alexandre-T
Copy link

Thank you. I now understand your PR. I will release three versions (v1, v2, v3) of the geo-parser, with each version corresponding to a specific doctrine/lexer version, to prevent any confusion with doctrine-spatial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants