-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from wmde/remove-freezable-value-object
Remove freezable value object
- Loading branch information
Showing
28 changed files
with
217 additions
and
494 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
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
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 |
---|---|---|
|
@@ -4,131 +4,17 @@ | |
|
||
namespace WMDE\Fundraising\DonationContext\Domain\Model; | ||
|
||
use WMDE\FreezableValueObject\FreezableValueObject; | ||
|
||
/** | ||
* TODO: move to Infrastructure | ||
* | ||
* @license GPL-2.0-or-later | ||
* @author Kai Nissen < [email protected] > | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class DonationTrackingInfo { | ||
use FreezableValueObject; | ||
|
||
private string $tracking; | ||
private string $source = ''; | ||
private int $totalImpressionCount; | ||
private int $singleBannerImpressionCount; | ||
private string $color = ''; | ||
private string $skin = ''; | ||
private string $layout = ''; | ||
|
||
private function __construct() { | ||
} | ||
|
||
public function getTracking(): string { | ||
return $this->tracking; | ||
} | ||
|
||
public function setTracking( string $tracking ): void { | ||
$this->assertIsWritable(); | ||
$this->tracking = $tracking; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @return string | ||
*/ | ||
public function getSource(): string { | ||
return $this->source; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @param string $source | ||
*/ | ||
public function setSource( string $source ): void { | ||
$this->assertIsWritable(); | ||
$this->source = $source; | ||
} | ||
|
||
public function getTotalImpressionCount(): int { | ||
return $this->totalImpressionCount; | ||
} | ||
|
||
public function setTotalImpressionCount( int $totalImpressionCount ): void { | ||
$this->assertIsWritable(); | ||
$this->totalImpressionCount = $totalImpressionCount; | ||
} | ||
|
||
public function getSingleBannerImpressionCount(): int { | ||
return $this->singleBannerImpressionCount; | ||
} | ||
|
||
public function setSingleBannerImpressionCount( int $singleBannerImpressionCount ): void { | ||
$this->assertIsWritable(); | ||
$this->singleBannerImpressionCount = $singleBannerImpressionCount; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @return string | ||
*/ | ||
public function getColor(): string { | ||
return $this->color; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @param string $color | ||
*/ | ||
public function setColor( string $color ): void { | ||
$this->assertIsWritable(); | ||
$this->color = $color; | ||
} | ||
|
||
public function getSkin(): string { | ||
return $this->skin; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @param string $skin | ||
*/ | ||
public function setSkin( string $skin ): void { | ||
$this->assertIsWritable(); | ||
$this->skin = $skin; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @return string | ||
*/ | ||
public function getLayout(): string { | ||
return $this->layout; | ||
} | ||
|
||
/** | ||
* @deprecated See https://phabricator.wikimedia.org/T134327 | ||
* @param string $layout | ||
*/ | ||
public function setLayout( string $layout ): void { | ||
$this->assertIsWritable(); | ||
$this->layout = $layout; | ||
public function __construct( | ||
public readonly string $tracking = '', | ||
public readonly int $totalImpressionCount = 0, | ||
public readonly int $singleBannerImpressionCount = 0, | ||
) { | ||
} | ||
|
||
public static function newBlankTrackingInfo(): self { | ||
$trackingInfo = new self(); | ||
$trackingInfo->setColor( '' ); | ||
$trackingInfo->setLayout( '' ); | ||
$trackingInfo->setSingleBannerImpressionCount( 0 ); | ||
$trackingInfo->setSkin( '' ); | ||
$trackingInfo->setSource( '' ); | ||
$trackingInfo->setTotalImpressionCount( 0 ); | ||
$trackingInfo->setTracking( '' ); | ||
|
||
return $trackingInfo; | ||
return new self(); | ||
} | ||
|
||
} |
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,18 @@ | ||
<?php | ||
|
||
declare( strict_types = 1 ); | ||
|
||
namespace WMDE\Fundraising\DonationContext\Domain\ReadModel; | ||
|
||
use DateTime; | ||
|
||
class Comment { | ||
public function __construct( | ||
public readonly string $authorName, | ||
public readonly float $donationAmount, | ||
public readonly string $commentText, | ||
public readonly DateTime $donationTime, | ||
public readonly int $donationId | ||
) { | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
|
||
namespace WMDE\Fundraising\DonationContext\Domain\Repositories; | ||
|
||
use WMDE\Fundraising\DonationContext\Domain\ReadModel\Comment; | ||
|
||
/** | ||
* @license GPL-2.0-or-later | ||
* @author Jeroen De Dauw < [email protected] > | ||
|
@@ -16,7 +18,7 @@ interface CommentFinder { | |
* @param int $limit | ||
* @param int $offset | ||
* | ||
* @return CommentWithAmount[] | ||
* @return Comment[] | ||
*/ | ||
public function getPublicComments( int $limit, int $offset = 0 ): array; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.