Fix formatting

This commit is contained in:
Stéphane Goetz 2018-05-05 18:16:24 +02:00
parent 1e23b4ed90
commit 65f0679d7a
9 changed files with 15 additions and 13 deletions

View File

@ -27,7 +27,7 @@ class DauxCommand extends SymfonyCommand
$keys = explode('.', $key);
while (count($keys) > 1) {
$key = array_shift($keys);
if (! isset($array[$key]) || ! is_array($array[$key])) {
if (!isset($array[$key]) || !is_array($array[$key])) {
$array[$key] = [];
}
$array = &$array[$key];
@ -39,7 +39,7 @@ class DauxCommand extends SymfonyCommand
private function applyConfiguration(array $options, Daux $daux)
{
$values = array_map(
function ($value) {
function($value) {
return array_map("trim", explode('=', $value));
},
$options

View File

@ -25,7 +25,7 @@ class EmbedImages
{
return preg_replace_callback(
"/<img\\s+[^>]*src=['\"]([^\"]*)['\"][^>]*>/",
function ($matches) use ($file, $callback) {
function($matches) use ($file, $callback) {
if ($result = $this->findImage($matches[1], $matches[0], $file, $callback)) {
return $result;
}

View File

@ -19,7 +19,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
->embed(
$content,
$this->file,
function ($src, array $attributes, Entry $file) {
function($src, array $attributes, Entry $file) {
//Add the attachment for later upload
if ($file instanceof Raw) {

View File

@ -81,7 +81,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator
'Generating Tree ...',
$output,
$width,
function () use ($params) {
function() use ($params) {
$tree = $this->generateRecursive($this->daux->tree, $params);
$tree['title'] = $this->prefix . $params['title'];

View File

@ -82,7 +82,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator
'Copying Static assets ...',
$output,
$width,
function () use ($destination, $params) {
function() use ($destination, $params) {
$this->ensureEmptyDestination($destination);
$this->copyThemes($destination, $params->getThemesPath());
@ -196,7 +196,7 @@ class Generator implements \Todaymade\Daux\Format\Base\Generator, LiveGenerator
'- ' . $node->getUrl(),
$output,
$width,
function () use ($node, $output_dir, $key, $params, $index_pages) {
function() use ($node, $output_dir, $key, $params, $index_pages) {
if ($node instanceof Raw) {
copy($node->getPath(), $output_dir . DIRECTORY_SEPARATOR . $key);

View File

@ -17,7 +17,7 @@ class ContentPage extends \Todaymade\Daux\Format\Base\ContentPage
->embed(
$content,
$this->file,
function ($src, array $attributes, Raw $file) {
function($src, array $attributes, Raw $file) {
$content = base64_encode(file_get_contents($file->getPath()));
$attr = '';
foreach ($attributes as $name => $value) {

View File

@ -32,7 +32,9 @@ class Directory extends Entry implements \ArrayAccess, \IteratorAggregate
continue;
}
if (!$name) continue;
if (!$name) {
continue;
}
if ($name[0] == '-') {
if (is_numeric($name[1])) {
@ -82,7 +84,7 @@ class Directory extends Entry implements \ArrayAccess, \IteratorAggregate
private function sortBucket($bucket, $final)
{
uasort($bucket, function (Entry $a, Entry $b) {
uasort($bucket, function(Entry $a, Entry $b) {
return strcasecmp($a->getName(), $b->getName());
});