Skip to content

Commit

Permalink
Rename ListModels as ListRecords
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed Sep 30, 2023
1 parent 52a73d0 commit b91b3d9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
### New features

- Added a `ConfigBuilder`, to follow ICanBoogie/Config changes. Use ActiveRecord's `ConfigBuilder`.
- Added the console commands `activerecord:connections:list` and `activerecord:models:list`, with aliases `activerecord:connections` and `activerecord:models` respectively.
- Added the console commands `activerecord:connections` and `activerecord:records` (alias `activerecords`).
- Configures `StaticModelResolver`.

### Backward Incompatible Changes
Expand Down
4 changes: 2 additions & 2 deletions config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ services:

# Console

ICanBoogie\Binding\ActiveRecord\Console\ListModelsCommand:
class: ICanBoogie\Binding\ActiveRecord\Console\ListModelsCommand
ICanBoogie\Binding\ActiveRecord\Console\ListRecordsCommand:
class: ICanBoogie\Binding\ActiveRecord\Console\ListRecordsCommand
arguments:
$style: '%console.style.table%'
tags: [ console.command ]
Expand Down
4 changes: 3 additions & 1 deletion lib/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$rows[] = [
$activerecord_class,
isset($already_installed[$activerecord_class]) ? "Already" : (isset($installed[$activerecord_class]) ? "Yes" : "No"),
isset($already_installed[$activerecord_class])

Check failure on line 89 in lib/Console/InstallCommand.php

View workflow job for this annotation

GitHub Actions / phpstan

Offset class-string<ICanBoogie\ActiveRecord\Model> on array<class-string<ICanBoogie\ActiveRecord>, true> in isset() does not exist.
? "Already"
: (isset($installed[$activerecord_class]) ? "Yes" : "No"),

Check failure on line 91 in lib/Console/InstallCommand.php

View workflow job for this annotation

GitHub Actions / phpstan

Offset class-string<ICanBoogie\ActiveRecord\Model> on array<class-string<ICanBoogie\ActiveRecord>, true> in isset() does not exist.
$errors[$activerecord_class] ?? "",

Check failure on line 92 in lib/Console/InstallCommand.php

View workflow job for this annotation

GitHub Actions / phpstan

Offset class-string<ICanBoogie\ActiveRecord\Model> on array<class-string<ICanBoogie\ActiveRecord>, string> on left side of ?? does not exist.
];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Console/ListConnectionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('activerecord:connections', "List active record connections", [ 'activerecord:connections:list' ])]
#[AsCommand('activerecord:connections', "List active record connections")]
final class ListConnectionsCommand extends Command
{
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

#[AsCommand('activerecord:models', "List ActiveRecord models", [ 'activerecord:models:list' ])]
final class ListModelsCommand extends Command
#[AsCommand('activerecord:records', "List ActiveRecords", [ 'activerecords' ])]
final class ListRecordsCommand extends Command
{
public function __construct(
private readonly Config $config,
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/Console/ListModelsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Test\ICanBoogie\Binding\ActiveRecord\Console;

use ICanBoogie\Binding\ActiveRecord\Console\ListModelsCommand;
use ICanBoogie\Binding\ActiveRecord\Console\ListRecordsCommand;
use ICanBoogie\Console\Test\CommandTestCase;
use Test\ICanBoogie\Binding\ActiveRecord\Acme\Node;
use Test\ICanBoogie\Binding\ActiveRecord\Acme\NodeModel;
Expand All @@ -15,7 +15,7 @@ public static function provideExecute(): array

[
'activerecord:models',
ListModelsCommand::class,
ListRecordsCommand::class,
[],
[
Node::class,
Expand Down

0 comments on commit b91b3d9

Please sign in to comment.