更新项目基础配置文件

This commit is contained in:
lei.tian 2023-03-10 18:03:33 +08:00
parent 7c76c1ddc5
commit b457a71364
8 changed files with 54 additions and 37 deletions

View File

@ -1,11 +1,15 @@
# EditorConfig is awesome: http://EditorConfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
[**.{php,md}]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = 80
[*.{json,yml}]
indent_size = 2

8
.gitattributes vendored
View File

@ -1,9 +1,11 @@
/.github export-ignore
/.gitlab export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/.php-cs-fixer.php export-ignore
/.editorconfig export-ignore
/.php-cs-fixer.php export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/phpstan.neon export-ignore
/tests export-ignore

12
.gitignore vendored
View File

@ -1,9 +1,15 @@
/vendor/
/composer.lock
.idea
Thumbs.db
ehthumbs.db
Desktop.ini
.DS_Store
.idea/
.vscode/
/vendor/
/composer.lock
.phpdoc/
phpdoc.xml
.php-cs-fixer.cache
.phpstan.neon
phpunit.xml
.phpunit.result.cache
.env

View File

@ -21,9 +21,9 @@ return (new PhpCsFixer\Config())
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules([
'@PSR12' => true,
'@PHP71Migration' => true,
'@PHPUnit75Migration:risky' => true,
'@PSR12' => true,
'header_comment' => ['header' => $fileHeaderComment],
])
->setFinder(

0
phpstan-baseline.neon Normal file
View File

View File

@ -1,13 +1,17 @@
includes:
- phpstan-baseline.neon
parameters:
level: 5
checkMissingIterableValueType: false
checkFunctionNameCase: true
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: false
paths:
- src
- tests
ignoreErrors:
- '#PHPDoc tag .* has invalid value.*#'
level: 5
checkMissingIterableValueType: false
checkFunctionNameCase: true
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
inferPrivatePropertyTypeFromConstructor: true
treatPhpDocTypesAsCertain: false
paths:
- src
- tests
ignoreErrors:
- '#PHPDoc tag .* has invalid value.*#'
- '#Unsafe usage of new static\(\).#'

View File

@ -1,24 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="All">
<directory>./tests/</directory>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>src/data</directory>
</exclude>
<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>
<php>
<env name="XDB_PATH" value="../assets/ip2region.xdb"/>
</php>

View File

@ -21,5 +21,4 @@ class TestCase extends \PHPUnit\Framework\TestCase
{
return microtime(true) * 1000;
}
}