for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ubiquity\translation\import;
class YamlImportation extends AbstractImportation {
public function load() {
$content = file_get_contents($this->file);
$lines = explode("\n", $content);
$result = [];
foreach ($lines as $line) {
$line = trim($line);
if (substr($line, 0, strlen('#')) !== '#') {
$kv = explode(':', $line);
if (sizeof($kv) == 2) {
$result[trim($kv[0])] = trim($kv[1]);
}
return $result;