-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add event for Readable class
to extend referrer with readable labels for defined domains
- Loading branch information
1 parent
3d9148c
commit aee4445
Showing
4 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
namespace In2code\Lux\Events; | ||
|
||
final class ReadableReferrersEvent | ||
{ | ||
protected string $referrer; | ||
protected array $sources; | ||
|
||
public function __construct(string $referrer, array $sources) | ||
{ | ||
$this->referrer = $referrer; | ||
$this->sources = $sources; | ||
} | ||
|
||
public function getReferrer(): string | ||
{ | ||
return $this->referrer; | ||
} | ||
|
||
public function setReferrer(string $referrer): self | ||
{ | ||
$this->referrer = $referrer; | ||
return $this; | ||
} | ||
|
||
public function getSources(): array | ||
{ | ||
return $this->sources; | ||
} | ||
|
||
public function setSources(array $sources): self | ||
{ | ||
$this->sources = $sources; | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Tests/Unit/Fixtures/Domain/Service/Referrer/ReadableFixture.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace In2code\Lux\Tests\Unit\Fixtures\Domain\Service\Referrer; | ||
|
||
use In2code\Lux\Domain\Service\Referrer\Readable; | ||
|
||
class ReadableFixture extends Readable | ||
{ | ||
public function __construct(string $referrer = '') | ||
{ | ||
$this->referrer = $referrer; | ||
} | ||
} |