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\WebsiteBundle\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Symfony\Component\Form\FormFactoryInterface; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Routing\RouterInterface; |
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
fos_rest: | |
routing_loader: | |
default_format: json | |
include_format: false | |
param_fetcher_listener: true | |
body_converter: | |
enabled: true | |
serializer: | |
groups: ['Default'] | |
body_listener: true |
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 | |
{ | |
} |
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 | |
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 | |
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 | |
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 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 | |
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 | |
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; |
OlderNewer