Skip to content

Raptor integration - feature branch: Rework PHP#3131

Merged
adriendupuis merged 11 commits intoraptor_integration_feature_branchfrom
raptor_integration_feature_branch-php-rework
Apr 13, 2026
Merged

Raptor integration - feature branch: Rework PHP#3131
adriendupuis merged 11 commits intoraptor_integration_feature_branchfrom
raptor_integration_feature_branch-php-rework

Conversation

@adriendupuis
Copy link
Copy Markdown
Contributor

@adriendupuis adriendupuis commented Apr 13, 2026

Question Answer
JIRA Ticket
Versions
Edition

Rework #3121 PHP API usage

  • Add an introduction about the tracking event dispatcher service (guessing it's the one refered as "the service")
  • Detail the event mapper usage

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Should fix PhpStan errors "Variable $product might not be defined."
Should fix PhpStan error "invalid type App\Tracking\ProductInterface"
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

@adriendupuis adriendupuis changed the base branch from 5.0 to raptor_integration_feature_branch April 13, 2026 10:31
…ion_feature_branch-php-rework

# Conflicts:
#	code_samples/recommendations/EventMapper.php
@adriendupuis adriendupuis marked this pull request as ready for review April 13, 2026 10:52
Copy link
Copy Markdown
Contributor

@dabrt dabrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some minor issues that need fixing

Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
@adriendupuis adriendupuis requested a review from tbialcz April 13, 2026 11:11
@adriendupuis adriendupuis requested a review from dabrt April 13, 2026 13:48
@github-actions
Copy link
Copy Markdown

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/recommendations/EventMapper.php


code_samples/recommendations/EventMapper.php

docs/recommendations/raptor_integration/tracking_php_api.md@19:``` php
docs/recommendations/raptor_integration/tracking_php_api.md@20:[[= include_file('code_samples/recommendations/EventMapper.php') =]]
docs/recommendations/raptor_integration/tracking_php_api.md@21:```
docs/recommendations/raptor_integration/tracking_php_api.md@39:``` php
docs/recommendations/raptor_integration/tracking_php_api.md@40:[[= include_file('code_samples/recommendations/EventMapper.php', 4, 8) =]]//…
docs/recommendations/raptor_integration/tracking_php_api.md@41:
docs/recommendations/raptor_integration/tracking_php_api.md@42:[[= include_file('code_samples/recommendations/EventMapper.php', 20, 27, remove_indent=True) =]]
docs/recommendations/raptor_integration/tracking_php_api.md@43:```


001⫶<?php declare(strict_types=1);
002⫶
003⫶namespace App\Tracking;
004⫶
005⫶use Ibexa\Contracts\ConnectorRaptor\Tracking\EventMapperInterface;
006⫶use Ibexa\Contracts\ConnectorRaptor\Tracking\EventType;
007⫶use Ibexa\Contracts\ConnectorRaptor\Tracking\ServerSideTrackingDispatcherInterface;
008⫶use Ibexa\Contracts\ProductCatalog\Values\ProductInterface;
009⫶
010⫶class EventMapper
011⫶{
012⫶ public function __construct(
013⫶ private readonly EventMapperInterface $eventMapper,
014⫶ private readonly ServerSideTrackingDispatcherInterface $trackingDispatcher,
015⫶ ) {
016⫶ }
017⫶
018⫶ public function trackProductView(ProductInterface $product, string $url): void
019⫶ {
020⫶ // Map product to VisitEventData automatically
021⫶ $eventData = $this->eventMapper->map(EventType::VISIT, $product);
022⫶
023⫶ // Send tracking event
024⫶ $this->trackingDispatcher->dispatch($eventData);
025⫶ }
026⫶}
The following line doesn't include file correctly: [[= include_file('code_samples/recommendations/EventMapper.php', 20, 27, remove_indent=True) =]]


Download colorized diff

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
8 Security Hotspots
42.7% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@adriendupuis adriendupuis merged commit ce553c5 into raptor_integration_feature_branch Apr 13, 2026
10 of 11 checks passed
@adriendupuis adriendupuis deleted the raptor_integration_feature_branch-php-rework branch April 13, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants