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
for(...){ | |
if(!validao1()) continue; | |
if(!validacao2()) continue; | |
if(!validacao3()) continue; | |
lista.add(object); | |
} |
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
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee | |
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" | |
version="3.1"> | |
<display-name>Archetype Created Web Application</display-name> | |
<servlet> | |
<servlet-name>appServlet</servlet-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
class DateToFind{ | |
private LocalDate startDate; | |
private LocalDate finalDate; | |
public DateToFind(LocalDate start, LocalDate end){ | |
startDate = start; | |
finalDate = end; | |
} | |
public LocalDate getStart(){ |
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 YodaEventBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Event | |
* | |
* @ORM\Table(name="yoda_event") |
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
You are running Composer with SSL/TLS protection disabled. | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Your requirements could not be resolved to an installable set of packages. | |
Problem 1 | |
- doctrine/mongodb-odm 1.1.0 requires doctrine/mongodb ~1.3 -> satisfiable by doctrine/mongodb[1.3.0]. | |
- doctrine/mongodb-odm 1.1.1 requires doctrine/mongodb ~1.3 -> satisfiable by doctrine/mongodb[1.3.0]. | |
- doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0]. | |
- doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0]. |
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 Wideti\AdminBundle\Controller; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\HttpFoundation\Request; | |
use Wideti\AdminBundle\Form\GroupType; | |
use Wideti\DomainBundle\Document\Group\Group; | |
use Wideti\DomainBundle\Helpers\Controller\AdminControllerHelper; | |
use Wideti\DomainBundle\Service\Configuration\ConfigurationServiceAware; |
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
class Teste { | |
private int age; | |
private String name; | |
private Teste(String name) { | |
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
{ | |
"name": "StatusCodeError", | |
"statusCode": 409, | |
"message": "409 - \"{\\\"msg\\\":\\\"O software precisa de alguns segundos para atualizar a vers\\\\u00e3o da sua base de dados. Antes de continuar, pe\\\\u00e7a para todos os outros usu\\\\u00e1rios (na rede) fecharem o sistema. Migrar da vers\\\\u00e3o 24306 para 24307.\\\"}\"", | |
"error": "{\"msg\":\"O software precisa de alguns segundos para atualizar a vers\\u00e3o da sua base de dados. Antes de continuar, pe\\u00e7a para todos os outros usu\\u00e1rios (na rede) fecharem o sistema. Migrar da vers\\u00e3o 24306 para 24307.\"}", | |
"options": { | |
"uri": "https://api.superlogica.net/v2/financeiro/planos", | |
"headers": { | |
"Content-Type": "application/json", | |
"access_token": "***********", |
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
public function checkEmptyFields($data, ExecutionContextInterface $context) | |
{ | |
$confirmationEmailValue = $data['confirmation_email']->getValue(); | |
$blockPerTimeOrAccessValidity = $this->groupService->checkModuleIsActive('blockPerTimeOrAccessValidity'); | |
$accessCodeModule = $this->moduleService->checkModuleIsActive('access_code'); | |
$businessHoursModule = $this->moduleService->checkModuleIsActive('business_hours'); | |
$emailField = $this->customFieldsService->getFieldByNameType('email'); | |
$phoneField = ($this->customFieldsService->getFieldByNameType('phone') ?: $this->customFieldsService->getFieldByNameType('mobile')); | |
if ($accessCodeModule && $confirmationEmailValue == 1) { |
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
// Note na definição do serviço acima que ele possui muitas responsabilidades e podemos ainda adicionar mais, caímos no antipattern "God class", ela não é coesa, pois não possui uma responsabilidade bem definida, perde a escalabilidade pois para aterarmos qualquer uma das responsabilidades precisamos mexer na mesma base de código, por exemplo podemos quebrar o "create" pelo simples falo de mexer no "changeStatus", de forma simples podemos arrumar isso. | |
interface UserService { | |
User create(User user) throws DuplicatedEntityException; | |
User update(User user) throws EntityNotFoundException; | |
Optional<User> findUser(FilterUser filter) throws DatabaseExeption; | |
void delete(User user) throws EntityNotFoundException; |
OlderNewer