Skip to content

Commit

Permalink
v3.1.0 -- Use new symfony/php attributes instead of annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbrown committed Dec 16, 2022
1 parent dc2f94b commit 91ffb98
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 77 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
This changelog references the relevant changes done in 3.x versions.


## v3.1.0
* Require gdbots/pbjx-bundle 3.1.x
* Use new symfony/php attributes instead of annotations.


## v3.0.1
* Fix bug with sprintf and enum (can't cast to string) in ReindexNodesCommand and SyncNodesCommand.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"require": {
"php": ">=8.1",
"gdbots/ncr": "^3.0",
"gdbots/pbjx-bundle": "^3.0"
"gdbots/pbjx-bundle": "^3.1"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
10 changes: 3 additions & 7 deletions src/Command/CreateSearchStorageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Gdbots\Pbj\MessageResolver;
use Gdbots\Pbj\SchemaCurie;
use Gdbots\Pbj\SchemaQName;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -15,16 +16,11 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:create-search-storage')]
final class CreateSearchStorageCommand extends Command
{
protected static $defaultName = 'ncr:create-search-storage';
protected ContainerInterface $container;
protected NcrSearch $ncrSearch;

public function __construct(ContainerInterface $container, NcrSearch $ncrSearch)
public function __construct(protected ContainerInterface $container, protected NcrSearch $ncrSearch)
{
$this->container = $container;
$this->ncrSearch = $ncrSearch;
parent::__construct();
}

Expand Down
10 changes: 3 additions & 7 deletions src/Command/CreateStorageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Gdbots\Pbj\MessageResolver;
use Gdbots\Pbj\SchemaCurie;
use Gdbots\Pbj\SchemaQName;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -15,16 +16,11 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:create-storage')]
final class CreateStorageCommand extends Command
{
protected static $defaultName = 'ncr:create-storage';
protected ContainerInterface $container;
protected Ncr $ncr;

public function __construct(ContainerInterface $container, Ncr $ncr)
public function __construct(protected ContainerInterface $container, protected Ncr $ncr)
{
$this->container = $container;
$this->ncr = $ncr;
parent::__construct();
}

Expand Down
10 changes: 3 additions & 7 deletions src/Command/DescribeSearchStorageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Gdbots\Pbj\MessageResolver;
use Gdbots\Pbj\SchemaCurie;
use Gdbots\Pbj\SchemaQName;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -15,16 +16,11 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:describe-search-storage')]
final class DescribeSearchStorageCommand extends Command
{
protected static $defaultName = 'ncr:describe-search-storage';
protected ContainerInterface $container;
protected NcrSearch $ncrSearch;

public function __construct(ContainerInterface $container, NcrSearch $ncrSearch)
public function __construct(protected ContainerInterface $container, protected NcrSearch $ncrSearch)
{
$this->container = $container;
$this->ncrSearch = $ncrSearch;
parent::__construct();
}

Expand Down
10 changes: 3 additions & 7 deletions src/Command/DescribeStorageCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Gdbots\Pbj\MessageResolver;
use Gdbots\Pbj\SchemaCurie;
use Gdbots\Pbj\SchemaQName;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -15,16 +16,11 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:describe-storage')]
final class DescribeStorageCommand extends Command
{
protected static $defaultName = 'ncr:describe-storage';
protected ContainerInterface $container;
protected Ncr $ncr;

public function __construct(ContainerInterface $container, Ncr $ncr)
public function __construct(protected ContainerInterface $container, protected Ncr $ncr)
{
$this->container = $container;
$this->ncr = $ncr;
parent::__construct();
}

Expand Down
10 changes: 3 additions & 7 deletions src/Command/ExportNodesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Gdbots\Pbj\SchemaCurie;
use Gdbots\Pbj\SchemaQName;
use Gdbots\Pbj\Util\NumberUtil;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -16,16 +17,11 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:export-nodes')]
final class ExportNodesCommand extends Command
{
protected static $defaultName = 'ncr:export-nodes';
protected ContainerInterface $container;
protected Ncr $ncr;

public function __construct(ContainerInterface $container, Ncr $ncr)
public function __construct(protected ContainerInterface $container, protected Ncr $ncr)
{
$this->container = $container;
$this->ncr = $ncr;
parent::__construct();
}

Expand Down
10 changes: 3 additions & 7 deletions src/Command/GetNodeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use Gdbots\Ncr\Ncr;
use Gdbots\Pbj\WellKnown\NodeRef;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -13,16 +14,11 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:get-node')]
final class GetNodeCommand extends Command
{
protected static $defaultName = 'ncr:get-node';
protected ContainerInterface $container;
protected Ncr $ncr;

public function __construct(ContainerInterface $container, Ncr $ncr)
public function __construct(protected ContainerInterface $container, protected Ncr $ncr)
{
$this->container = $container;
$this->ncr = $ncr;
parent::__construct();
}

Expand Down
17 changes: 7 additions & 10 deletions src/Command/ReindexNodesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Gdbots\Pbj\SchemaCurie;
use Gdbots\Pbj\SchemaQName;
use Gdbots\Pbj\Util\NumberUtil;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -18,18 +19,14 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:reindex-nodes')]
final class ReindexNodesCommand extends Command
{
protected static $defaultName = 'ncr:reindex-nodes';
protected ContainerInterface $container;
protected Ncr $ncr;
protected NcrSearch $ncrSearch;

public function __construct(ContainerInterface $container, Ncr $ncr, NcrSearch $ncrSearch)
{
$this->container = $container;
$this->ncr = $ncr;
$this->ncrSearch = $ncrSearch;
public function __construct(
protected ContainerInterface $container,
protected Ncr $ncr,
protected NcrSearch $ncrSearch
) {
parent::__construct();
}

Expand Down
20 changes: 8 additions & 12 deletions src/Command/SyncNodeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Gdbots\Ncr\NcrSearch;
use Gdbots\Pbj\WellKnown\NodeRef;
use Gdbots\Pbjx\Pbjx;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -17,20 +18,15 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:sync-node')]
final class SyncNodeCommand extends Command
{
protected static $defaultName = 'ncr:sync-node';
protected ContainerInterface $container;
protected Ncr $ncr;
protected NcrSearch $ncrSearch;
protected Pbjx $pbjx;

public function __construct(ContainerInterface $container, Ncr $ncr, NcrSearch $ncrSearch, Pbjx $pbjx)
{
$this->container = $container;
$this->ncr = $ncr;
$this->ncrSearch = $ncrSearch;
$this->pbjx = $pbjx;
public function __construct(
protected ContainerInterface $container,
protected Ncr $ncr,
protected NcrSearch $ncrSearch,
protected Pbjx $pbjx
) {
parent::__construct();
}

Expand Down
20 changes: 8 additions & 12 deletions src/Command/SyncNodesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Gdbots\Pbj\SchemaQName;
use Gdbots\Pbj\Util\NumberUtil;
use Gdbots\Pbjx\Pbjx;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -20,20 +21,15 @@
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerInterface;

#[AsCommand(name: 'ncr:sync-nodes')]
final class SyncNodesCommand extends Command
{
protected static $defaultName = 'ncr:sync-nodes';
protected ContainerInterface $container;
protected Ncr $ncr;
protected NcrSearch $ncrSearch;
protected Pbjx $pbjx;

public function __construct(ContainerInterface $container, Ncr $ncr, NcrSearch $ncrSearch, Pbjx $pbjx)
{
$this->container = $container;
$this->ncr = $ncr;
$this->ncrSearch = $ncrSearch;
$this->pbjx = $pbjx;
public function __construct(
protected ContainerInterface $container,
protected Ncr $ncr,
protected NcrSearch $ncrSearch,
protected Pbjx $pbjx
) {
parent::__construct();
}

Expand Down

0 comments on commit 91ffb98

Please sign in to comment.