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
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Composer require checker
name: composer dependency analyser

on:
pull_request:
paths: &paths
- 'src/**'
- 'tests/**'
- '.github/workflows/composer-require-checker.yml'
- '.github/workflows/composer-dependency-analyser.yml'
- 'composer.json'
- 'composer-dependency-analyser.php'
push:
branches: ['master']
paths: *paths
Expand All @@ -19,10 +20,8 @@ concurrency:
cancel-in-progress: true

jobs:
composer-require-checker:
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
composer-dependency-analyser:
uses: yiisoft/actions/.github/workflows/composer-dependency-analyser.yml@master
with:
php: >-
['8.1', '8.2', '8.3', '8.4', '8.5']
required-packages: >-
['db']
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;

return (new Configuration())
->disableComposerAutoloadPathScan()
->setFileExtensions(['php'])
->addPathToScan(__DIR__ . '/src', isDev: false)
->addPathToScan(__DIR__ . '/tests', isDev: true)
// Used only implicitly via the `sqlite:` PDO DSN, no statically-detectable symbol.
->ignoreErrorsOnExtension('ext-pdo_sqlite', [ErrorType::UNUSED_DEPENDENCY]);
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.3",
"friendsofphp/php-cs-fixer": "^3.89.1",
"maglnet/composer-require-checker": "^4.7.1",
"phpunit/phpunit": "^10.5.45",
"psr/log": "^2.0|^3.0",
"rector/rector": "^2.0.10",
"shipmonk/composer-dependency-analyser": "^1.8",
"spatie/phpunit-watcher": "^1.24",
"yiisoft/psr-dummy-provider": "^1.0",
"yiisoft/test-support": "^3.0",
Expand Down Expand Up @@ -77,6 +78,7 @@
"sort-packages": true
},
"scripts": {
"dependency-analyser": "composer-dependency-analyser",
"test": "phpunit --testdox --no-interaction",
"test-watch": "phpunit-watcher watch"
}
Expand Down
6 changes: 3 additions & 3 deletions docs/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ use either newest or any specific version of PHP:

## Dependencies

Use [ComposerRequireChecker](https://github.com/maglnet/ComposerRequireChecker) to detect transitive
[Composer](https://getcomposer.org) dependencies. To run the checker, execute the following command:
Use [Composer Dependency Analyser](https://github.com/shipmonk-rnd/composer-dependency-analyser) to detect unknown,
shadow, and unused [Composer](https://getcomposer.org) dependencies:

```shell
./vendor/bin/composer-require-checker
./vendor/bin/composer-dependency-analyser
```
14 changes: 7 additions & 7 deletions tests/Provider/ColumnFactoryProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Yiisoft\Db\Schema\Column\BinaryColumn;
use Yiisoft\Db\Schema\Column\BitColumn;
use Yiisoft\Db\Schema\Column\BooleanColumn;
use Yiisoft\Db\Schema\Column\DatetimeColumn;
use Yiisoft\Db\Schema\Column\DateTimeColumn;
use Yiisoft\Db\Schema\Column\DoubleColumn;
use Yiisoft\Db\Schema\Column\IntegerColumn;
use Yiisoft\Db\Schema\Column\JsonColumn;
Expand Down Expand Up @@ -44,12 +44,12 @@ public static function dbTypes(): array
['text', ColumnType::TEXT, StringColumn::class],
['blob', ColumnType::BINARY, BinaryColumn::class],
['year', ColumnType::SMALLINT, IntegerColumn::class],
['date', ColumnType::DATE, DatetimeColumn::class],
['time', ColumnType::TIME, DatetimeColumn::class],
['timetz', ColumnType::TIMETZ, DatetimeColumn::class],
['datetime', ColumnType::DATETIME, DatetimeColumn::class],
['datetimetz', ColumnType::DATETIMETZ, DatetimeColumn::class],
['timestamp', ColumnType::TIMESTAMP, DatetimeColumn::class],
['date', ColumnType::DATE, DateTimeColumn::class],
['time', ColumnType::TIME, DateTimeColumn::class],
['timetz', ColumnType::TIMETZ, DateTimeColumn::class],
['datetime', ColumnType::DATETIME, DateTimeColumn::class],
['datetimetz', ColumnType::DATETIMETZ, DateTimeColumn::class],
['timestamp', ColumnType::TIMESTAMP, DateTimeColumn::class],
['json', ColumnType::JSON, JsonColumn::class],
];
}
Expand Down
14 changes: 7 additions & 7 deletions tests/Provider/SchemaProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Yiisoft\Db\Schema\Column\BinaryColumn;
use Yiisoft\Db\Schema\Column\BitColumn;
use Yiisoft\Db\Schema\Column\BooleanColumn;
use Yiisoft\Db\Schema\Column\DatetimeColumn;
use Yiisoft\Db\Schema\Column\DateTimeColumn;
use Yiisoft\Db\Schema\Column\DoubleColumn;
use Yiisoft\Db\Schema\Column\IntegerColumn;
use Yiisoft\Db\Schema\Column\JsonColumn;
Expand Down Expand Up @@ -81,15 +81,15 @@ public static function columns(): array
scale: 2,
defaultValue: '33.22',
),
'timestamp_col' => new DatetimeColumn(
'timestamp_col' => new DateTimeColumn(
ColumnType::TIMESTAMP,
dbType: 'timestamp',
notNull: true,
defaultValue: new DateTimeImmutable('2002-01-01 00:00:00'),
hasTimezone: false,
shouldConvertTimezone: true,
),
'timestamp_default' => new DatetimeColumn(
'timestamp_default' => new DateTimeColumn(
ColumnType::TIMESTAMP,
dbType: 'timestamp',
notNull: true,
Expand Down Expand Up @@ -151,19 +151,19 @@ public static function columns(): array
notNull: true,
defaultValue: 'CURRENT_TIMESTAMP',
),
'timestamp_text' => new DatetimeColumn(
'timestamp_text' => new DateTimeColumn(
ColumnType::DATETIMETZ,
dbType: 'text',
notNull: true,
defaultValue: new Expression('CURRENT_TIMESTAMP'),
),
'time_text' => new DatetimeColumn(
'time_text' => new DateTimeColumn(
ColumnType::TIMETZ,
dbType: 'text',
notNull: true,
defaultValue: new Expression('CURRENT_TIME'),
),
'date_text' => new DatetimeColumn(
'date_text' => new DateTimeColumn(
ColumnType::DATE,
dbType: 'text',
notNull: true,
Expand Down Expand Up @@ -282,7 +282,7 @@ public static function resultColumns(): array
'len' => -1,
'precision' => 0,
]],
[new DatetimeColumn(ColumnType::TIMESTAMP, dbType: 'timestamp', name: 'timestamp_col'), [
[new DateTimeColumn(ColumnType::TIMESTAMP, dbType: 'timestamp', name: 'timestamp_col'), [
'native_type' => 'null',
'pdo_type' => 0,
'sqlite:decl_type' => 'timestamp',
Expand Down
Loading