for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Xabbuh\XApi\Model\Interaction;
use Xabbuh\XApi\Model\LanguageMap;
/**
* An XAPI activity interaction component.
* @author Christian Flothmann <[email protected]>
final class InteractionComponent
{
private $id;
private $description;
public function __construct(string $id, LanguageMap $description = null)
$this->id = $id;
$this->description = $description;
}
public function getId(): string
return $this->id;
public function getDescription(): ?LanguageMap
return $this->description;
public function equals(InteractionComponent $interactionComponent): bool
if ($this->id !== $interactionComponent->id) {
return false;
if (null !== $this->description xor null !== $interactionComponent->description) {
if (null !== $this->description && null !== $interactionComponent->description && !$this->description->equals($interactionComponent->description)) {
return true;