for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is a part of Sculpin.
*
* (c) Dragonfly Development Inc.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symplify\PHP7_Sculpin\Configuration;
use Dflydev\DotAccessConfiguration\Configuration;
use Dflydev\DotAccessConfiguration\ConfigurationInterface;
final class SiteConfigurationFactory
{
/**
* @var string
private $rootDir;
public function __construct(string $rootDir)
$this->rootDir = $rootDir;
}
public function create() : ConfigurationInterface
if (file_exists($file = $this->rootDir.'/config/sculpin_site.yml')) {
return $this->getConfigFile($file);
return new Configuration();
* Get an instance of the Configuration() class from the given file.
private function getConfigFile(string $configFile) : ConfigurationInterface
$builder = new YamlFileConfigurationBuilder($configFile);
return $builder->build();