Skip to content

Commit

Permalink
composer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturMoczulski committed Apr 12, 2018
1 parent 36a2b50 commit f235668
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"composer install",
"./vendor/bin/phpcs --standard=psr2 src/ tests/SymfonyRollbarBundle",
"./vendor/bin/phpunit --coverage-clover build/logs/clover.xml -c tests/"
]
],
"fix": "phpcbf --standard=PSR1,PSR2 src tests"
}
}
48 changes: 24 additions & 24 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,33 @@ public function getConfigTreeBuilder()
$rollbarConfigNode = $rootNode->children()
->arrayNode('rollbar');

foreach (\Rollbar\Config::listOptions() as $option) {
foreach (\Rollbar\Config::listOptions() as $option) {
// TODO: this is duplicated code from
// https://github.com/rollbar/rollbar-php-wordpress/blob/master/src/Plugin.php#L359-L366
// It needs to get replaced with a native rollbar/rollbar-php method
// as pointed out here https://github.com/rollbar/rollbar-php/issues/344
$method = lcfirst(str_replace('_', '', ucwords($option, '_')));

// TODO: this is duplicated code from https://github.com/rollbar/rollbar-php-wordpress/blob/master/src/Plugin.php#L359-L366
// It needs to get replaced with a native rollbar/rollbar-php method
// as pointed out here https://github.com/rollbar/rollbar-php/issues/344
$method = lcfirst(str_replace('_', '', ucwords($option, '_')));
// Handle the "branch" exception
switch ($method) {
case "branch":
$method = "gitBranch";
break;
case "includeErrorCodeContext":
$method = 'includeCodeContext';
break;
case "includeExceptionCodeContext":
$method = 'includeExcCodeContext';
break;
}

// Handle the "branch" exception
switch($method) {
case "branch":
$method = "gitBranch";
break;
case "includeErrorCodeContext":
$method = 'includeCodeContext';
break;
case "includeExceptionCodeContext":
$method = 'includeExcCodeContext';
break;
}
$default = method_exists(\Rollbar\Defaults::get(), $method) ?
\Rollbar\Defaults::get()->$method() :
null;

$default = method_exists(\Rollbar\Defaults::get(), $method) ?
\Rollbar\Defaults::get()->$method() :
null;

$rollbarConfigNode->children()
->scalarNode($option)->defaultValue($default)->end();
}
$rollbarConfigNode->children()
->scalarNode($option)->defaultValue($default)->end();
}

$rollbarConfigNode->end();

Expand Down

0 comments on commit f235668

Please sign in to comment.