FriendsOfCake / crud

Production-grade rapid controller development with built in love for API and Search
https://crud.readthedocs.io/en/latest/
MIT License
376 stars 145 forks source link

Cannot use class 'object' with PHP 7.2 #565

Closed ewbarnard closed 6 years ago

ewbarnard commented 6 years ago

Fatal error:

Fatal error: Cannot use Crud\Core\Object as Object because 'Object' is a special class name in ...vendor/friendsofcake/crud/src/Listener/BaseListener.php on line 4

Reference: http://php.net/manual/en/reserved.other-reserved-words.php

This seems to have hit a number of other libraries as well.

Edit: The files to fix are:

bravo-kernel commented 6 years ago

Are you using a recent version? This seems to have been solved some time ago. https://github.com/FriendsOfCake/crud/pull/548.

ewbarnard commented 6 years ago

'composer show | grep -i crud' shows friendsofcake/crud 4.4.4. I'll investigate further.

bravo-kernel commented 6 years ago

I think you should upgrade to crud version 5 as this is far from a recent version (if I am reading this right https://packagist.org/packages/friendsofcake/crud)

ewbarnard commented 6 years ago

Aha! I was using your tutorial http://www.bravo-kernel.com/2015/04/how-to-build-a-cakephp-3-rest-api-in-minutes/ which specifies ~4.0 and not thinking that through. My fault entirely. We can close this issue out. And thank you kindly for the tutorial.

@bravo-kernel What's the best way to contact you with a question related to that tutorial? No need to clutter the issue comments here.

bravo-kernel commented 6 years ago

I see, would you mind PR'ing the tutorial so it uses 5 ?

Best way to get support is through the irc/slack channel.

ewbarnard commented 6 years ago

I'll get you a PR tonight or tomorrow evening. Thanks!

bravo-kernel commented 6 years ago

Awesome, much obliged 👍

davidyell commented 6 years ago

Also, worth noting the composer outdated command to see which packages are behind the latest release.

bravo-kernel commented 6 years ago

Updated the blog to mention composer require friendsofcake/crud:^5.0

Nishantaryan commented 5 years ago

I think you should upgrade to crud version 5 as this is far from a recent version (if I am reading this right https://packagist.org/packages/friendsofcake/crud)

It worked i upgraded to Crud 5