Skip to content

Commit 0b7fd3d

Browse files
Merge pull request #12 from virta-ltd/fix-asserts
Fix wrong assert and instance check
2 parents 949416a + 74a4195 commit 0b7fd3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PrometheusServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Support\ServiceProvider;
1212
use Override;
1313
use Prometheus\CollectorRegistry;
14+
use Prometheus\RegistryInterface;
1415
use Prometheus\Storage\Adapter;
1516
use Webmozart\Assert\Assert;
1617

@@ -36,9 +37,9 @@ public function boot(PrometheusExporter $exporter): void
3637

3738
foreach ($collectorClasses as $class) {
3839
Assert::classExists($class, "Invalid PrometheusCollector specified.");
39-
Assert::implementsInterface($class, CollectorRegistry::class);
40+
Assert::implementsInterface($class, CollectorInterface::class);
4041
$collector = $this->app->make($class);
41-
Assert::implementsInterface($collector, CollectorInterface::class);
42+
Assert::isInstanceOf($collector, CollectorInterface::class);
4243
$exporter->registerCollector($collector);
4344
}
4445
}

0 commit comments

Comments
 (0)