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
<?php declare(strict_types=1); | |
final class DocumentFormatValidator | |
{ | |
private function validatePrefix(Filename $filename, DocumentFormat $format): void | |
{ | |
$detectedPrefix = $this->detectPrefix($filename); | |
if ($detectedPrefix === null) { | |
if (!$format->requiresPrefix()) { |
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
<?php declare(strict_types=1); | |
namespace Acme\Shared\Application\Service; | |
trait PayloadMessage | |
{ | |
private function __construct() | |
{} | |
/** |
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
Table structure: | |
test_id place_id | |
9b949b1a-414b-43f0-8940-9b821f1e2098 a3358c22-af08-485f-933e-f4d6ce900882 | |
5177ab63-5ecd-4241-913e-36fb9d917efd a3358c22-af08-485f-933e-f4d6ce900882 | |
c16ac09c-8ccf-45b9-8593-7ffceb4d5d9e a3358c22-af08-485f-933e-f4d6ce900882 | |
MySQL: SELECT test_id, place_id FROM transmissions GROUP BY place_id | |
Result (CORRECT): |
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
<?php | |
namespace Acme\Common\Infrastructure\Prooph\EventStore; | |
use Prooph\Common\Messaging\Message; | |
use Prooph\EventStore\Upcasting\SingleEventUpcaster; | |
final class Upcaster extends SingleEventUpcaster | |
{ | |
public function upcast(Message $message): array |
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
<?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
<?php | |
final class EmploymentContract extends AggregateRoot | |
{ | |
/** | |
* @param Details $contractToMerge | |
* This contract is always the initial contract and the oldest one. | |
* Since the contract to merge is always newer it always overwrites the current state. | |
*/ | |
public function mergeWith(Details $contractToMerge): void |
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
<?php | |
use Webmozart\Assert\Assert; | |
final class Address | |
{ | |
/** @var string|null $street */ | |
private $street; | |
/** @var Postcode|null $postcode */ |
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
<?php | |
/** | |
* All characater were allowed in the initial value object. | |
*/ | |
final class FirstName_V1 | |
{ | |
/** @var string $name */ | |
private $name; |
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
<?php | |
namespace Acme\PersonnelManagement\Application\Service\Person; | |
use Acme\Common\Domain\Model\FirstName; | |
use Symfony\Component\Validator\Constraints as Assert; | |
final class ChangeName | |
{ | |
/** |
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
<?php | |
final class Merger | |
{ | |
// ... | |
private function getInitialEventFromStream(EmploymentContractId $contractId): EmploymentContractSigned | |
{ | |
$query = $this->projectionManager->createQuery(); | |
$query | |
->init(function (): array { |
NewerOlder