mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 13:38:22 +01:00
Format php files
This commit is contained in:
parent
085cef77a7
commit
a18df4a0f8
@ -24,5 +24,4 @@ return function (App $app) {
|
||||
throw new ValidationException(sprintf('Invalid value for field "%s" of type "%s"', $field->name(), $field->type()));
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -48,5 +48,4 @@ return function (Languages $languages) {
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -30,5 +30,4 @@ return function (App $app) {
|
||||
return $value;
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -20,5 +20,4 @@ return function (App $app) {
|
||||
'names' => LanguageCodes::names(),
|
||||
],
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -36,5 +36,4 @@ return function (App $app) {
|
||||
return $value;
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -24,5 +24,4 @@ return function (App $app) {
|
||||
return $value;
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -46,5 +46,4 @@ return function (Site $site) {
|
||||
return str_replace("\r\n", "\n", (string) $value);
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -32,5 +32,4 @@ return function (App $app) {
|
||||
return (string) $value;
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -30,5 +30,4 @@ return function (App $app) {
|
||||
return $value;
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -37,5 +37,4 @@ return function (App $app) {
|
||||
return array_values(array_filter($value));
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -32,5 +32,4 @@ return function (App $app) {
|
||||
return (string) $value;
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -27,5 +27,4 @@ return function (App $app) {
|
||||
return str_replace("\r\n", "\n", (string) $value);
|
||||
},
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -14,7 +14,6 @@ class ErrorHandlers
|
||||
{
|
||||
public function __construct(protected ViewFactory $viewFactory, protected Request $request)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,7 +11,6 @@ class FieldFactory
|
||||
{
|
||||
public function __construct(protected Container $container, protected Config $config, protected Translations $translations)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,6 @@ class File implements Arrayable, Stringable
|
||||
return $this->hash = $hash;
|
||||
}
|
||||
throw new RuntimeException('Cannot calculate file hash');
|
||||
|
||||
}
|
||||
|
||||
public function setUriGenerator(FileUriGenerator $uriGenerator): void
|
||||
|
@ -14,7 +14,6 @@ class FileFactory
|
||||
*/
|
||||
public function __construct(protected Container $container, protected array $associations = [])
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function make(string $path): File
|
||||
|
@ -14,7 +14,6 @@ class FileUploader
|
||||
{
|
||||
public function __construct(protected Config $config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,6 @@ class FileUriGenerator
|
||||
{
|
||||
public function __construct(protected Config $config, protected Router $router, protected Site $site)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function generate(File $file): string
|
||||
|
@ -35,8 +35,10 @@ class JpegHandler extends AbstractHandler
|
||||
];
|
||||
|
||||
foreach ($this->decoder->decode($this->data) as $segment) {
|
||||
if ($segment['type'] > 0xbf && $segment['type'] < 0xc3
|
||||
|| $segment['type'] > 0xc8 && $segment['type'] < 0xcc) {
|
||||
if (
|
||||
$segment['type'] > 0xbf && $segment['type'] < 0xc3
|
||||
|| $segment['type'] > 0xc8 && $segment['type'] < 0xcc
|
||||
) {
|
||||
$info['colorDepth'] = ord($segment['value'][0]);
|
||||
$info['height'] = unpack('n', $segment['value'], 1)[1];
|
||||
$info['width'] = unpack('n', $segment['value'], 3)[1];
|
||||
|
@ -9,7 +9,6 @@ class Desaturate extends AbstractTransform
|
||||
{
|
||||
final public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): static
|
||||
|
@ -9,7 +9,6 @@ class EdgeDetect extends AbstractTransform
|
||||
{
|
||||
final public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): static
|
||||
|
@ -9,7 +9,6 @@ class Emboss extends AbstractTransform
|
||||
{
|
||||
final public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): static
|
||||
|
@ -9,7 +9,6 @@ class Invert extends AbstractTransform
|
||||
{
|
||||
final public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): static
|
||||
|
@ -9,7 +9,6 @@ class Sharpen extends AbstractTransform
|
||||
{
|
||||
final public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): static
|
||||
|
@ -9,7 +9,6 @@ class Smoothen extends AbstractTransform
|
||||
{
|
||||
final public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): static
|
||||
|
@ -8,7 +8,6 @@ class TemplateFactory
|
||||
{
|
||||
public function __construct(protected Container $container)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function make(string $name): Template
|
||||
|
@ -72,7 +72,6 @@ class BackupController extends AbstractController
|
||||
return $this->redirectToReferer(default: '/dashboard/');
|
||||
}
|
||||
throw new RuntimeException($this->translate('panel.backup.error.cannotDelete.invalidFilename'));
|
||||
|
||||
} catch (TranslatedException $e) {
|
||||
$this->panel()->notify($this->translate('panel.backup.error.cannotDelete', $e->getTranslatedMessage()), 'error');
|
||||
return $this->redirectToReferer(default: '/dashboard/');
|
||||
|
@ -130,7 +130,6 @@ class PagesController extends AbstractController
|
||||
throw new UnexpectedValueException('Unexpected missing page route');
|
||||
}
|
||||
return $this->redirect($this->generateRoute('panel.pages.edit.lang', ['page' => trim($page->route(), '/'), 'language' => $this->site()->languages()->default()]));
|
||||
|
||||
}
|
||||
|
||||
if ($page->languages()->available()->has($language)) {
|
||||
@ -334,7 +333,6 @@ class PagesController extends AbstractController
|
||||
} catch (TranslatedException $e) {
|
||||
$this->panel()->notify($this->translate('upload.error', $e->getTranslatedMessage()), 'error');
|
||||
return $this->redirect($this->generateRoute('panel.pages.edit', ['page' => $routeParams->get('page')]));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +363,6 @@ class PagesController extends AbstractController
|
||||
|
||||
$this->panel()->notify($this->translate('panel.pages.page.fileDeleted'), 'success');
|
||||
return $this->redirect($this->generateRoute('panel.pages.edit', ['page' => $routeParams->get('page')]));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -196,7 +196,6 @@ class UsersController extends AbstractController
|
||||
$userData = [...$user->toArray(), ...$data];
|
||||
|
||||
Yaml::encodeToFile($userData, FileSystem::joinPaths($this->config->get('system.panel.paths.accounts'), $user->username() . '.yaml'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,6 @@ class UserFactory
|
||||
{
|
||||
public function __construct(protected Container $container)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,6 @@ class Schemes
|
||||
|
||||
public function __construct(protected Container $container)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -166,13 +166,10 @@ class Container
|
||||
$loaderInstance = $this->build($loader, $parameters);
|
||||
|
||||
$service = $loaderInstance->load($this);
|
||||
|
||||
} elseif ($object === null) {
|
||||
$service = $this->build($name, $parameters);
|
||||
|
||||
} elseif ($object instanceof Closure) {
|
||||
$service = $this->call($object, $parameters);
|
||||
|
||||
} else {
|
||||
$service = $object;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ class LanguagesServiceLoader implements ServiceLoaderInterface
|
||||
{
|
||||
public function __construct(protected Config $config, protected Request $request)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function load(Container $container): Languages
|
||||
|
@ -13,7 +13,6 @@ class SchemesServiceLoader implements ResolutionAwareServiceLoaderInterface
|
||||
{
|
||||
public function __construct(protected Config $config, protected Languages $languages)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function load(Container $container): object
|
||||
|
@ -15,7 +15,6 @@ class SiteServiceLoader implements ResolutionAwareServiceLoaderInterface
|
||||
{
|
||||
public function __construct(protected Config $config, protected Languages $languages, protected Schemes $schemes)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function load(Container $container): Site
|
||||
@ -28,7 +27,6 @@ class SiteServiceLoader implements ResolutionAwareServiceLoaderInterface
|
||||
'path' => $this->config->get('system.content.path'),
|
||||
'languages' => $this->languages,
|
||||
] + $config]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,7 +12,6 @@ class TranslationsServiceLoader implements ResolutionAwareServiceLoaderInterface
|
||||
{
|
||||
public function __construct(protected Config $config, protected Languages $languages)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function load(Container $container): object
|
||||
|
@ -204,7 +204,6 @@ class Debug
|
||||
. ($reference ? '<span class="__note" title="Reference">&</span>' : '')
|
||||
. static::outputData($value, $indent + self::INDENT_SPACES)
|
||||
. ',';
|
||||
|
||||
}
|
||||
|
||||
return sprintf("<span class=\"__type-array\">array</span>(<span class=\"__note\">%d</span>) [<span class=\"__formwork-dump-toggle\" onclick=\"__formwork_dump_toggle(this)\" data-target=\"__formwork-dump-id-%2\$d\">▼</span>\n<div class=\"__formwork-dump-collapsed\" id=\"__formwork-dump-id-%d\">%s</div>%s]", count($data), ++static::$counter, implode("\n", $parts), str_repeat(' ', $indent));
|
||||
|
@ -157,7 +157,6 @@ class MimeType
|
||||
$mimeType = static::fromExtension('svg');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $mimeType ?: self::DEFAULT_MIME_TYPE;
|
||||
|
@ -13,7 +13,6 @@ class ViewFactory
|
||||
*/
|
||||
public function __construct(protected array $methods, protected App $app, protected Config $config)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,3 +1,4 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title><?= $message ?? 'Internal Server Error' ?> | Formwork</title>
|
||||
<meta charset="utf-8">
|
||||
@ -19,7 +20,8 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1, h2 {
|
||||
h1,
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
letter-spacing: -0.027rem;
|
||||
line-height: 1.2;
|
||||
@ -71,6 +73,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
|
@ -10,5 +10,4 @@ return function (Config $config, Panel $panel) {
|
||||
|
||||
'icon' => fn (string $icon) => FileSystem::read(FileSystem::joinPaths($config->get('system.panel.paths.assets'), '/icons/svg/', $icon . '.svg')),
|
||||
];
|
||||
|
||||
};
|
||||
|
@ -13,4 +13,3 @@
|
||||
'disabled' => $field->isDisabled(),
|
||||
'hidden' => $field->isHidden(),
|
||||
]) ?>>
|
||||
|
||||
|
@ -7,25 +7,13 @@
|
||||
'disabled' => $field->isDisabled(),
|
||||
'hidden' => $field->isHidden(),
|
||||
]) ?>>
|
||||
<?php
|
||||
if (!$field->isRequired()):
|
||||
?>
|
||||
<?php if (!$field->isRequired()) : ?>
|
||||
<option value="" <?php if ($field->value() === '') : ?> selected<?php endif ?>><?= $this->translate('page.none') ?></option>
|
||||
<?php
|
||||
endif
|
||||
?>
|
||||
<?php
|
||||
if ($field->get('allowSite')):
|
||||
?>
|
||||
<?php endif ?>
|
||||
<?php if ($field->get('allowSite')) : ?>
|
||||
<option value="." <?php if ($field->value() === '.') : ?> selected<?php endif ?>><?= $this->translate('panel.pages.newPage.site') ?> (/)</option>
|
||||
<?php
|
||||
endif
|
||||
?>
|
||||
<?php
|
||||
foreach ($field->collection() as $page):
|
||||
?>
|
||||
<?php endif ?>
|
||||
<?php foreach ($field->collection() as $page) : ?>
|
||||
<option value="<?= $page->route() ?>" <?php if ($page->route() === $field->value()) : ?> selected<?php endif ?>><?= str_repeat('— ', $page->level() - 1) . $page->title() ?></option>
|
||||
<?php
|
||||
endforeach
|
||||
?>
|
||||
<?php endforeach ?>
|
||||
</select>
|
@ -1,6 +1,8 @@
|
||||
<div id="slugModal" class="modal" aria-labelledby="slugModalLabel">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header"><div class="caption" id="slugModalLabel"><?= $this->translate('panel.pages.changeSlug') ?></div></div>
|
||||
<div class="modal-header">
|
||||
<div class="caption" id="slugModalLabel"><?= $this->translate('panel.pages.changeSlug') ?></div>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<label class="form-label" for="page-slug"><?= $this->translate('panel.pages.newPage.slug') ?>:</label>
|
||||
<span class="form-label-suggestion">(<?= $this->translate('panel.pages.newPage.slugSuggestion') ?>)</span>
|
||||
|
@ -13,4 +13,3 @@
|
||||
<?php $this->insert('fields', ['fields' => $fields]) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
@ -1,2 +1,4 @@
|
||||
<script src="<?= $this->assets()->uri('js/app.min.js', true) ?>" integrity="<?= $this->assets()->integrityHash('js/app.min.js') ?>"></script>
|
||||
<script>Formwork.app.load(<?= $appConfig ?>);</script>
|
||||
<script>
|
||||
Formwork.app.load(<?= $appConfig ?>);
|
||||
</script>
|
@ -5,7 +5,8 @@ $posts = $page->children()->published();
|
||||
|
||||
// If the route has the param `{tagName}`
|
||||
if ($router->params()->has('tagName')) {
|
||||
$posts = $posts->filterBy('tags', // Filter posts by tags...
|
||||
$posts = $posts->filterBy(
|
||||
'tags', // Filter posts by tags...
|
||||
fn ($tags) => $tags
|
||||
->map(fn ($tag) => $this->slug($tag)) // where the collection of their slugs...
|
||||
->contains($router->params()->get('tagName')) // contains the value of the `tagName` param.
|
||||
|
@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= $site->languages()->current() ?>">
|
||||
|
||||
<head>
|
||||
<title><?= $page->title() ?> | <?= $site->title() ?></title>
|
||||
<?= $this->insert('_meta') ?>
|
||||
@ -7,6 +8,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="<?= $this->assets()->uri('css/style.min.css') ?>">
|
||||
<script src="<?= $this->assets()->uri('js/script.min.js') ?>"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?= $this->insert('_menu') ?>
|
||||
<?= $this->insert('_cover-image') ?>
|
||||
@ -17,4 +19,5 @@
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user