View SampleDTO.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 | |
namespace Core\SomeDomain\Application\DTOs; | |
use Exception; | |
use Illuminate\Contracts\Validation\ValidatesWhenResolved; | |
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; | |
class SampleInput implements ValidatesWhenResolved | |
{ |
View DotNotation.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 | |
/** | |
* Dot notation for access multidimensional arrays. | |
* | |
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]); | |
* | |
* $value = $dn->get('bar.baz.foo'); // $value == true | |
* | |
* $dn->set('bar.baz.foo', false); // ['foo'=>false] | |
* |
View slim4-routes.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 | |
// Slim 4. | |
$routes = $app->getRouteCollector()->getRoutes(); | |
$output = []; | |
/** Slim\Routing\Route $route */ | |
foreach ($routes as $route) { | |
$output[] = [ |
View php-docker-ext
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
RUN apt update | |
RUN apt upgrade -y | |
RUN apt install -y apt-utils | |
RUN a2enmod rewrite | |
RUN apt install -y libmcrypt-dev | |
RUN docker-php-ext-install mcrypt | |
RUN apt install -y libicu-dev | |
RUN docker-php-ext-install -j$(nproc) intl | |
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev | |
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ |
View Doctrine\DBAL\Logging\DebugStack-Alternative.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 | |
namespace Doctrine\DBAL\Logging; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Symfony\Component\HttpKernel\KernelInterface; | |
use function microtime; | |
use function exec; | |
/** |
View service-layer-references-for-laravel-projects.md
Command Pattern
https://en.wikipedia.org/wiki/Command_pattern
Service layer com jobs
Um texto que usa JOBs - de forma errada - para implementar service layer em projetos Laravel.
A diferença entre Jobs vs Services
https://stackoverflow.com/questions/52895669/laravel-patterns-usage-of-jobs-vs-services
View Validation.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 | |
declare(strict_types=1); | |
namespace App\Support\Validation; | |
abstract class Validation | |
{ | |
/** | |
* @var array |
View ddd-domain-driven-design.md
Publicações
-
Anemic Domain Model vs Rich Domain Model with Examples
https://thevaluable.dev/anemic-domain-model/ -
Symfony: services and Rich Domain Models
https://stackoverflow.com/questions/58091042/symfony-services-and-rich-domain-models -
How to use Repository with Doctrine as Service in Symfony
https://tomasvotruba.com/blog/2017/10/16/how-to-use-repository-with-doctrine-as-service-in-symfony/
View Dockerfile
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
FROM ubuntu:16.04 | |
LABEL maintainer="Mauricio Rodrigues <mmauricio.vsr@gmail.com>" | |
RUN echo "----> Upgrading repository" && \ | |
apt-get update -y && \ | |
apt-get upgrade -y && \ | |
apt-get upgrade -y && \ | |
apt-get install -y apt-transport-https \ | |
curl \ |
NewerOlder