Skip to content

Cache::doSaveDependingOnFiles() must be of the type int, null given #23

@Gappa

Description

@Gappa

Hi,

I'm testing the new version of Kdyby/Doctrine for Nette 3.0 and I got this error:

  • Argument 4 passed to Kdyby\DoctrineCache\Cache::doSaveDependingOnFiles() must be of the type int, null given, called in /vendor/kdyby/doctrine-cache/src/Cache.php on line 75

In previous version it could be null, now it has to an int:

The null value is passed from here:

  • /doctrine/orm/lib/Doctrine/ORM/Query.php:285
  • Doctrine\Common\Cache\CacheProvider->save()

Changing the function to allow null values for $lifeTime fixes it, but I have no clue what the implications might be:

protected function doSaveDependingOnFiles(string $id, $data, array $files, ?int $lifeTime = 0): bool

Or even if null should be ever passed from other parts of Doctrine code.

Also, I think that the doSave method will be affected just the same.

Relevant composer packages info:

doctrine/annotations             v1.7.0             
doctrine/cache                   v1.8.0             
doctrine/collections             v1.6.2             
doctrine/common                  v2.10.0            
doctrine/data-fixtures           v1.3.2             
doctrine/dbal                    v2.9.2             
doctrine/event-manager           v1.0.0             
doctrine/inflector               v1.3.0             
doctrine/instantiator            1.2.0              
doctrine/lexer                   1.1.0              
doctrine/orm                     2.7.x-dev 9e73672  
doctrine/persistence             1.1.1              
doctrine/reflection              v1.0.0             
kdyby/annotations                v3.0.1             
kdyby/console                    dev-master 65800ea 
kdyby/doctrine                   dev-master 48e34c7 
kdyby/doctrine-cache             v3.0.0             
kdyby/events                     dev-master c0ab8d2 
kdyby/strict-objects             v2.0.0             
kdyby/translation                v3.0.0  
nette/bootstrap                  v3.0.0             
nette/caching                    v3.0.0             
nette/component-model            v3.0.0             
nette/di                         v3.0.1             
nette/finder                     dev-master 0dd1263 
nette/forms                      v3.0.1             
nette/http                       v3.0.2             
nette/mail                       v3.1.0             
nette/neon                       v3.0.0             
nette/php-generator              v3.2.3             
nette/reflection                 v2.4.2             
nette/robot-loader               dev-master 9ae6fc2 
nette/routing                    v3.0.0             
nette/schema                     v1.0.0             
nette/security                   v3.0.1             
nette/tester                     v2.3.0             
nette/utils                      v3.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions