geoPHP
geoPHP copied to clipboard
Collection namespace too common
Complex project have many dependancies, so the class name "Collection" might collide with other classes. This is an example error message: Fatal error: Cannot redeclare class Collection in /project/vendor/phayes/geophp/lib/geometry/Collection.class.php on line 293 This issue can be fixed in two ways:
- Using a certain namespace for the library.
- Prefixing the classes.
This library needs some PSR-* :)
+1
Experiencing this issue integrating into another codebase. Working on implementing a new namespace for the project.
Hi,
What is the status for supporting at least PSR-0? This awesome lib seems unusable in modern projects without a proper namespacing.
Thanks!
Was anyone able to use this inside Laravel?
@jadjoubran We have just wrapped this in a simple package for laravel...
https://github.com/spinen/laravel-geometry
It is not done yet as we are going to wrap the adapters & geometries in namespaces classes, but it is a start. Hopefully it will be a little help to you...
@jimmypuckett wow awesome! Thanks
puts contributor hat on
+1 Was seriously looking at using this library until I found, to my surprise, it didn't use namespaces. Hopefully this can come in a future release.
Several forks of this repo use namespaces (including mine). I tried to contact the author if its worth preparing the PR, but with no response.