diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 60ec9ea..03fc702 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -17,8 +17,14 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('miracode_stripe'); + $treeBuilder = new TreeBuilder('miracode_stripe'); + + if (method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + // for symfony/config 4.1 and older + $rootNode = $treeBuilder->root('miracode_stripe'); + } $supportedDrivers = array('orm', /** coming soon) */); diff --git a/Event/StripeEvent.php b/Event/StripeEvent.php index a4c2fe8..022cb07 100644 --- a/Event/StripeEvent.php +++ b/Event/StripeEvent.php @@ -4,7 +4,7 @@ use Miracode\StripeBundle\StripeException; use Stripe\StripeObject; -use Symfony\Component\EventDispatcher\Event; +use Symfony\Contracts\EventDispatcher\Event; class StripeEvent extends Event {