Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix the ContainerAwareCommand deprecation #868

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

Closed
javiereguiluz opened this issue Oct 5, 2018 · 8 comments
Closed

Fix the ContainerAwareCommand deprecation #868

javiereguiluz opened this issue Oct 5, 2018 · 8 comments

Comments

@javiereguiluz
Copy link
Member

These deprecations were introduced by the upgrade to Symfony 4.2 in #865.

1x: The "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" class is deprecated since Symfony 4.2, use "Symfony\Component\Console\Command\Command" with dependency injection instead.
    1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command

1x: The "Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand" class extends "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" that is deprecated since Symfony 4.2, use {@see Command} instead.
    1x in AddUserCommandTest::testCreateUserNonInteractive from App\Tests\Command
@dmaicher
Copy link
Contributor

From what I can see those are not coming from symfony or the demo itself, right? Seems only doctrine-bundle + swiftmailer-bundle are extending from ContainerAwareCommand.

@stof
Copy link
Member

stof commented Oct 26, 2018

yeah, these bundles are probably not yet migrated away from it. But knowing it is still good.

@Tobion
Copy link
Contributor

Tobion commented Nov 1, 2018

Ref. symfony/symfony#28415 (comment)

@stof
Copy link
Member

stof commented Dec 11, 2018

DoctrineBundle 1.10.0 was released, removing that deprecation.

SwiftmailerBundle also fixed it, but it is not released yet.

@javiereguiluz
Copy link
Member Author

Closing as fixed. There are no more deprecations. Thank you all!

@ghost
Copy link

ghost commented Oct 14, 2019

@Tobion

yeah, these bundles are probably not yet migrated away from it. But knowing it is still good.

@javiereguiluz

Closing as fixed. There are no more deprecations. Thank you all!

just fyi-ing; nothing's fatal afaict.

spinning up a new sf proj today, still bumping into this -- with:

[▼
  "exception" => SilencedErrorContext^ {#1262 ▼
    +count: 1
    -severity: E_USER_DEPRECATED
    trace: {▼
      /test/sf0173/vendor/symfony/framework-bundle/Command/ContainerAwareCommand.php:18 {▼
        › 
        › @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use "%s" with dependency injection instead.', ContainerAwareCommand::class, Command::class), E_USER_DEPRECATED);
        › 
      }
      /test/sf0173/vendor/friendsofsymfony/http-cache-bundle/src/Command/BaseInvalidateCommand.php:22 {▼
        ›  */
        › abstract class BaseInvalidateCommand extends ContainerAwareCommand
        › {
      }
    }
  }
]

{▼
  /test/sf0173/vendor/symfony/framework-bundle/Command/ContainerAwareCommand.php:18 {▼
    › 
    › @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use "%s" with dependency injection instead.', ContainerAwareCommand::class, Command::class), E_USER_DEPRECATED);
    › 
  }
  /test/sf0173/vendor/friendsofsymfony/http-cache-bundle/src/Command/BaseInvalidateCommand.php:22 {▼
    ›  */
    › abstract class BaseInvalidateCommand extends ContainerAwareCommand
    › {
  }
}

The "FOS\HttpCacheBundle\Command\BaseInvalidateCommand" class extends "Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand" that is deprecated since Symfony 4.2, use {@see Command} instead.
Hide context    Hide trace

[▼
  "exception" => SilencedErrorContext^ {#955 ▼
    +count: 1
    -severity: E_USER_DEPRECATED
    trace: {▼
      /test/sf0173/vendor/symfony/debug/DebugClassLoader.php:200 {▼
        › foreach ($deprecations as $message) {
        ›     @trigger_error($message, E_USER_DEPRECATED);
        › }
      }
      /test/sf0173/vendor/friendsofsymfony/http-cache-bundle/src/Command/InvalidatePathCommand.php:24 {▼
        ›  */
        › class InvalidatePathCommand extends BaseInvalidateCommand
        › {
      }
    }
  }
]

{▼
  /test/sf0173/vendor/symfony/debug/DebugClassLoader.php:200 {▼
    › foreach ($deprecations as $message) {
    ›     @trigger_error($message, E_USER_DEPRECATED);
    › }
  }
  /test/sf0173/vendor/friendsofsymfony/http-cache-bundle/src/Command/InvalidatePathCommand.php:24 {▼
    ›  */
    › class InvalidatePathCommand extends BaseInvalidateCommand
    › {
  }
}

@dmaicher
Copy link
Contributor

@hal869 your issue is about friendsofsymfony/http-cache-bundle which is not installed with the Symfony Demo? So how is it related? 😊

@ghost
Copy link

ghost commented Oct 15, 2019

it isn't.

searched on the error + symfony -- completely missed the /demo.

sigh. my bad

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

No branches or pull requests

4 participants