Skip to content

Instantly share code, notes, and snippets.

View ismail1432's full-sized avatar
🏠
Looking for remote job

Smaine Milianni ismail1432

🏠
Looking for remote job
View GitHub Profile
<?php
class Article
{
private string $status;
public function setStatus(string $status)
{
$this->status = $status;
}
<?php
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class UserActionTest extends WebTestCase
{
public function testWrongPayload(): void
{
$client = static::createClient();
<?php
namespace App\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Component\Validator\Constraints;
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class UserAction
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CreateAUserController
<?php
namespace App\Domain;
final class CreateAUserOutput
{
private string $id;
private string $name;
private int $age;
<?php
namespace App\Domain;
final class CreateAUserInput
{
private string $name;
private int $age;
public function __construct(string $name, int $age)
<?php
namespace App\Application\Command;
use App\Domain\CreateAUserHandler;
use App\Domain\CreateAUserInput;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
<?php
namespace App\Application;
use App\Domain\CreateAUserHandler;
use App\Domain\CreateAUserInput;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
<?php
namespace App\Application;
use Symfony\Component\Validator\Constraints as Assert;
final class CreateAUserPayload
{
/**
* @Assert\Type(type="string")