Skip to content

Instantly share code, notes, and snippets.

View lchrusciel's full-sized avatar
🎯
Focusing

Łukasz Chruściel lchrusciel

🎯
Focusing
View GitHub Profile
@lchrusciel
lchrusciel / ImageUploader.php
Created March 15, 2022 10:54
SVG sanitizer security bug fix
<?php
// src/Uploader/ImageUploader.php
declare(strict_types=1);
namespace App\Uploader;
use enshrined\svgSanitize\Sanitizer;
use Gaufrette\Filesystem;
@lchrusciel
lchrusciel / Sample ProductBundle class
Created April 27, 2018 14:01
Sample ProductBundle class
// src/AppBundle/Entity/ProductBundle.php
<?php
declare(strict_types=1);
namespace AppBundle\Entity;
use Sylius\Component\Resource\Model\ResourceInterface;
class ProductBundle implements ResourceInterface
@lchrusciel
lchrusciel / specification.tpl
Created July 16, 2015 08:14
Specification template for phpspec. Put this file into .phpspec directory in a root of your project.
<?php
namespace %namespace%;
use PhpSpec\ObjectBehavior;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
class %name% extends ObjectBehavior
@lchrusciel
lchrusciel / method.tpl
Created July 16, 2015 07:31
Method template for phpspec. Put this file into .phpspec directory in a root of your project.
/**
* @param
*
* @return
*/
public function %name%(%arguments%)
{
// TODO: write logic here
}
@lchrusciel
lchrusciel / class.tpl
Last active August 29, 2015 14:25
Class template for phpspec. Put this file into .phpspec directory in a root of your project.
<?php
namespace %namespace%;
/**
* @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
*/
class %name%
{
}