Skip to content

Commit

Permalink
feat(): Add PSR-12 for phpcs and fix up the styling along with it
Browse files Browse the repository at this point in the history
  • Loading branch information
markhughes committed Mar 12, 2021
1 parent 39e22ba commit 3b8536e
Show file tree
Hide file tree
Showing 6 changed files with 395 additions and 34 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"editor.tabSize": 2
"editor.tabSize": 4,
"phpcs.ignorePatterns": [
"vendor/"
]
}
34 changes: 9 additions & 25 deletions app/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,25 @@
// FLIGHT CONFIG
// -------------------------------------------------- //

Flight::set("flight.views.path", __DIR__ . "/../resources/views/");
define("FLIGHT_SET_VARS", [
'flight.views.path' => __DIR__ . "/../resources/views/"
]);

// -------------------------------------------------- //
// MONOLOG
// -------------------------------------------------- //

$logger = new Logger(APP_NAME);
define("LOG_HANDLERS", [
new StreamHandler(__DIR__ . "/../../var/logs/application.log", Logger::DEBUG),
new FirePHPHandler(),
]);

$logger->pushHandler(new StreamHandler(__DIR__ . "/../../var/logs/application.log", Logger::DEBUG));
$logger->pushHandler(new FirePHPHandler());

// -------------------------------------------------- //
// TWIG TEMPLATES
// -------------------------------------------------- //

$twig_loader = new Twig_Loader_Filesystem(Flight::get("flight.views.path"));
$twig_config = [
define("TWIG_CONFIG", [
"cache" => __DIR__ . "/../../var/cache/twig/",
"debug" => DEBUG,
];

Flight::register("view", "Twig_Environment", [ $twig_loader, $twig_config ], function ($twig) {
$twig->addExtension(new Twig_Extensions_Extension_Text());

if (function_exists("collator_create")) {
$twig->addExtension(new Twig_Extensions_Extension_Intl());
}

if (DEBUG) {
$twig->addExtension(new Twig_Extension_Debug());
}
});

// -------------------------------------------------- //
// ROUTES
// -------------------------------------------------- //

require_once("routes.php");
]);
4 changes: 2 additions & 2 deletions app/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
// MAPPINGS
// -------------------------------------------------- //

Flight::map("notFound", function() {
Flight::map("notFound", function () {
Flight::render("404", []);
});

Flight::map("error", function($exception) {
Flight::map("error", function ($exception) {
global $logger;

$logger->error($exception);
Expand Down
Loading

0 comments on commit 3b8536e

Please sign in to comment.