for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* FastCGI Cache Bust plugin for Craft CMS 3.x
*
* Bust the Nginx FastCGI Cache when entries are saved or created.
* @link https://nystudio107.com
* @copyright Copyright (c) 2017 nystudio107
*/
namespace nystudio107\fastcgicachebust\services;
use craft\helpers\ArrayHelper;
use nystudio107\fastcgicachebust\services\Cache as CacheService;
use yii\base\InvalidConfigException;
* @author nystudio107
* @package FastcgiCacheBust
* @since 1.0.11
* @property CacheService cache
trait ServicesTrait
{
// Public Methods
// =========================================================================
$id
$parent
$config
* @inheritdoc
public function __construct($id, $parent = null, array $config = [])
// Merge in the passed config, so it our config can be overridden by Plugins::pluginConfigs['recipe']
// ref: https://github.com/craftcms/cms/issues/1989
$config = ArrayHelper::merge([
'components' => [
'cache' => CacheService::class,
]
], $config);
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:
someFunctionCall( $firstArgument, $secondArgument, $thirdArgument ); // Closing parenthesis on a new line.
parent::__construct($id, $parent, $config);
}
* Returns the nutritionApi service
* @return CacheService The cache service
* @throws InvalidConfigException
public function getCache(): CacheService
return $this->get('cache');
get()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return $this->/** @scrutinizer ignore-call */ get('cache');