Skip to content

Instantly share code, notes, and snippets.

@Yrwein
Yrwein / ModuleTest.java
Last active May 7, 2020 12:14
An example with Spring-Boot module auto-discovery
package com.josefczech.blog.examples.datajpatestflushandclear;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
@Yrwein
Yrwein / index.php
Created February 13, 2020 15:51
POC for stackoverflow.com/questions/60169581
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
use \Psr\Container\ContainerInterface;
require './vendor/autoload.php';
class TypeHintTestController {
private $container;
<?php
set_exception_handler(function ($e) {
echo 'Got it: ' . $e->getMessage() . "\n";
});
register_shutdown_function(function () {
throw new \Exception('This one will cause Fatal error');
});