Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Gappa opened this issue Aug 23, 2019 · 1 comment
Open

Comments

@Gappa
Copy link

Gappa commented Aug 23, 2019

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
dfx413 added a commit to dfx413/DoctrineCache that referenced this issue Dec 2, 2019
dfx413 added a commit to dfx413/DoctrineCache that referenced this issue Dec 2, 2019
@Spamercz
Copy link
Member

Spamercz commented Dec 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants