Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Fixed Issue #68 (Got Warning Deprecated) (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinsenter authored Sep 7, 2023
1 parent 76e512c commit 9e09deb
Show file tree
Hide file tree
Showing 64 changed files with 2,190 additions and 3,668 deletions.
28 changes: 28 additions & 0 deletions .build/.beautify
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"brace_style": "collapse",
"break_chained_methods": true,
"comma_first": false,
"e4x": true,
"editorconfig": true,
"end_with_newline": true,
"eol": "\n",
"indent_char": " ",
"indent_inner_html": true,
"indent_level": 0,
"indent_scripts": "separate",
"indent_size": "2",
"indent_with_tabs": false,
"jslint_happy": true,
"keep_array_indentation": true,
"max_preserve_newlines": "2",
"operator_position": "before-newline",
"preserve_newlines": true,
"space_after_anon_function": true,
"space_after_named_function": true,
"space_before_conditional": true,
"space_in_empty_paren": true,
"space_in_paren": true,
"unescape_strings": true,
"unindent_chained_methods": false,
"wrap_line_length": "120"
}
13 changes: 9 additions & 4 deletions assets/.eslintrc → .build/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
"id-length": "off",
"id-match": "error",
"implicit-arrow-linebreak": "error",
"indent": "error",
"indent-legacy": "error",
"indent": ["error", 2],
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "error",
Expand All @@ -75,7 +75,7 @@
"max-depth": "error",
"max-len": "off",
"max-lines": "off",
"max-lines-per-function": "error",
"max-lines-per-function": ["error", 100],
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
Expand Down Expand Up @@ -169,7 +169,12 @@
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "off",
"no-use-before-define": "error",
"no-use-before-define": ["error", {
"allowNamedExports": false,
"classes": true,
"functions": false,
"variables": true
}],
"no-useless-call": "error",
"no-useless-catch": "error",
"no-useless-computed-key": "error",
Expand Down
29 changes: 29 additions & 0 deletions .build/.minify
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parse": {},
"mangle": {
"reserved": ["log", "debug", "perf_begin", "perf_end"]
},
"compress": {
"drop_console": true,
"hoist_funs": true,
"passes": 10,
"pure_getters": true,
"pure_funcs": ["log", "debug", "perf_begin", "perf_end"],
"reduce_funcs": true
},
"output": {
"comments": "/^!/",
"wrap_iife": true
},
"annotations": false,
"ie": true,
"keep_fargs": false,
"keep_fnames": false,
"module": false,
"nameCache": null,
"sourceMap": false,
"toplevel": false,
"v8": true,
"warnings": false,
"webkit": true
}
82 changes: 82 additions & 0 deletions .build/.php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php

/**
* Defer.php aims to help you concentrate on web performance optimization.
* (c) 2019-2023 SHIN Company https://shin.company
*
* PHP Version >=5.6
*
* @category Web_Performance_Optimization
* @package AppSeeds
* @author Mai Nhut Tan <shin@shin.company>
* @copyright 2019-2023 SHIN Company
* @license https://code.shin.company/defer.php/blob/master/LICENSE MIT
* @link https://code.shin.company/defer.php
* @see https://code.shin.company/defer.php/blob/master/README.md
*/

define('WEBHOME', '/var/www/html');

$header = <<<'EOF'
Defer.php aims to help you concentrate on web performance optimization.
(c) 2019-2023 SHIN Company https://shin.company
PHP Version >=5.6
@category Web_Performance_Optimization
@package AppSeeds
@author Mai Nhut Tan <shin@shin.company>
@copyright 2019-2023 SHIN Company
@license https://code.shin.company/defer.php/blob/master/LICENSE MIT
@link https://code.shin.company/defer.php
@see https://code.shin.company/defer.php/blob/master/README.md
EOF;

$rules = [
'@PhpCsFixer' => true,
'concat_space' => ['spacing' => 'one'],
'empty_loop_body' => ['style' => 'braces'],
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc'],
'increment_style' => ['style' => 'post'],
'no_superfluous_phpdoc_tags' => false,
'phpdoc_summary' => true,
'phpdoc_to_comment' => false,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'self_static_accessor' => false,
'yoda_style' => false,

'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],

'phpdoc_align' => ['align' => 'vertical'],

'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'||' => 'align_single_space_minimal',
'or' => 'align_single_space_minimal',
'=' => 'align_single_space_minimal',
'=>' => 'align_single_space_minimal',
'<=>' => 'align_single_space_minimal',
],
],

'visibility_required' => [
'elements' => ['method', 'property'],
],
];

$finder = \PhpCsFixer\Finder::create()
->in(dirname(__DIR__))
->name('*.php')
->exclude('_old')
->exclude('cache')
->ignoreDotFiles(false)
->ignoreVCS(true);

return (new \PhpCsFixer\Config())
->setFinder($finder)
->setRules($rules)
->setLineEnding("\n")
->setUsingCache(false);
15 changes: 15 additions & 0 deletions .build/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
parameters:
level: 8
phpVersion: 70100
fileExtensions:
- php
paths:
- /var/www/html/
excludePaths:
- /var/www/html/_*/*
- /var/www/html/mode_modules/*
- /var/www/html/vendor/*
ignoreErrors:
- '#has no return type specified#'
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
64 changes: 64 additions & 0 deletions .build/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

declare(strict_types=1);

/**
* Defer.php aims to help you concentrate on web performance optimization.
* (c) 2019-2023 SHIN Company https://shin.company
*
* PHP Version >=5.6
*
* @category Web_Performance_Optimization
* @package AppSeeds
* @author Mai Nhut Tan <shin@shin.company>
* @copyright 2019-2023 SHIN Company
* @license https://code.shin.company/defer.php/blob/master/LICENSE MIT
* @link https://code.shin.company/defer.php
* @see https://code.shin.company/defer.php/blob/master/README.md
*/

use Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\DowngradeLevelSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->disableParallel();
$rectorConfig->importNames();
$rectorConfig->indent(' ', 4);
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');

// scan paths
$rectorConfig->paths([
'/var/www/html/',
]);

// skip paths and rules
$rectorConfig->skip([
'/var/www/html/_*/',
'/var/www/html/cache/',
'/var/www/html/node_modules/',
'/var/www/html/vendor/',
]);

// rule sets
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_82,
SetList::DEAD_CODE,
SetList::EARLY_RETURN,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
DowngradeLevelSetList::DOWN_TO_PHP_55,
]);

$rectorConfig->rules([
NewlineAfterStatementRector::class,
]);

// extra rules
$rectorConfig->ruleWithConfiguration(ConsistentPregDelimiterRector::class, [
ConsistentPregDelimiterRector::DELIMITER => '/',
]);
};
10 changes: 0 additions & 10 deletions .docker/Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions .docker/blackfire.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .docker/docker-compose.yml

This file was deleted.

10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.php_cs.cache
composer.phar
_*
.DS_Store
*.cache
/cache/
/node_modules/
/vendor/
/cache/
/.scannerwork
composer.lock
package-lock.json
Loading

0 comments on commit 9e09deb

Please sign in to comment.