Skip to content

Instantly share code, notes, and snippets.

View devnix's full-sized avatar
🐢

Pablo Largo Mohedano devnix

🐢
View GitHub Profile
@devnix
devnix / ContainerInterface.php
Last active September 14, 2023 17:07
Hexagonal container inspired by PHPStan source code
<?php
declare(strict_types=1);
namespace Shared\Domain\DependencyInjection;
interface ContainerInterface
{
/**
* @return object|null
@devnix
devnix / flattenExceptionBacktrace.php
Created September 6, 2024 18:45 — forked from Thinkscape/flattenExceptionBacktrace.php
Make any PHP Exception serializable by flattening complex values in backtrace.
<?php
function flattenExceptionBacktrace(\Exception $exception) {
$traceProperty = (new \ReflectionClass('Exception'))->getProperty('trace');
$traceProperty->setAccessible(true);
$flatten = function(&$value, $key) {
if ($value instanceof \Closure) {
$closureReflection = new \ReflectionFunction($value);
$value = sprintf(
'(Closure at %s:%s)',

Keybase proof

I hereby claim:

  • I am devnix on github.
  • I am devnix (https://keybase.io/devnix) on keybase.
  • I have a public key whose fingerprint is F533 CBB2 E009 31F8 DC9F CDB9 C366 D0EA 569E D236

To claim this, I am signing this object: