IsraelOrtuno / pipedrive

Complete Pipedrive API client for PHP
MIT License
166 stars 58 forks source link

Resource is a reserved class name #60

Closed mastef closed 5 years ago

mastef commented 5 years ago

I'm getting an error on PHP 7 / HHVM, as Resource is now a reserved name.

Fatal error: Uncaught Error: Cannot use '\\Devio\\Pipedrive\\Resources\\Basics\\Resource' as class name as it is reserved in vendor/devio/pipedrive/src/Resources/Pipelines.php

Renaming the Resource class name to something else fixed this issue.

mastef commented 5 years ago

It seems to me that this is a common hhvm issue. Also running into Fatal error: Uncaught Error: array_creation_expression is not allowed in write context within the illuminate/support dependency vendor/illuminate/support/Arr.php:388 which doesn't like [$value, $key] = someMethod(); syntax, based on Laravel's changes, which are only compatible with PHP 7.1+, and atm not implemented/supported within HHVM and older PHP versions.

So currently this package is only compatible from PHP 7.1+ on based on the dependencies.

IsraelOrtuno commented 5 years ago

This last issue is due Illuminate/Support package 5.7+. This package should not be installed if you do not have PHP 7.1+ installed, right?

For the HHVM you could manually require Illuminate/Support 5.6 in your composer and should do the trick.

IsraelOrtuno commented 5 years ago

For the reserved name... I will consider changing it, but it may be a breaking change for all those which are extending the API using this class, will have to tag a major version.

Thanks for reporting :)