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

Commit 9e09deb

Browse files
authored
Fixed Issue #68 (Got Warning Deprecated) (#70)
1 parent 76e512c commit 9e09deb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2190
-3668
lines changed

.build/.beautify

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"brace_style": "collapse",
3+
"break_chained_methods": true,
4+
"comma_first": false,
5+
"e4x": true,
6+
"editorconfig": true,
7+
"end_with_newline": true,
8+
"eol": "\n",
9+
"indent_char": " ",
10+
"indent_inner_html": true,
11+
"indent_level": 0,
12+
"indent_scripts": "separate",
13+
"indent_size": "2",
14+
"indent_with_tabs": false,
15+
"jslint_happy": true,
16+
"keep_array_indentation": true,
17+
"max_preserve_newlines": "2",
18+
"operator_position": "before-newline",
19+
"preserve_newlines": true,
20+
"space_after_anon_function": true,
21+
"space_after_named_function": true,
22+
"space_before_conditional": true,
23+
"space_in_empty_paren": true,
24+
"space_in_paren": true,
25+
"unescape_strings": true,
26+
"unindent_chained_methods": false,
27+
"wrap_line_length": "120"
28+
}

assets/.eslintrc renamed to .build/.eslintrc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"id-length": "off",
5959
"id-match": "error",
6060
"implicit-arrow-linebreak": "error",
61-
"indent": "error",
62-
"indent-legacy": "error",
61+
"indent": ["error", 2],
62+
"indent-legacy": "off",
6363
"init-declarations": "off",
6464
"jsx-quotes": "error",
6565
"key-spacing": "error",
@@ -75,7 +75,7 @@
7575
"max-depth": "error",
7676
"max-len": "off",
7777
"max-lines": "off",
78-
"max-lines-per-function": "error",
78+
"max-lines-per-function": ["error", 100],
7979
"max-nested-callbacks": "error",
8080
"max-params": "off",
8181
"max-statements": "off",
@@ -169,7 +169,12 @@
169169
"no-unmodified-loop-condition": "error",
170170
"no-unneeded-ternary": "error",
171171
"no-unused-expressions": "off",
172-
"no-use-before-define": "error",
172+
"no-use-before-define": ["error", {
173+
"allowNamedExports": false,
174+
"classes": true,
175+
"functions": false,
176+
"variables": true
177+
}],
173178
"no-useless-call": "error",
174179
"no-useless-catch": "error",
175180
"no-useless-computed-key": "error",

.build/.minify

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parse": {},
3+
"mangle": {
4+
"reserved": ["log", "debug", "perf_begin", "perf_end"]
5+
},
6+
"compress": {
7+
"drop_console": true,
8+
"hoist_funs": true,
9+
"passes": 10,
10+
"pure_getters": true,
11+
"pure_funcs": ["log", "debug", "perf_begin", "perf_end"],
12+
"reduce_funcs": true
13+
},
14+
"output": {
15+
"comments": "/^!/",
16+
"wrap_iife": true
17+
},
18+
"annotations": false,
19+
"ie": true,
20+
"keep_fargs": false,
21+
"keep_fnames": false,
22+
"module": false,
23+
"nameCache": null,
24+
"sourceMap": false,
25+
"toplevel": false,
26+
"v8": true,
27+
"warnings": false,
28+
"webkit": true
29+
}

