chris48s / cakephp-geodistance

:cake: A CakePHP 3 geodistance model behavior :earth_africa:
https://packagist.org/packages/chris48s/cakephp-geodistance
MIT License
5 stars 1 forks source link

Configuration error #3

Closed abbeenorris closed 6 years ago

abbeenorris commented 6 years ago

Hi,

Having this error on my database whilst at the configuration stage:

"syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ']'"

Not sure why I am having this problem, if you could help that would be great.

Thanks

Abbie

chris48s commented 6 years ago

Somewhere in your code there is a syntax error, probably somewhere you're defining an array.

I suspect it is unrelated to this package, but if you can provide a reproducible test case (i.e: some example code I can use to cause this same behaviour so I can debug it), I'll have a look at it.

abbeenorris commented 6 years ago

Thanks for getting back to me so quickly.

I have attached the file I am working on, if you could have a quick look that would be fantastic. I think it is a case of i've been looking at the code for so long i've become blind to the error. Many Thanks.

SheltersTable.docx

chris48s commented 6 years ago

There's a missing comma:

$this->addBehavior('Chris48s/GeoDistance.GeoDistance' [
    'latitudeColumn' => 'lat',
    'longitudeColumn' => 'lng',
    'units' => 'km'
]);

should be

$this->addBehavior('Chris48s/GeoDistance.GeoDistance', [
    'latitudeColumn' => 'lat',
    'longitudeColumn' => 'lng',
    'units' => 'km'
]);

I see you've copied that from an example in the docs. My bad :man_facepalming: I've updated the example

abbeenorris commented 6 years ago

Thank you so much!