Skip to content

Use #[AsCommand] attribute on commands - #1311

Merged
makasim merged 4 commits into
php-enqueue:masterfrom
ruudk:symfony-6.3
Oct 22, 2023
Merged

makasim merged 4 commits into
php-enqueue:masterfrom
ruudk:symfony-6.3

Conversation

@ruudk

@ruudk ruudk commented Aug 16, 2023 •

Copy link
Copy Markdown
Contributor

Fixes the following deprecations:

  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Consumption\\ConfigurableConsumeCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\ConsumeCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\ProduceCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\SetupBrokerCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\RoutesCommand\" class instead.",
    "count": 1
  },

@ruudk

ruudk commented Aug 16, 2023

Copy link
Copy Markdown
Contributor Author

@makasim Could you please approve the workflows? Would be great if this was enabled by default. 🙏

@ruudk
ruudk force-pushed the symfony-6.3 branch 3 times, most recently from d0b4b2e to 884f508 Compare August 16, 2023 07:00
@ruudk

ruudk commented Aug 16, 2023

Copy link
Copy Markdown
Contributor Author

Rebased because #1295 #1303 were merged

@ruudk

ruudk commented Aug 16, 2023

Copy link
Copy Markdown
Contributor Author

@makasim please approve the workflow again.

@ruudk

ruudk commented Aug 17, 2023

Copy link
Copy Markdown
Contributor Author

@makasim Pushed a change for the Docker image. Please approve again.

@ruudk

ruudk commented Aug 17, 2023

Copy link
Copy Markdown
Contributor Author

Errors are unrelated to my changes. I give up.

@ruudk

ruudk commented Sep 11, 2023

Copy link
Copy Markdown
Contributor Author

@makasim what's need to be done to get this merged? The errors are not related to my PR.

@makasim

makasim commented Sep 11, 2023

Copy link
Copy Markdown
Member

CI should pass

@VincentLanglet

Copy link
Copy Markdown
Contributor

i fixed the Ci from your PR in #1317 @ruudk @makasim

ruudk added 3 commits October 15, 2023 11:28
Fixes the following deprecations:

```json
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Consumption\\ConfigurableConsumeCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\ConsumeCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\ProduceCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\SetupBrokerCommand\" class instead.",
    "count": 1
  },
  {
    "message": "Since symfony/console 6.1: Relying on the static property \"$defaultName\" for setting a command name is deprecated. Add the \"Symfony\\Component\\Console\\Attribute\\AsCommand\" attribute to the \"Enqueue\\Symfony\\Client\\RoutesCommand\" class instead.",
    "count": 1
  },
```
This way it understands attributes.
Credits to VincentLanglet
@ruudk

ruudk commented Oct 15, 2023

Copy link
Copy Markdown
Contributor Author

Applied the fix to this PR., please approve it so we can get this merged.

@makasim
makasim merged commit d26f091 into php-enqueue:master Oct 22, 2023
@VincentLanglet

Copy link
Copy Markdown
Contributor

Thanks @makasim, A new tag/release would be awesome :)

@ruudk

ruudk commented Oct 23, 2023

Copy link
Copy Markdown
Contributor Author

@VincentLanglet A tag wouldn't help much, as there are still deprecations that need fixing:
#1312

If you have an idea how to solve it, would be great 🙏

@VincentLanglet

Copy link
Copy Markdown
Contributor

@VincentLanglet A tag wouldn't help much, as there are still deprecations that need fixing: #1312

A tag would still be usefull because it solve already a lot of deprecation.
I personally use only some part on this lib, and never got the deprecation from #1312.

If you have an idea how to solve it, would be great 🙏

Did you try to rebase the branch ? And then I think you'll only get the linter error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants