Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
omarherri authored and github-actions[bot] committed Oct 24, 2024
1 parent 07e7c5a commit c600b5b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
6 changes: 2 additions & 4 deletions src/FacebookPixelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ public function configurePackage(Package $package): void
->hasViews();
}

public function packageBooted(): void
{
}
public function packageBooted(): void {}

public function registeringPackage(): void
{
$this->app->singleton(MetaPixel::class, function () {
return new MetaPixel();
return new MetaPixel;
});
}
}
14 changes: 7 additions & 7 deletions src/MetaPixel.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public function __construct()
$this->token = config('meta-pixel.token');
$this->sessionKey = config('meta-pixel.session_key');
$this->testEventCode = config('meta-pixel.test_event_code');
$this->eventLayer = new EventLayer();
$this->customEventLayer = new EventLayer();
$this->flashEventLayer = new EventLayer();
$this->userData = new UserData();
$this->eventLayer = new EventLayer;
$this->customEventLayer = new EventLayer;
$this->flashEventLayer = new EventLayer;
$this->userData = new UserData;
}

public function pixelId(): string
Expand Down Expand Up @@ -157,9 +157,9 @@ public function send(string $eventName, string $eventID, CustomData $customData,
}

$api = Api::init(null, null, $this->token);
$api->setLogger(new CurlLogger());
$api->setLogger(new CurlLogger);

$event = (new Event())
$event = (new Event)
->setEventName($eventName)
->setEventTime(time())
->setEventId($eventID)
Expand Down Expand Up @@ -233,6 +233,6 @@ public function getUser(): ?array

public function clear(): void
{
$this->eventLayer = new EventLayer();
$this->eventLayer = new EventLayer;
}
}
2 changes: 1 addition & 1 deletion tests/Features/EventLayerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Combindma\FacebookPixel\EventLayer;

beforeEach(function () {
$this->eventLayer = new EventLayer();
$this->eventLayer = new EventLayer;
});

test('it can set and retrieve event data', function () {
Expand Down
4 changes: 2 additions & 2 deletions tests/Features/MetaPixelMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$this->metaPixel->shouldReceive('merge')->with(['some_event' => ['data' => ['param1' => 'value1'], 'event_id' => null]]);
$this->metaPixel->shouldReceive('getFlashedEvent')->andReturn(['some_event' => ['data' => ['param1' => 'value1'], 'event_id' => null]]);

$request = new Request();
$request = new Request;
$response = $this->middleware->handle($request, function ($req) {
return 'response';
});
Expand All @@ -30,7 +30,7 @@
$this->metaPixel->shouldReceive('sessionKey')->andReturn('pixelSessionKey');
$this->metaPixel->shouldReceive('getFlashedEvent')->andReturn(['some_event' => ['data' => ['param1' => 'value1'], 'event_id' => null]]);

$request = new Request();
$request = new Request;
$response = $this->middleware->handle($request, function ($req) {
return 'response';
});
Expand Down
6 changes: 3 additions & 3 deletions tests/Features/MetaPixelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@

$eventName = 'TestEvent';
$eventId = 'EVENT_ID';
$userData = new UserData();
$customData = new CustomData();
$userData = new UserData;
$customData = new CustomData;

expect($this->metaPixel->send($eventName, $eventId, $customData, $userData))->toBeNull();
});
Expand All @@ -166,7 +166,7 @@

$eventName = 'TestEvent';
$eventId = 'EVENT_ID';
$customData = new CustomData();
$customData = new CustomData;

// Expect an Exception with a specific message
expect(fn () => $this->metaPixel->send($eventName, $eventId, $customData))->toThrow(Exception::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
use Combindma\FacebookPixel\Tests\TestCase;

uses(TestCase::class)->beforeEach(function () {
$this->metaPixel = new MetaPixel();
$this->metaPixel = new MetaPixel;
})->in(__DIR__);

0 comments on commit c600b5b

Please sign in to comment.