Permalink
Browse files

Merge pull request #83 from PBWebMedia/symfony3

Symfony3 compatibility
  • Loading branch information...
jonaswouters committed Mar 11, 2016
2 parents 03a5d0a + 8220370 commit 33b23b0de9aae9d698995d6883abc99468bde9ac
Showing with 15 additions and 20 deletions.
  1. +4 −10 EventListener/CommandListener.php
  2. +11 −10 composer.json
@@ -4,7 +4,6 @@
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
-use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Jns\Bundle\XhprofBundle\DataCollector\XhprofCollector;
@@ -78,19 +77,14 @@ public function setWebLocation($webLocation)
*/
private function isProfileOption(ConsoleCommandEvent $event)
{
- $inputDefinition = $event->getCommand()->getApplication()->getDefinition();
+ $definition = $event->getCommand()->getDefinition();
- $inputDefinition->addOption(
+ $definition->addOption(
new InputOption($this->optionName, null, InputOption::VALUE_NONE, '<info>JnsXhprofBundle</info>: Whether to profile this command with xhprof', null)
);
- // merge the application's input definition
- $event->getCommand()->mergeApplicationDefinition();
-
- $input = new ArgvInput();
-
- // we use the input definition of the command
- $input->bind($event->getCommand()->getDefinition());
+ $input = $event->getInput();
+ $input->bind($definition);
return $input->getOption($this->optionName);
}
View
@@ -12,15 +12,16 @@
}
],
"require": {
- "php": ">=5.3.2",
- "symfony/http-kernel": "2.*",
- "symfony/dependency-injection": "2.*",
- "lox/xhprof": "dev-master@dev"
+ "php": "^5.3.2|^7.0",
+ "symfony/http-kernel": "^2.3|^3.0",
+ "symfony/dependency-injection": "^2.3|^3.0",
+ "pbweb/xhprof": "^1.0"
},
"require-dev": {
"doctrine/common": "^2.5",
- "phpspec/prophecy": "~1.1.2",
- "phpunit/phpunit": "~4.1.3"
+ "symfony/console":"^2.8|^3.0",
+ "phpspec/prophecy": "^1.1.2",
+ "phpunit/phpunit": "^4.1.3"
},
"suggest": {
"ext-xhprof": "Hierarchical Profiler for PHP",
@@ -34,10 +35,10 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.x-dev"
}
- },
- "config": {
+ },
+ "config": {
"bin-dir": "bin/"
- }
+ }
}

0 comments on commit 33b23b0

Please sign in to comment.