marcj / php-rest-service

Php-Rest-Service is a very simple and fast PHP class for server-side RESTful JSON APIs.
MIT License
216 stars 74 forks source link

get an error ' count(): Parameter must be an array or an object that implements' #42

Closed espekkaya closed 4 years ago

espekkaya commented 4 years ago

Hello,

I'm using php 7. When I called my class method , I have hot an error below;

<b>Warning</b>:  count(): Parameter must be an array or an object that implements Countable in <b>C:\xampp\htdocs\piksel-ng\api\vendor\marcj\php-rest-service\RestService\Server.php</b> on line <b>836</b><br />
typix commented 4 years ago

disable PHP warnings, or insert: else $regexArguments = []; around line 813 in Server.php

supersonictw commented 4 years ago

The bug has been resolved in dev-master. But it seem haven't been pushed to packagist.

To resolve it, just need to switch "*" to "dev-master" until the author update.