[BUG #7980] tag cache id for class dependencies with 'statics' optimization

- the cache id for the class dependencies has to distinguish between 'statics'
  being on or not
- otherwise, cache entries are being used for 'statics' dependencies that were
  generated when 'statics' were off
- checking this when using the 'dependencies.json' file is not enough