Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/composer-dependency-analyser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

name: Composer dependency analyser

jobs:
composer-dependency-analyser:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
key: cache-v1

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.2
- 8.3

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
env:
update: true
with:
php-version: ${{ matrix.php }}
ini-values: date.timezone='UTC'
coverage: none
tools: composer:v2

- name: Determine composer cache directory on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-

- name: Update composer
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Analyse project dependencies
run: vendor/bin/composer-dependency-analyser
33 changes: 0 additions & 33 deletions .github/workflows/composer-require-checker.yml

This file was deleted.

14 changes: 14 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
declare(strict_types=1);

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

$config = new Configuration();

return $config
->addPathsToScan([__DIR__ . '/config', __DIR__ . '/src'], false)
->addPathToScan(__DIR__ . '/tests', true)
->ignoreErrorsOnPath(__DIR__ . '/config', [ErrorType::DEV_DEPENDENCY_IN_PROD]) // We really can configure non-existent classes
->ignoreErrorsOnPath(__DIR__ . '/src/Console', [ErrorType::DEV_DEPENDENCY_IN_PROD]) // symfony/console is an optional dependency, CLI commands won't be used without it
->disableComposerAutoloadPathScan();
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@
"yiisoft/injector": "^1.0"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.5",
"php-http/multipart-stream-builder": "^1.4",
"phpunit/phpunit": "^10.1",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.1",
"psr/http-message": "^2.0",
"roave/infection-static-analysis-plugin": "^1.16",
"shipmonk/composer-dependency-analyser": "^1.8",
"symfony/console": "^7.2",
"symfony/http-client": "^7.0",
"vimeo/psalm": "^6.8",
"yiisoft/definitions": "^3.3",
"yiisoft/test-support": "^3.0"
},
"suggest": {
"symfony/http-client": "^6.0",
"yiisoft/yii-console": "^1.0",
"symfony/http-client": "^7.0",
"yiisoft/yii-console": "^2.0",
"yiisoft/yii-event": "^2.0"
},
"autoload": {
Expand Down
1 change: 0 additions & 1 deletion tests/Middleware/MiddlewareFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Botasis\Runtime\Middleware\MiddlewareFactory;
use Botasis\Runtime\Middleware\MiddlewareFactoryInterface;
use Botasis\Runtime\Middleware\MiddlewareInterface;
use Botasis\Runtime\Request\TelegramRequestEnriched;
use Botasis\Runtime\Response\Response;
use Botasis\Runtime\Response\ResponseInterface;
use Botasis\Runtime\Tests\Middleware\Support\InvalidController;
Expand Down
Loading