Skip to content

Commit

Permalink
Merge pull request #36 from endeveit/bugfix/iss-34-php7
Browse files Browse the repository at this point in the history
Fix #34. Evaluation of indirect expressions in PHP7
  • Loading branch information
marcqualie committed Sep 22, 2016
2 parents 8c31ec0 + 6c81ab4 commit bad91f2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ php:
- 5.4
- 5.5
- 5.6
- 7.0

before_script:
- composer self-update
Expand Down
26 changes: 16 additions & 10 deletions src/Laravel/Provider/StatsdServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,26 @@ protected function registerStatsD()
function ($app) {
// Set Default host and port
$options = array();
if (isset($app['config']['statsd.host'])) {
$options['host'] = $app['config']['statsd.host'];
$config = $app['config'];

if (isset($config['statsd.host'])) {
$options['host'] = $config['statsd.host'];
}
if (isset($app['config']['statsd.port'])) {
$options['port'] = $app['config']['statsd.port'];

if (isset($config['statsd.port'])) {
$options['port'] = $config['statsd.port'];
}
if (isset($app['config']['statsd.namespace'])) {
$options['namespace'] = $app['config']['statsd.namespace'];

if (isset($config['statsd.namespace'])) {
$options['namespace'] = $config['statsd.namespace'];
}
if (isset($app['config']['statsd.timeout'])) {
$options['timeout'] = $app['config']['statsd.timeout'];

if (isset($config['statsd.timeout'])) {
$options['timeout'] = $config['statsd.timeout'];
}
if (isset($app['config']['statsd.throwConnectionExceptions'])) {
$options['throwConnectionExceptions'] = $app['config']['statsd.throwConnectionExceptions'];

if (isset($config['statsd.throwConnectionExceptions'])) {
$options['throwConnectionExceptions'] = (boolean) $config['statsd.throwConnectionExceptions'];
}

// Create
Expand Down
26 changes: 16 additions & 10 deletions src/Laravel5/Provider/StatsdServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,26 @@ protected function registerStatsD()
function ($app) {
// Set Default host and port
$options = array();
if (isset($app['config']['statsd.host'])) {
$options['host'] = $app['config']['statsd.host'];
$config = $app['config'];

if (isset($config['statsd.host'])) {
$options['host'] = $config['statsd.host'];
}
if (isset($app['config']['statsd.port'])) {
$options['port'] = $app['config']['statsd.port'];

if (isset($config['statsd.port'])) {
$options['port'] = $config['statsd.port'];
}
if (isset($app['config']['statsd.namespace'])) {
$options['namespace'] = $app['config']['statsd.namespace'];

if (isset($config['statsd.namespace'])) {
$options['namespace'] = $config['statsd.namespace'];
}
if (isset($app['config']['statsd.timeout'])) {
$options['timeout'] = $app['config']['statsd.timeout'];

if (isset($config['statsd.timeout'])) {
$options['timeout'] = $config['statsd.timeout'];
}
if (isset($app['config']['statsd.throwConnectionExceptions'])) {
$options['throwConnectionExceptions'] = $app['config']['statsd.throwConnectionExceptions'];

if (isset($config['statsd.throwConnectionExceptions'])) {
$options['throwConnectionExceptions'] = (boolean) $config['statsd.throwConnectionExceptions'];
}

// Create
Expand Down

0 comments on commit bad91f2

Please sign in to comment.