Skip to content

Commit

Permalink
Fixing bin file
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankraemer committed Sep 21, 2024
1 parent e6d7bec commit 00862be
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/vendor/
/bin/
!/bin/cognitive-analysis
!/bin/cognitive-analysis.bat
/.phive/
/.phpunit.cache/
/tmp/
Expand Down
14 changes: 14 additions & 0 deletions bin/cognitive-analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env php
<?php

require_once __DIR__ . '/../../../autoload.php';

use Phauthentic\CodeQualityMetrics\Command\CognitiveMetricsCommand;
use Phauthentic\CodeQualityMetrics\Command\HalsteadMetricsCommand;
use Symfony\Component\Console\Application;

$application = new Application();
$application->add(new CognitiveMetricsCommand());
$application->add(new HalsteadMetricsCommand());

$application->run();
12 changes: 12 additions & 0 deletions bin/cognitive-analysis.bat
Original file line number Diff line number Diff line change
@@ -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" %*
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"infection/extension-installer": true
}
},
"bin": [
"bin/cognitive-analysis"
],
"scripts": {
"test": [
"phpunit"
Expand Down

0 comments on commit 00862be

Please sign in to comment.