.build/.php-cs-fixer.php

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
3+
/**
4+
* Defer.php aims to help you concentrate on web performance optimization.
5+
* (c) 2019-2023 SHIN Company https://shin.company
6+
*
7+
* PHP Version >=5.6
8+
*
9+
* @category Web_Performance_Optimization
10+
* @package AppSeeds
11+
* @author Mai Nhut Tan <[email protected]>
12+
* @copyright 2019-2023 SHIN Company
13+
* @license https://code.shin.company/defer.php/blob/master/LICENSE MIT
14+
* @link https://code.shin.company/defer.php
15+
* @see https://code.shin.company/defer.php/blob/master/README.md
16+
*/
17+
18+
define('WEBHOME', '/var/www/html');
19+
20+
$header = <<<'EOF'
21+
Defer.php aims to help you concentrate on web performance optimization.
22+
(c) 2019-2023 SHIN Company https://shin.company
23+
24+
PHP Version >=5.6
25+
26+
@category Web_Performance_Optimization
27+
@package AppSeeds
28+
@author Mai Nhut Tan <[email protected]>
29+
@copyright 2019-2023 SHIN Company
30+
@license https://code.shin.company/defer.php/blob/master/LICENSE MIT
31+
@link https://code.shin.company/defer.php
32+
@see https://code.shin.company/defer.php/blob/master/README.md
33+
EOF;
34+
35+
$rules = [
36+
'@PhpCsFixer' => true,
37+
'concat_space' => ['spacing' => 'one'],
38+
'empty_loop_body' => ['style' => 'braces'],
39+
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc'],
40+
'increment_style' => ['style' => 'post'],
41+
'no_superfluous_phpdoc_tags' => false,
42+
'phpdoc_summary' => true,
43+
'phpdoc_to_comment' => false,
44+
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
45+
'self_static_accessor' => false,
46+
'yoda_style' => false,
47+
48+
'multiline_whitespace_before_semicolons' => [
49+
'strategy' => 'no_multi_line',
50+
],
51+
52+
'phpdoc_align' => ['align' => 'vertical'],
53+
54+
'binary_operator_spaces' => [
55+
'default' => 'single_space',
56+
'operators' => [
57+
'||' => 'align_single_space_minimal',
58+
'or' => 'align_single_space_minimal',
59+
'=' => 'align_single_space_minimal',
60+
'=>' => 'align_single_space_minimal',
61+
'<=>' => 'align_single_space_minimal',
62+
],
63+
],
64+
65+
'visibility_required' => [
66+
'elements' => ['method', 'property'],
67+
],
68+
];
69+
70+
$finder = \PhpCsFixer\Finder::create()
71+
->in(dirname(__DIR__))
72+
->name('*.php')
73+
->exclude('_old')
74+
->exclude('cache')
75+
->ignoreDotFiles(false)
76+
->ignoreVCS(true);
77+
78+
return (new \PhpCsFixer\Config())
79+
->setFinder($finder)
80+
->setRules($rules)
81+
->setLineEnding("\n")
82+
->setUsingCache(false);

.build/phpstan.neon

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
parameters:
2+
level: 8
3+
phpVersion: 70100
4+
fileExtensions:
5+
- php
6+
paths:
7+
- /var/www/html/
8+
excludePaths:
9+
- /var/www/html/_*/*
10+
- /var/www/html/mode_modules/*
11+
- /var/www/html/vendor/*
12+
ignoreErrors:
13+
- '#has no return type specified#'
14+
checkMissingIterableValueType: false
15+
checkGenericClassInNonGenericObjectType: false

.build/rector.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* Defer.php aims to help you concentrate on web performance optimization.
7+
* (c) 2019-2023 SHIN Company https://shin.company
8+
*
9+
* PHP Version >=5.6
10+
*
11+
* @category Web_Performance_Optimization
12+
* @package AppSeeds
13+
* @author Mai Nhut Tan <[email protected]>
14+
* @copyright 2019-2023 SHIN Company
15+
* @license https://code.shin.company/defer.php/blob/master/LICENSE MIT
16+
* @link https://code.shin.company/defer.php
17+
* @see https://code.shin.company/defer.php/blob/master/README.md
18+
*/
19+
20+
use Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector;
21+
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
22+
use Rector\Config\RectorConfig;
23+
use Rector\Set\ValueObject\DowngradeLevelSetList;
24+
use Rector\Set\ValueObject\LevelSetList;
25+
use Rector\Set\ValueObject\SetList;
26+
27+
return static function (RectorConfig $rectorConfig): void {
28+
$rectorConfig->disableParallel();
29+
$rectorConfig->importNames();
30+
$rectorConfig->indent(' ', 4);
31+
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');
32+
33+
// scan paths
34+
$rectorConfig->paths([
35+
'/var/www/html/',
36+
]);
37+
38+
// skip paths and rules
39+
$rectorConfig->skip([
40+
'/var/www/html/_*/',
41+
'/var/www/html/cache/',
42+
'/var/www/html/node_modules/',
43+
'/var/www/html/vendor/',
44+
]);
45+
46+
// rule sets
47+
$rectorConfig->sets([
48+
LevelSetList::UP_TO_PHP_82,
49+
SetList::DEAD_CODE,
50+
SetList::EARLY_RETURN,
51+
SetList::CODE_QUALITY,
52+
SetList::CODING_STYLE,
53+
DowngradeLevelSetList::DOWN_TO_PHP_55,
54+
]);
55+
56+
$rectorConfig->rules([
57+
NewlineAfterStatementRector::class,
58+
]);
59+
60+
// extra rules
61+
$rectorConfig->ruleWithConfiguration(ConsistentPregDelimiterRector::class, [
62+
ConsistentPregDelimiterRector::DELIMITER => '/',
63+
]);
64+
};

.docker/Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

.docker/blackfire.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.docker/docker-compose.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.php_cs.cache
2-
composer.phar
1+
_*
2+
.DS_Store
3+
*.cache
4+
/cache/
35
/node_modules/
46
/vendor/
5-
/cache/
6-
/.scannerwork
7+
composer.lock
8+
package-lock.json

0 commit comments

Comments
 (0)