rackspace / php-opencloud

The PHP SDK for OpenStack clouds
developer.rackspace.com
Other
451 stars 250 forks source link

Error with PHP 7.2.10 #735

Open simongustavo opened 5 years ago

simongustavo commented 5 years ago

Hi,

I've been struggling to work with the v2 version of this library. I've installed composer require rackspace/php-opencloud:2.x-dev and I'm getting many errors. Documentation is quite poor, I'm just relying on the samples. Is this abandoned or should I use OpenStack library directly?

` $rackspace = new Rackspace\Rackspace([ 'username' => $this->RACKSPACE_USERNAME, 'apiKey' => $this->RACKSPACE_API_KEY, ]);

        /** @var array $metadata */
        $metadata = $rackspace->objectStoreV1()
                              ->getContainer('somecontainer')
                              ->getMetadata();

`

I'm getting

Fatal error: Declaration of Rackspace\Identity\v2\Service::factory(GuzzleHttp\ClientInterface $client) must be compatible with OpenStack\Identity\v2\Service::factory(GuzzleHttp\ClientInterface $client): OpenStack\Identity\v2\Service in /home/vagrant/www-data/common/vendor/rackspace/php-opencloud/src/Identity/v2/Service.php on line 7

Using guzzlehttp version 6.3.3

Thanks

DrizzlyOwl commented 4 years ago

That guzzle version is not supported in this PHP Openstack library. If you look at the composer.json file for this project you will see that it was built to support (the now legacy) "guzzle/guzzle" : "~3.8",