Skip to content

Instantly share code, notes, and snippets.

@phansys
phansys / MyVendor_MyBundle_Cache_CacheInvalidator.php
Created March 14, 2013 20:06
Added basic comprobation to check valid entity keys.
<?php
namespace MyVendor\MyBundle\Cache;
/**
* Better than using
* $this->getDoctrine()->getManager()->getConfiguration()->getResultCacheImpl()->delete(...);
* in your controllers
*/
use Doctrine\ORM\Event\OnFlushEventArgs;
use Symfony\Component\DependencyInjection\ContainerAware;
@phansys
phansys / PropertyAccessor.php
Created August 24, 2016 18:59
Don't use `else/elseif` after `throw` or `return`
private function writeProperty($zval, $property, $value)
{
if (!is_object($zval[self::VALUE])) {
throw new NoSuchPropertyException(sprintf('Cannot write property "%s" to an array. Maybe you should write the property path as "[%s]" instead?', $property, $property));
}
$object = $zval[self::VALUE];
$access = $this->getWriteAccessInfo(get_class($object), $property, $value);
if (self::ACCESS_TYPE_METHOD === $access[self::ACCESS_TYPE]) {
$object->{$access[self::ACCESS_NAME]}($value);
} elseif (self::ACCESS_TYPE_PROPERTY === $access[self::ACCESS_TYPE]) {
@phansys
phansys / NUBITY-BACKEND-DEVELOPER.md
Last active October 17, 2019 16:00
Nubity's Backend Developer opening

Backend developer

Linux + Nginx + MySQL + PHP

Nubity is searching for a proactive backend developer with great communication skills, to develop himself as a software architect. You will be 100% focused on the product, understanding their needs and requirements, plus anticipating future trends that will serve their challenges. You will also be excellent at driving results, being able to coordinate large, multi-functional features on time, anticipate bottlenecks,

Frontend developer

HTML, ECMAScript, CSS

Nubity is searching for a awesome frontend developer with great communication skills, to develop himself as a software architect. You will be 100% focused on the product, understanding their needs and requirements, plus anticipating future trends that will serve their challenges. You will also be excellent at driving results, being able to coordinate large, multi-functional features on time, anticipate bottlenecks,