Kdyby / DoctrineCache

Doctrine 2 Cache integration into Nette Framework
https://packagist.org/packages/kdyby/doctrine-cache
Other
10 stars 21 forks source link

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

Open Gappa opened 5 years ago

Gappa commented 5 years ago

Hi,

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

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

The null value is passed from here:

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
Spamercz commented 4 years ago

Ok, lets make it nullable first. After we can try fix all callings of this method from other packages if needed.