Skip to content

Instantly share code, notes, and snippets.

Deprecating Legacy

Tomas Votruba TomasVotruba

Deprecating Legacy
View GitHub Profile
View twig_with_tolerant_functions_and_filters.php
$functions = $twig->getFunctions();
$filters = $twig->getFilters();
// reset initialized, to changed functions
$privatesAccessor = new PrivatesAccessor();
/** @var \Twig\ExtensionSet $extensionSet */
$extensionSet = $privatesAccessor->getPrivateProperty($twig, 'extensionSet');
$privatesAccessor->setPrivateProperty($extensionSet, 'initialized', false);
TomasVotruba / simple_html_node_tree.php
Created May 14, 2022
How to create simple HTML AST?
View simple_html_node_tree.php
namespace Utils\HTMLStan\AST;
use Utils\HTMLStan\ValueObject\HtmlNode;
use DOMElement;
use DOMNode;
TomasVotruba /
Created Oct 10, 2020
text on github about bio me

Tomas loves to combine open-source and innovations... yet he's super lazy. Traumatized in childhood by doing repeated tasks as a punishment by his father (he loves), he's unable to do anything twice without deep physical pain.

That's why he always spends dozens of hours to automate problems that would take and hour or two to do manually.

This extreme lazyness created the Rector ecosystem. A tool that automatically upgrades and refactores PHP, so you can have a coffee instead while your code is upgraded from PHP 5.3 to PHP 8.0.