Skip to content

Commit

Permalink
custom adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmastech committed Jul 14, 2024
1 parent 1a7208d commit 02deb0f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/AdapterManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Carbon\FactoryImmutable;
use Carbon\WrapperClock;
use Cosmastech\LaravelStatsDAdapter\Adapters\EventDispatchingAdapter;
use Cosmastech\LaravelStatsDAdapter\Adapters\EventDispatchingStatsRecord;
use Cosmastech\StatsDClientAdapter\Adapters\Datadog\DatadogStatsDClientAdapter;
use Cosmastech\StatsDClientAdapter\Adapters\InMemory\InMemoryClientAdapter;
Expand Down Expand Up @@ -183,12 +184,12 @@ protected function createLeagueAdapter(array $config): LeagueStatsDClientAdapter

/**
* @param array<string, mixed> $config
* @return InMemoryClientAdapter
* @return EventDispatchingAdapter
* @throws BindingResolutionException
*/
protected function createEventAdapter(array $config): InMemoryClientAdapter
protected function createEventAdapter(array $config): EventDispatchingAdapter
{
return new InMemoryClientAdapter(
return new EventDispatchingAdapter(
$this->getDefaultTags(),
new EventDispatchingStatsRecord($this->app->make('events')),
clock: $this->getClockImplementation()
Expand Down
9 changes: 9 additions & 0 deletions src/Adapters/EventDispatchingAdapter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Cosmastech\LaravelStatsDAdapter\Adapters;

use Cosmastech\StatsDClientAdapter\Adapters\InMemory\InMemoryClientAdapter;

class EventDispatchingAdapter extends InMemoryClientAdapter
{
}

0 comments on commit 02deb0f

Please sign in to comment.