Commit 31902eee authored by Arnaud Buathier's avatar Arnaud Buathier

feat: update php-cs-fixer

parent eb0eaf1c
......@@ -9,9 +9,6 @@ For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src');
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
......@@ -22,7 +19,10 @@ return PhpCsFixer\Config::create()
'blank_line_after_opening_tag' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true, // php 7.0
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true, // php 7.0
// 'heredoc_indentation' => true, // php 7.3
'native_function_casing' => true,
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
......@@ -37,15 +37,25 @@ return PhpCsFixer\Config::create()
'no_unused_imports' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'pow_to_exponentiation' => true, // php 7.0
'random_api_migration' => true, // php 7.0
'short_scalar_cast' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'ternary_to_null_coalescing' => true,
'ternary_to_null_coalescing' => true, // php 7.0
'trailing_comma_in_multiline_array' => true,
'native_function_invocation' => ['include' => ['@compiler_optimized']],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'single_import_per_statement' => true,
'global_namespace_import' => ['import_classes' => false, 'import_functions' => false, 'import_constants' => false],
'header_comment' => ['header' => $header],
]
)
->setFinder($finder);
->setFinder(
PhpCsFixer\Finder::create()
->in(
[
__DIR__ . '/src',
]
)
);
.PHONY: help
help:
@$(MAKE) -p : 2>/dev/null | egrep -v -e '^#' -e '^Makefile|^help' | egrep '^[[:alnum:]][[:alnum:]\.-]+\:' | sed -e 's/:.*//g' | sort
# ----------------------------------------
build: update
php -d "phar.readonly=Off" ./bin/box build
......
{
"name": "arnapou/simplesite",
"description": "Arnapou Simple Site",
"authors": [
{
"name": "Arnaud Buathier",
"email": "[email protected]",
"homepage": "http://arnapou.net"
"name": "arnapou/simplesite",
"description": "Arnapou Simple Site",
"authors": [
{
"name": "Arnaud Buathier",
"email": "[email protected]",
"homepage": "http://arnapou.net"
}
],
"require": {
"php": "^7.2.9",
"arnapou/pfdb": "^[email protected]",
"monolog/monolog": "^1.24",
"symfony/cache": "^4.2",
"symfony/http-foundation": "^4.2",
"symfony/routing": "^4.2",
"twig/twig": "^3.0"
},
"autoload": {
"psr-4": {
"Arnapou\\SimpleSite\\": "src"
}
}
],
"require": {
"php": "^7.2.9",
"arnapou/pfdb": "^[email protected]",
"monolog/monolog": "^1.24",
"symfony/cache": "^4.2",
"symfony/http-foundation": "^4.2",
"symfony/routing": "^4.2",
"twig/twig": "^3.0"
},
"autoload": {
"psr-4": {
"Arnapou\\SimpleSite\\": "src"
}
}
}
No preview for this file type
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......@@ -16,7 +18,6 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Throwable;
class Kernel
{
......@@ -70,7 +71,7 @@ class Kernel
$container->Logger()->warning('404 Not Found');
$response = $this->error($container, 404, $exception);
$this->eventListener->dispatch(self::onError404, $event = new Event($container, $response));
} catch (Throwable $exception) {
} catch (\Throwable $exception) {
$container->Logger()->error('500 Internal Error', ['exception' => Utils::dump_throwable($exception)]);
$response = $this->error($container, 500, $exception);
$this->eventListener->dispatch(self::onError500, $event = new Event($container, $response));
......@@ -115,7 +116,7 @@ class Kernel
];
$html = $container->TwigEnvironment()->render("@templates/error.$code.twig", $context);
} catch (Throwable $exception) {
} catch (\Throwable $exception) {
$html = $container->TwigEnvironment()->render("@internal/error.$code.twig", $context);
}
return new Response($html, $code);
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......@@ -11,7 +13,6 @@
namespace Arnapou\SimpleSite;
use Exception;
use Phar;
class Utils
......@@ -265,7 +266,7 @@ class Utils
public static function in_phar(): bool
{
return class_exists(Phar::class) && Phar::running();
return class_exists(\Phar::class) && \Phar::running();
}
public static function find_php_files(string $path): array
......@@ -291,7 +292,7 @@ class Utils
return true;
}
if (!is_writable($path)) {
throw new Exception("The path '$path' is not writable.");
throw new \Exception("The path '$path' is not writable.");
}
return false;
}
......
<?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment