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\Filter; | |
use Acme\Form\Filter\Type\AssociatedEntityFilterType; | |
use Doctrine\ORM\QueryBuilder; | |
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Filter\FilterInterface; | |
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto; |
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 | |
// Jak lubisz klasyczne podejście (gdy nie chcesz mockować) to się przyda tylko do testów, jak jednak londyńską szkołę to po prostu mockuj `SmsProvider` | |
final class PersistenDummySmsProvider implements SmsProvider | |
{ | |
private array $messages = []; | |
public function send(string $phoneNumber, string $message): void | |
{ | |
$this->messages[$phone][] = $message; |
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 My\Infrastructure\DoctrineAdapter; | |
use Doctrine\Common\Persistence\ObjectRepository; | |
use Doctrine\ORM\EntityManagerInterface; | |
use My\Domain\FinalGreetingRepository; | |
use My\Domain\Model\FinalGreeting; |
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); | |
interface Clock | |
{ | |
public function now(): \DateTimeInterface; | |
} |
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; | |
use Symfony\Component\Validator\Constraints\NotBlank; | |
use Symfony\Component\Validator\Context\ExecutionContextInterface; | |
class CommandValidator | |
{ | |
public static function validate($object, ExecutionContextInterface $context) |
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 | |
private function exceptionHandler(GuzzleRequestException $e) | |
{ | |
if ($e->hasResponse()) { | |
if ($e->getResponse()->getStatusCode() >= 500) { | |
throw $e; | |
} | |
$error = json_decode($e->getResponse()->getBody()->getContents(), true); | |
if (isset($error['errors'])) { |
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 Bundle\MyBundle; | |
use Sculpin\Core\Event\SourceSetEvent; | |
use Sculpin\Core\Sculpin; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
class MySubscriber implements EventSubscriberInterface | |
{ | |
/** |
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 | |
class Person | |
{ | |
private $name; | |
private $surname; | |
private function __construct($name, $surname) | |
{ | |
$this->name = $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 | |
class StringsCompare | |
{ | |
public function compareStringsStrtoupper($method, $options) | |
{ | |
if (strtoupper($method) == 'POST' | |
&& !isset($options['body']) | |
&& !isset($options['json']) | |
) { |
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\DemoBundle; | |
use Symfony\Component\HttpKernel\Bundle\Bundle; | |
class AcmeDemoBundle extends Bundle | |
{ | |
} |
NewerOlder