diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 513a802..c78568a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,29 +14,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Get Composer Cache Directory 2 - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 - id: actions-cache - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Cache PHP dependencies - uses: actions/cache@v2 - id: vendor-cache - with: - path: vendor - key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} - name: Validate composer.json and composer.lock run: composer validate - name: Install dependencies - if: steps.vendor-cache.outputs.cache-hit != 'true' run: composer install --prefer-dist --no-progress - name: Run test suite diff --git a/.github/workflows/test-template.yaml b/.github/workflows/test-template.yaml index ea0ab3f..6899d02 100644 --- a/.github/workflows/test-template.yaml +++ b/.github/workflows/test-template.yaml @@ -7,6 +7,7 @@ on: - main - develop - features/** + - fix/** jobs: laravel-tests: @@ -26,28 +27,10 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - - name: Get Composer Cache Directory 2 - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v2 - id: actions-cache - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Cache PHP dependencies - uses: actions/cache@v2 - id: vendor-cache - with: - path: vendor - key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} + - name: Install Dependencies - if: steps.vendor-cache.outputs.cache-hit != 'true' run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Show dir run: pwd - name: PHP Version diff --git a/.gitignore b/.gitignore index bda2f3e..8590ca2 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ coverage .phpunit.result.cache .idea .php_cs.cache +.vscode diff --git a/CHANGELOG.md b/CHANGELOG.md index adea9ff..0d7bb06 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.2.6 - 2021-01-03 +Hacktoberfest!!! +We would like to say thank you to @tweichart and @martijnengler for the contributions. +### Add +- Add --all option for showing all information (verbose output). Thanks to @tweichart +- Add --large option for using 120 chars width. Thanks to @martijnengler + ## 0.2.5 - 2021-06-18 ### Add - Add some Operating System information: @@ -10,7 +17,7 @@ - Release name - Machine Name - Version info - + ## 0.2.4 - 2021-04-18 ### Add - In runtime information, added upload_max_filesize and post_max_size from php configuration ( thanks to @yogendra-revanna ) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4ae1c4..6558824 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,11 +36,23 @@ Before submitting a pull request: - Check the codebase to ensure that your feature doesn't already exist. - Check the pull requests to ensure that another person hasn't already submitted the feature or fix. -## Requirements +## Open a Pull Request -If the project maintainer has any additional requirements, you will find them listed here. +In order to maintain consistency in the source code we are following PSR12 coding standard, and using PHP stan for static code analysis. +You can use the command: +``` +make allcheck +``` +to launch +- **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)**, under the hood is used [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer); +- **PHPstan** with [level 4](https://phpstan.org/user-guide/rule-levels) +- **Phpunit** to execute all tests from ./tests/* -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). +I suggest to launch *make allchecks* before to commit or before to create PR. + +If you want to work on a PR, I suggest you to creating a new branch starting from **develop branch**, and use it also when you will submit your new **P**ull **R**equest on the original repository. + +If you want to contribute with an high quality PR, I suggest you to focus not just on the source code but also: - **Add tests!** - Your patch won't be accepted if it doesn't have tests. diff --git a/README.md b/README.md index 4177fcd..92d44a6 100755 --- a/README.md +++ b/README.md @@ -87,6 +87,11 @@ If you want to see a verbose output (with also PHP extensions and PHP INI values ```shell script php artisan laralens:diagnostic --show=all ``` +or better: +```shell script +php artisan laralens:diagnostic --all +``` + If you want to see only PHP extensions: ```shell script @@ -102,7 +107,7 @@ php artisan laralens:diagnostic --show=php-ini If your Laravel application doesn't use the database, you can skip the database inspection with --skip-database option. ```shell script -php artisan laralens:diagnostic --skip-database +php artisan laralens:diagnostic --skip-database ``` ### Usage: show some oprating system information @@ -115,7 +120,7 @@ You can show some operating system information like: - Machine Name - Version info -using _"--show os"_ option or _"--show all"_ option +using _"--show os"_ option or _"--show all"_ option ```shell php artisan laralens:diagnostic --show os ``` @@ -135,6 +140,12 @@ For example: php artisan laralens:diagnostic --style=borderless ``` +### Usage: change the width of the output table +To use 120 characters (wide terminal), you can use --large option +```sh +php artisan laralens:diagnostic --large +``` + ### Testing @@ -162,12 +173,12 @@ After that,you will have a new configuration file in your config directory. The Add `LARALENS_WEB_ENABLED=on` option to your .env file. You may also override the default parameters for `LARALENS_PREFIX` and `LARALENS_MIDDLEWARE` ``` # Wether Web Report should be enabled or not -LARALENS_WEB_ENABLED=on +LARALENS_WEB_ENABLED=on # Path prefix in order to acess the Web Report via browser LARALENS_PREFIX="laralens" # Which middleware should be used when acessing the Web Report, separete more with ; -LARALENS_MIDDLEWARE="web;auth.basic" -``` +LARALENS_MIDDLEWARE="web;auth.basic" +``` For example, with the configuration above you would have enabled the web view (_web-enabled_ parameter) under _/laralens_test/_ path and with the `web` and `auth.basic` middleware @@ -181,12 +192,12 @@ return [ ### Web view configuration hint LaraLens shows some internal configuration of your Laravel application, so I suggest you to disable it in a production environment. -To disable LaraLens web view, make sure to remove LARALENS_WEB_ENABLED config from .env file or set it to _off_ +To disable LaraLens web view, make sure to remove LARALENS_WEB_ENABLED config from .env file or set it to _off_ ``` LARALENS_WEB_ENABLED=off ``` - + ## Contributing diff --git a/src/Console/LaraLensCommand.php b/src/Console/LaraLensCommand.php index 6be91bb..a122525 100644 --- a/src/Console/LaraLensCommand.php +++ b/src/Console/LaraLensCommand.php @@ -22,6 +22,7 @@ class LaraLensCommand extends Command {--show=* : show (all|config|runtime|connection|database|migration|php-ext|php-ini|os)} {--width-label=' . self::DEFAULT_WIDTH . ' : width of column for label} {--width-value=' . self::DEFAULT_WIDTH . ' : width of column for value} + {--large : use 120 columns for the output} {--style=' . self::DEFAULT_STYLE . ' : style for output table (' . self::TABLE_STYLES . ')} {--skip-database : skip database check (if your laravel app doesn\'t need Database)} {--a|all : verbose output (--show=all)} @@ -30,6 +31,7 @@ class LaraLensCommand extends Command protected $description = 'Show some application configurations.'; private const DEFAULT_WIDTH = 36; + private const DEFAULT_LARGE_WIDTH = 77; protected $widthLabel = self::DEFAULT_WIDTH; protected $widthValue = self::DEFAULT_WIDTH; @@ -256,6 +258,9 @@ public function handle() $this->widthLabel = $this->option("width-label"); $this->widthValue = $this->option("width-value"); + if ($this->option("large")) { + $this->widthValue = self::DEFAULT_LARGE_WIDTH; + } $this->urlPath = $this->option("url-path"); if (is_null($this->urlPath)) {