Added quality tools

This commit is contained in:
ArabCoders
2024-12-28 19:08:38 +03:00
parent ac5bc61ad8
commit 92fc74e165
5 changed files with 170 additions and 3 deletions

View File

@@ -53,7 +53,9 @@
"roave/security-advisories": "dev-latest",
"symfony/var-dumper": "^7.2",
"perftools/php-profiler": "^1.1.2",
"phpunit/phpunit": "^11.5.2"
"phpunit/phpunit": "^11.5.2",
"phpstan/phpstan": "^2.0",
"psalm/phar": "^5.26"
},
"autoload-dev": {
"psr-4": {

95
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "dafa22bfa7de2ecac76ddd2228eaa04e",
"content-hash": "c3c683ccb90d966fdaf666583c26e4d0",
"packages": [
{
"name": "brick/math",
@@ -3070,6 +3070,64 @@
},
"time": "2022-02-21T01:04:05+00:00"
},
{
"name": "phpstan/phpstan",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "50d276fc3bf1430ec315f2f109bbde2769821524"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/50d276fc3bf1430ec315f2f109bbde2769821524",
"reference": "50d276fc3bf1430ec315f2f109bbde2769821524",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
}
],
"time": "2024-12-17T17:14:01+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "11.0.8",
@@ -3494,6 +3552,41 @@
],
"time": "2024-12-21T05:51:08+00:00"
},
{
"name": "psalm/phar",
"version": "5.26.1",
"source": {
"type": "git",
"url": "https://github.com/psalm/phar.git",
"reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/psalm/phar/zipball/8a38e7ad04499a0ccd2c506fd1da6fc01fff4547",
"reference": "8a38e7ad04499a0ccd2c506fd1da6fc01fff4547",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"vimeo/psalm": "*"
},
"bin": [
"psalm.phar"
],
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Composer-based Psalm Phar",
"support": {
"issues": "https://github.com/psalm/phar/issues",
"source": "https://github.com/psalm/phar/tree/5.26.1"
},
"time": "2024-09-09T16:22:43+00:00"
},
{
"name": "roave/security-advisories",
"version": "dev-latest",

View File

@@ -555,7 +555,7 @@ const openMenu = e => {
e.target.closest('div.has-dropdown').classList.toggle('is-active')
}
const changeRoute = async (e, callback) => {
const changeRoute = async (_, callback) => {
showMenu.value = false
document.querySelectorAll('div.has-dropdown').forEach(el => el.classList.remove('is-active'))
if (callback) {

34
phpstan.neon Normal file
View File

@@ -0,0 +1,34 @@
parameters:
level: max
bootstrapFiles:
- ./pre_init.php
excludePaths:
- ./tests/*
- ./vendor/*
- ./data/*
- ./public/*
- ./assets/*
fileExtensions:
- php
paths:
- ./src/
- ./config/
- ./bin/
- ./public/
ignoreErrors:
- '#iterable type (array|PDOStatement|iterable)#'
- '#Property (.+) \(string\) does not accept mixed.#'
- '#Cannot cast mixed to string.#'
- '#Parameter \#\d+ .+ of function .+ expects .+, mixed given.#'
- '#Method .+ should return .+ but returns mixed.#'
- '#Cannot access offset .+ on mixed.#'
- '#Cannot cast mixed to .+#'
- '#Argument of an invalid type mixed supplied for foreach, only iterables are supported.#'
- '#Parameter \#\d+ .+ of .+ expects .+, mixed given.#'
- '#Cannot access property .+ on mixed.#'
- '#set_error_handler#'
- '#Property .+ does not accept mixed.#'
- '#Function .+ should return .+ but returns mixed.#'
- '#Cannot call method .+ on mixed.#'
- '#Parameter .+ of class .+ expects .+, mixed given.#'
- '#Binary operation .+ between .+ and mixed results in an error.#'

38
psalm.xml.dist Normal file
View File

@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<psalm errorLevel="2" resolveFromConfigFile="true" hideExternalErrors="true" ignoreInternalFunctionFalseReturn="false"
autoloader="./pre_init.php">
<projectFiles>
<directory name="."/>
<ignoreFiles allowMissingFiles="true">
<directory name=".idea"/>
<directory name="vendor"/>
<directory name="assets"/>
<directory name="frontend"/>
<directory name="docker"/>
<directory name="public"/>
<directory name="data"/>
</ignoreFiles>
</projectFiles>
<issueHandlers>
<TypeDoesNotContainType errorLevel="info"/>
<PossiblyNullArgument errorLevel="info"/>
<PossiblyNullReference errorLevel="info"/>
<PossiblyInvalidArgument errorLevel="info"/>
<PossiblyNullPropertyFetch errorLevel="info"/>
<MissingClosureParamType errorLevel="info"/>
<RedundantCondition errorLevel="info"/>
<MissingParamType errorLevel="info"/>
<PossiblyInvalidMethodCall errorLevel="info"/>
<DocblockTypeContradiction errorLevel="info"/>
<PropertyNotSetInConstructor errorLevel="info"/>
<RedundantConditionGivenDocblockType errorLevel="info"/>
<PossiblyNullArrayOffset errorLevel="info"/>
<MissingFile errorLevel="info"/>
<DuplicateFunction errorLevel="info"/>
<DuplicateClass errorLevel="info"/>
<UnresolvableInclude errorLevel="info"/>
</issueHandlers>
<stubs>
<file name="./.phpstorm.meta.php"/>
</stubs>
</psalm>