From 00862bec716651baa1667fcdd37be68a081c047c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Kr=C3=A4mer?= Date: Sun, 22 Sep 2024 00:25:18 +0200 Subject: [PATCH] Fixing bin file --- .gitignore | 2 ++ bin/cognitive-analysis | 14 ++++++++++++++ bin/cognitive-analysis.bat | 12 ++++++++++++ composer.json | 3 +++ 4 files changed, 31 insertions(+) create mode 100755 bin/cognitive-analysis create mode 100755 bin/cognitive-analysis.bat diff --git a/.gitignore b/.gitignore index 0c35561..1a5f647 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ /vendor/ /bin/ +!/bin/cognitive-analysis +!/bin/cognitive-analysis.bat /.phive/ /.phpunit.cache/ /tmp/ diff --git a/bin/cognitive-analysis b/bin/cognitive-analysis new file mode 100755 index 0000000..bfd62b7 --- /dev/null +++ b/bin/cognitive-analysis @@ -0,0 +1,14 @@ +#!/usr/bin/env php +add(new CognitiveMetricsCommand()); +$application->add(new HalsteadMetricsCommand()); + +$application->run(); diff --git a/bin/cognitive-analysis.bat b/bin/cognitive-analysis.bat new file mode 100755 index 0000000..6e1b1dc --- /dev/null +++ b/bin/cognitive-analysis.bat @@ -0,0 +1,12 @@ +@echo off +REM Cognitive Code Analysis +REM +REM @author Florian Krämer +REM @copyright 2024 Florian Krämer +REM @license https://github.com/Phauthentic/cognitive-code-analysis/blob/master/LICENSE GPL-3.0 + +if "%PHP_PEAR_PHP_BIN%" neq "" ( + set PHPBIN=%PHP_PEAR_PHP_BIN% +) else set PHPBIN=php + +"%PHPBIN%" "%~dp0\cognitive-analysis" %* diff --git a/composer.json b/composer.json index cfc9768..f3cf98f 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,9 @@ "infection/extension-installer": true } }, + "bin": [ + "bin/cognitive-analysis" + ], "scripts": { "test": [ "phpunit"