Skip to content

Commit

Permalink
Merge pull request #1 from shinsenter/develop
Browse files Browse the repository at this point in the history
Add master-dev
  • Loading branch information
shinsenter committed Feb 21, 2019
2 parents 8aceb26 + 3cd6a19 commit 8e0f809
Show file tree
Hide file tree
Showing 12 changed files with 1,501 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.php_cs.cache
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
115 changes: 115 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?php

/**
* A PHP helper class to efficiently defer JavaScript for your website.
* (c) 2019 AppSeeds https://appseeds.net/
*
* @package shinsenter/defer.php
* @since 1.0.0
* @author Mai Nhut Tan <shin@shin.company>
* @copyright 2019 AppSeeds
* @see https://github.com/shinsenter/defer.php/blob/develop/README.md
*/
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$header = <<<'EOF'
A PHP helper class to efficiently defer JavaScript for your website.
(c) 2019 AppSeeds https://appseeds.net/
@package shinsenter/defer.php
@since 1.0.0
@author Mai Nhut Tan <shin@shin.company>
@copyright 2019 AppSeeds
@see https://github.com/shinsenter/defer.php/blob/develop/README.md
EOF;

$rules = [
'@PHP56Migration' => true,
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@Symfony' => true,
'@PSR2' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'escape_implicit_backslashes' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
'fully_qualified_strict_types' => true,
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc', 'location' => 'after_open', 'separate' => 'both'],
'heredoc_to_nowdoc' => true,
'increment_style' => ['style' => 'post'],
'list_syntax' => ['syntax' => 'long'],
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'method_chaining_indentation' => true,
'multiline_comment_opening_closing' => true,
'native_function_invocation' => false,
'no_alternative_syntax' => true,
'no_blank_lines_before_namespace' => false,
'no_binary_string' => true,
'no_empty_phpdoc' => true,
'no_null_property_initialization' => true,
'no_short_echo_tag' => true,
'no_superfluous_elseif' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_internal_class' => true,
'php_unit_ordered_covers' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_separation' => false,
'phpdoc_summary' => false,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => true,
'return_assignment' => false,
'semicolon_after_instruction' => true,
'single_line_comment_style' => false,
'single_quote' => true,
'yoda_style' => false,
'blank_line_before_statement' => [
'statements' => [
'continue', 'declare', 'return', 'throw', 'try',
'declare', 'for', 'foreach', 'goto', 'if',
],
],
'no_extra_blank_lines' => [
'tokens' => [
'continue', 'extra', 'return', 'throw', 'use',
'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block',
],
],
'braces' => [
'allow_single_line_closure' => true,
],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'=>' => 'align_single_space',
'=' => 'align_single_space',
],
],
];

$finder = Finder::create()
->in(__DIR__)
->name('*.php')
->exclude('.idea')
->exclude('.ppm')
->exclude('vendor')
->ignoreDotFiles(true)
->ignoreVCS(true);

return Config::create()
->setFinder($finder)
->setRules($rules)
->setUsingCache(true);
70 changes: 70 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "shinsenter/defer.php",
"description": "defer.php is a PHP helper class to efficiently defer JavaScript for your website.",
"keywords": [
"defer.php",
"lazyload",
"lazy",
"fast",
"performance",
"pagespeed",
"tiny",
"compact",
"optimized",
"php",
"composer",
"js",
"javascript",
"script",
"css",
"style",
"image",
"img",
"iframe",
"inline",
"website",
"100scores"
],
"support":
{
"issues": "https://github.com/shinsenter/defer.php/issues",
"source": "https://github.com/shinsenter/defer.php"
},
"autoload": {
"files": [],
"psr-4": {
"shinsenter\\": "src/"
}
},
"authors": [
{
"name": "Mai Nhut Tan",
"email": "shin@shin.company"
}],
"scripts":
{
"fixer": [
"php-cs-fixer fix --show-progress=estimating --verbose"
]
},
"config":
{
"sort-packages": true,
"apcu-autoloader": false,
"optimize-autoloader": true,
"prepend-autoloader": false,
"preferred-install": "dist",
"platform":
{
"php": "5.6"
}
},
"require":
{
"php": "^5.6"
},
"minimum-stability": "stable",
"prefer-stable": true,
"type": "library",
"license": "MIT"
}
22 changes: 22 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e0f809

Please sign in to comment.