Permalink
Browse files

Fix #34. Evaluation of indirect expressions in PHP7

  • Loading branch information...
1 parent 8c31ec0 commit 6c81ab40d025503a8063cfddd0391a9c29cc9d2c @endeveit endeveit committed Sep 22, 2016
Showing with 33 additions and 20 deletions.
  1. +1 −0 .travis.yml
  2. +16 −10 src/Laravel/Provider/StatsdServiceProvider.php
  3. +16 −10 src/Laravel5/Provider/StatsdServiceProvider.php
View
@@ -5,6 +5,7 @@ php:
- 5.4
- 5.5
- 5.6
+ - 7.0
before_script:
- composer self-update
@@ -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
@@ -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

0 comments on commit 6c81ab4

Please sign in to comment.