for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Noodlehaus\Writer;
use Noodlehaus\Exception\WriteException;
/**
* Base Writer.
*
* @package Config
* @author Jesus A. Domingo <[email protected]>
* @author Hassan Khan <[email protected]>
* @author Filip Š <[email protected]>
* @author Mark de Groot <[email protected]>
* @link https://github.com/noodlehaus/config
* @license MIT
*/
abstract class AbstractWriter implements WriterInterface
{
* {@inheritdoc}
public function toFile($config, $filename)
$contents = $this->toString($config);
$success = @file_put_contents($filename, $contents);
if ($success === false) {
throw new WriteException(['file' => $filename]);
}
return $contents;