Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use #[AsCommand] attribute on commands #1311

Merged
merged 4 commits into from
Oct 22, 2023
Merged

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Aug 16, 2023

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
Copy link
Contributor Author

ruudk commented Aug 16, 2023

@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
Copy link
Contributor Author

ruudk commented Aug 16, 2023

Rebased because #1295 #1303 were merged

@ruudk
Copy link
Contributor Author

ruudk commented Aug 16, 2023

@makasim please approve the workflow again.

@ruudk
Copy link
Contributor Author

ruudk commented Aug 17, 2023

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

@ruudk
Copy link
Contributor Author

ruudk commented Aug 17, 2023

Errors are unrelated to my changes. I give up.

@ruudk
Copy link
Contributor Author

ruudk commented Sep 11, 2023

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

@makasim
Copy link
Member

makasim commented Sep 11, 2023

CI should pass

@VincentLanglet
Copy link
Contributor

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

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
Copy link
Contributor Author

ruudk commented Oct 15, 2023

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
34 checks passed
@VincentLanglet
Copy link
Contributor

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

@ruudk
Copy link
Contributor Author

ruudk commented Oct 23, 2023

@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
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