Skip to content

Instantly share code, notes, and snippets.

View ahonymous's full-sized avatar
💭
I may be slow to respond.

Oleksandr Moshta ahonymous

💭
I may be slow to respond.
  • Ukraine, Cherkasy
View GitHub Profile
@ahonymous
ahonymous / Event Dispatcher
Last active January 13, 2017 19:53
HW 13 Event Dispatcher, Security
1. All tags for services: http://symfony.com/doc/current/reference/dic_tags.html
2. Base documentation: http://symfony.com/doc/current/event_dispatcher.html , http://symfony.com/doc/current/components/event_dispatcher.html
3. Request/Responce before-after filters: http://symfony.com/doc/current/event_dispatcher/before_after_filters.html
4. Doctrine Listeners: http://symfony.com/doc/current/doctrine/event_listeners_subscribers.html
5. Doctrine Events: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html
@wojteklu
wojteklu / clean_code.md
Last active June 30, 2024 09:07
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

<?php
namespace Acme\Serializer\Normalizer;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\SerializerAwareNormalizer;