diff --git a/chandler_loader.php b/chandler_loader.php new file mode 100644 index 00000000..7566aecc --- /dev/null +++ b/chandler_loader.php @@ -0,0 +1,10 @@ +#!/usr/bin/env php +ignite(true); diff --git a/composer.json b/composer.json index 1020a4f7..8148e237 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,8 @@ { "scripts": { "fix": "php-cs-fixer fix", - "lint": "php-cs-fixer fix --dry-run --diff --verbose" + "lint": "php-cs-fixer fix --dry-run --diff --verbose", + "analyse": "phpstan analyse --memory-limit 1G" }, "require": { "php": "~7.3||~8.1", @@ -28,6 +29,7 @@ }, "minimum-stability": "beta", "require-dev": { - "friendsofphp/php-cs-fixer": "^3.68" + "friendsofphp/php-cs-fixer": "^3.68", + "phpstan/phpstan": "^2.1" } } diff --git a/composer.lock b/composer.lock index 3e7e2d72..9b27d119 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "b92d2ddd207f394a31c429c65d1785a7", + "content-hash": "fe88a04383a75cc5c6591abac3128201", "packages": [ { "name": "al/emoji-detector", @@ -3092,6 +3092,64 @@ ], "time": "2025-01-30T17:00:50+00:00" }, + { + "name": "phpstan/phpstan", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", + "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": "2025-01-21T14:54:06+00:00" + }, { "name": "psr/event-dispatcher", "version": "1.0.0", diff --git a/openvkctl b/openvkctl index 1ed5f3be..39edfecf 100755 --- a/openvkctl +++ b/openvkctl @@ -7,9 +7,7 @@ namespace openvk; use Symfony\Component\Console\Application; -$_SERVER["HTTP_ACCEPT_LANGUAGE"] = false; -$bootstrap = require(__DIR__ . "/../../../chandler/Bootstrap.php"); -$bootstrap->ignite(true); +require(__DIR__ . "/chandler_loader.php"); $application = new Application(); $application->add(new CLI\RebuildImagesCommand()); diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..4831b315 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,14 @@ +parameters: + level: 0 + paths: + - CLI + - ServiceAPI + - VKAPI + - Web + - bootstrap.php + - openvkctl + - chandler_loader.php + + bootstrapFiles: + - chandler_loader.php + - bootstrap.php