rinvex/laravel-repositories

View on GitHub
src/Traits/Cacheable.php

Summary

Maintainability
A
35 mins
Test Coverage

Showing 2 of 2 total issues

Function forgetCache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public function forgetCache()
{
if ($this->getCacheLifetime()) {
// Flush cache tags
if (method_exists($this->getContainer('cache')->getStore(), 'tags')) {
Severity: Minor
Found in src/Traits/Cacheable.php - About 35 mins to fix

Avoid assigning values to variables in if clauses and the like (line '211', column '13').
Open

protected function cacheCallback($class, $method, $args, Closure $closure)
{
$repositoryId = $this->getRepositoryId();
$lifetime = $this->getCacheLifetime();
$hash = $this->generateCacheHash($args);
Severity: Minor
Found in src/Traits/Cacheable.php by phpmd
Category
Status