for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Borobudur-Config package.
*
* (c) Hexacodelabs <http://hexacodelabs.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Borobudur\Config\FileLoader;
use Symfony\Component\Yaml\Yaml;
/**
* @author Iqbal Maulana <[email protected]>
* @created 8/12/15
class YamlFileLoader extends AbstractFileLoader
{
* @var array
protected $extensions = array('yml');
* {@inheritdoc}
public function import(FileLocator $file)
$this->validateExtension($file->getExtension());
return Yaml::parse($file->readFile());
}
public function write(array $configs, $file)
$this->validateExtension(pathinfo($file, PATHINFO_EXTENSION));
$this->writeFile(Yaml::dump($configs, 10), $file);