nextras / orm

Orm with clean object design, smart relationship loading and powerful collections.
https://nextras.org/orm
MIT License
310 stars 57 forks source link

CachedPlatform - error at 2.0.0-beta3 #154

Closed f3l1x closed 8 years ago

f3l1x commented 8 years ago

Beta2: works Beta3: not works

Throwed:

_Argument 2 passed to Nextras\Dbal\Platforms\CachedPlatform::_construct() must implement interface Nette\Caching\IStorage, instance of Nette\Caching\Cache given, called in ...vendor/nextras/orm/src/Mapper/Dbal/StorageReflection/StorageReflection.php on line 52 in .../vendor/nextras/dbal/src/Platforms/CachedPlatform.php:25

hrach commented 8 years ago

Update also nextras Dbal.

f3l1x commented 8 years ago

I have only "nextras\orm: ~2.0.0" with "minimum-stability": "dev" in my composer.json.

hrach commented 8 years ago

So try to run proper update of all. Dependencies are defined correctly.

f3l1x commented 8 years ago

Are you sure?

https://github.com/nextras/dbal/blob/v2.0.0-beta2/src/Platforms/CachedPlatform.php

class CachedPlatform implements IPlatform
{
    /** @var IPlatform */
    private $platform;
    /** @var Cache */
    private $cache;
    public function __construct(Connection $connection, IStorage $storage)
    {
        $key = md5(json_encode($connection->getConfig()));
        $this->platform = $connection->getPlatform();
        $this->cache = new Cache($storage, "nextras.dbal.platform.$key");
    }
hrach commented 8 years ago

Yes. This is a tag, the dev is master, where it's ok. https://github.com/nextras/dbal/blob/17c1e7f851ef89a571b8c187da2e290d7cf1edfa/composer.json#L30-L32

hrach commented 8 years ago

I suggest you adding nextras/dbal as dependency, you definitely use it directly, so it should be your dependency.