From d2d409cf6ae711d16a92c85638995909fe9c0984 Mon Sep 17 00:00:00 2001 From: rahi69 <35202922+rahi69@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:11:58 +0330 Subject: [PATCH 1/4] Add require-dev the "imports analyzer" package --- composer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a4afc8d..e001efa 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,9 @@ }, "require-dev": { "orchestra/testbench": "~6.0", - "squizlabs/php_codesniffer": "3.*" + "squizlabs/php_codesniffer": "3.*", + "imanghafoori/php-imports-analyzer": "^1.0.6" + }, "autoload": { "psr-4": { From 16e9bdf2e6b28824593995c07fb3fa20f4ff1bb9 Mon Sep 17 00:00:00 2001 From: rahi69 <35202922+rahi69@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:13:01 +0330 Subject: [PATCH 2/4] Update .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index acc0d70..45a0bb3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto /.gitattributes export-ignore +/.github export-ignore /.gitignore export-ignore /.styleci.yml export-ignore /phpunit.xml.dist export-ignore From c3ee86ef7dd9b6bd4e3b8691ef19881d3372c683 Mon Sep 17 00:00:00 2001 From: rahi69 <35202922+rahi69@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:16:42 +0330 Subject: [PATCH 3/4] Create check_imports.yml --- .github/workflows/check_imports.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/check_imports.yml diff --git a/.github/workflows/check_imports.yml b/.github/workflows/check_imports.yml new file mode 100644 index 0000000..fe11457 --- /dev/null +++ b/.github/workflows/check_imports.yml @@ -0,0 +1,33 @@ +name: Check Imports + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + check_imports: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Check Imports + run: ./vendor/bin/check_imports From 0506295a68bd7cce47472c2fde5c09c442aefc5b Mon Sep 17 00:00:00 2001 From: rahi69 <35202922+rahi69@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:27:57 +0330 Subject: [PATCH 4/4] Add check imports badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3502a1d..78fef05 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Quality Score [![StyleCI](https://github.styleci.io/repos/164699371/shield?branch=master)](https://github.styleci.io/repos/164699371) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=round-square)](LICENSE.md) +[![Check Imports](https://github.com/imanghafoori1/laravel-decorator/actions/workflows/check_imports.yml/badge.svg?branch=master)](https://github.com/imanghafoori1/laravel-decorator/actions/workflows/check_imports.yml) [![Latest Stable Version](https://poser.pugx.org/imanghafoori/laravel-decorator/v/stable)](https://packagist.org/packages/imanghafoori/laravel-decorator) [![Code Coverage](https://scrutinizer-ci.com/g/imanghafoori1/laravel-decorator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/imanghafoori1/laravel-decorator/?branch=master) [![Total Downloads](https://poser.pugx.org/imanghafoori/laravel-decorator/downloads)](https://packagist.org/packages/imanghafoori/laravel-decorator)