for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* Contains the HasModuleConfig trait.
*
* @copyright Copyright (c) 2021 Attila Fulop
* @author Attila Fulop
* @license MIT
* @since 2021-11-11
*/
namespace Konekt\Concord\Concerns;
trait HasModuleConfig
{
public function config(string $key = null, $default = null): mixed
$key = $key ? sprintf('%s.%s', $this->getId(), $key) : $this->getId();
getId()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$key = $key ? sprintf('%s.%s', $this->/** @scrutinizer ignore-call */ getId(), $key) : $this->getId();
return config($key, $default);
}
public function areMigrationsEnabled(): bool
return (bool) $this->config('migrations', true);
public function areModelsEnabled(): bool
return (bool) $this->config('models', true);
public function areViewsEnabled(): bool
return (bool) $this->config('views', true);
public function areRoutesEnabled(): bool
return (bool) $this->config('routes', true);