This file contains hidden or 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 AcmersonnelManagement\Domain\Model\EmploymentContract; | |
final class EmploymentContract extends AggregateRoot | |
{ | |
/** @var EmploymentContractId $employmentContractId */ | |
private $id; | |
/** @var PersonId $personId */ |
This file contains hidden or 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\TemporaryWork\Infrastructure\ProcessManager; | |
use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface; | |
use Prooph\EventSourcing\AggregateChanged; | |
use Acme\TemporaryWork\Domain\Model\Agency\Event\AgencyHired; | |
use Acme\TemporaryWork\Domain\Model\Agency\Event\AgencyModified; | |
use Acme\PersonnelManagement\Infrastructure\RabbitMq\Producer; | |
use Symfony\Component\Messenger\Handler\MessageSubscriberInterface; |
This file contains hidden or 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\Context\Infrastructure\Prooph; | |
use Prooph\Common\Event\ActionEvent; | |
use Prooph\EventStore\ActionEventEmitterEventStore; | |
use Prooph\EventStore\EventStore; | |
use Prooph\EventStore\Plugin\AbstractPlugin; | |
use Prooph\EventStore\TransactionalActionEventEmitterEventStore; | |
use Symfony\Component\Messenger\MessageBusInterface; |
This file contains hidden or 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 Tests\Acme\PersonnelManagement\Infrastructure\Symfony\AcmePersonnelManagementBundle\Controller; | |
use Lexik\Bundle\JWTAuthenticationBundle\Encoder\JWTEncoderInterface; | |
use Symfony\Bundle\FrameworkBundle\KernelBrowser; | |
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
abstract class AbstractControllerTest extends WebTestCase | |
{ |
This file contains hidden or 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\Symfony\Messenger; | |
use Prooph\EventStore\Exception\ConcurrencyException; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Messenger\Exception\HandlerFailedException; | |
use Symfony\Component\Messenger\Exception\RuntimeException; | |
use Symfony\Component\Messenger\Exception\ValidationFailedException; |
This file contains hidden or 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 Deployment1 | |
{ | |
public static function with(DeploymentId $anId, EmploymentContractId $anEmploymentContractId, | |
DeploymentPeriod $aPeriod): Deployment | |
{ | |
// No period range validation, final period was already validated and passed | |
} | |
} |
This file contains hidden or 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 | |
class DefaultGridFSRepository extends DocumentRepository implements GridFSRepository | |
{ | |
public function uploadFromStream(string $filename, $source, ?UploadOptions $uploadOptions = null) | |
{ | |
$options = $this->prepareOptions($uploadOptions); | |
$databaseIdentifier = $this->getDocumentBucket()->uploadFromStream($filename, $source, $options); | |
$documentIdentifier = $this->class->getPHPIdentifierValue($databaseIdentifier); |
This file contains hidden or 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 MongoDB\BSON\Binary; | |
use MongoDB\BSON\ObjectId; | |
function mongoBinaryToUuid(Binary $bin): string | |
{ | |
$hex = bin2hex($bin->getData()); | |
return substr($hex, 0, 32); |
This file contains hidden or 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 Symfony\Component\Validator\Constraints as Assert; | |
use Symfony\Component\Validator\Context\ExecutionContextInterface; | |
class MaterialQuantityDto | |
{ | |
/** | |
* @var string | |
* @Assert\NotNull(groups={"available_material"}) |
This file contains hidden or 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 | |
class JsonObject | |
{ | |
/** @var string $result */ | |
private $result; | |
private function __construct(string $result) | |
{ | |
$this->result = $result; |