Merge branch 'master' into master

This commit is contained in:
Bertus Steenberg 2020-09-08 22:22:51 +02:00 committed by GitHub
commit 62b8b89c60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,10 @@
# Changelog # Changelog
## 1.0.5 - 2020-03-16
* Update call to array_get helper to use the Illuminate\Support\Arr class
* Enable Laravel 7 compatability
## 1.0.4 - 2019-10-17 ## 1.0.4 - 2019-10-17
* Enable Laravel 6.0 compatability * Enable Laravel 6.0 compatability

View file

@ -10,15 +10,9 @@
], ],
"require": { "require": {
"php": ">=5.6.0", "php": ">=5.6.0",
<<<<<<< HEAD
"illuminate/support": "^4.0", "illuminate/support": "^4.0",
"illuminate/routing": "^4.0", "illuminate/routing": "^4.0",
"jimdo/prometheus_client_php": "^0.9.1" "jimdo/prometheus_client_php": "^0.9.1"
=======
"illuminate/support": "^5.3 || ^6.0",
"illuminate/routing": "^5.3 || ^6.0",
"jimdo/prometheus_client_php": "^0.9.0"
>>>>>>> c1cd48549fb5270120d4c529e6dad739383843fc
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View file

@ -2,6 +2,7 @@
namespace Superbalist\LaravelPrometheusExporter; namespace Superbalist\LaravelPrometheusExporter;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Prometheus\CollectorRegistry; use Prometheus\CollectorRegistry;
@ -51,7 +52,7 @@ class PrometheusServiceProvider extends ServiceProvider
$factory = $app['prometheus.storage_adapter_factory']; /** @var StorageAdapterFactory $factory */ $factory = $app['prometheus.storage_adapter_factory']; /** @var StorageAdapterFactory $factory */
$driver = config('prometheus.storage_adapter'); $driver = config('prometheus.storage_adapter');
$configs = config('prometheus.storage_adapters'); $configs = config('prometheus.storage_adapters');
$config = array_get($configs, $driver, []); $config = Arr::get($configs, $driver, []);
return $factory->make($driver, $config); return $factory->make($driver, $config);
}); });
$this->app->alias(Adapter::class, 'prometheus.storage_adapter'); $this->app->alias(Adapter::class, 'prometheus.storage_adapter');