Skip to content

Instantly share code, notes, and snippets.

View TimoBakx's full-sized avatar

Timo Bakx TimoBakx

View GitHub Profile
@TimoBakx
TimoBakx / ApiDocsOverride.php
Created April 13, 2021 08:42
Extending API Platform generated documentation
<?php
// src/Api/ApiDocsOverride.php
declare(strict_types=1);
namespace App\Api;
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactory;
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactoryInterface;
@TimoBakx
TimoBakx / Documentation.php
Created March 10, 2020 16:27
Add a dynamic property to API Platform documentation
<?php
declare(strict_types=1);
namespace App\Api;
use ArrayObject;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
final class Documentation implements NormalizerInterface
{
@TimoBakx
TimoBakx / NotFound.php
Last active October 3, 2019 15:01
Exception wrapper for Api Platform
<?php
declare(strict_types=1);
/**
* This is an example of the exception interfaces I use to map my internal exceptions. They're just empty.
*/
namespace App\Api\Exception;
use Throwable;
<?php
declare(strict_types=1);
namespace App\Util\Logger;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
@TimoBakx
TimoBakx / prophet-test-result.php
Created March 22, 2019 14:49
Prophet test result
PHPUnit 8.0.4 by Sebastian Bergmann and contributors.
Testing
.... 4 / 4 (100%)......PHP Fatal error: Uncaught Exception: The following test produced memory leaks:
* App\ATest::testA
in /Users/timobakx/workspace/visser/vendor/roave/no-leaks/src/CollectTestExecutionMemoryFootprints.php:102
Stack trace:
#0 /Users/timobakx/workspace/visser/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(636): Roave\NoLeaks\PHPUnit\CollectTestExecutionMemoryFootprints->executeAfterLastTest()
#1 /Users/timobakx/workspace/visser/vendor/phpunit/phpunit/src/TextUI/Command.php(208): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#2 /Users/timobakx/workspace/visser/vendor/roave/no-leaks/bin/roave-no-leaks.php(46): PHPUnit\TextUI\Command->run(Array, true)
@TimoBakx
TimoBakx / prophet-test.php
Created March 22, 2019 14:43
Prophet test
<?php
declare(strict_types=1);
namespace App;
use PHPUnit\Framework\TestCase;
use stdClass;
class ATest extends TestCase
{
@TimoBakx
TimoBakx / Roave no-leak output.txt
Last active March 22, 2019 13:52
Roave no-leak output
$ vendor/bin/roave-no-leaks
PHPUnit 8.0.4 by Sebastian Bergmann and contributors.
Testing
............................................................. 61 / 3742 ( 1%)
...........................................................S. 122 / 3742 ( 3%)
............................................................. 183 / 3742 ( 4%)
..S.....S.............................................S...... 244 / 3742 ( 6%)
............................................................. 305 / 3742 ( 8%)
............................................S.......S........ 366 / 3742 ( 9%)
@TimoBakx
TimoBakx / keybase.md
Created June 20, 2018 06:05
Keybase proof

Keybase proof

I hereby claim:

  • I am timobakx on github.
  • I am timobakx (https://keybase.io/timobakx) on keybase.
  • I have a public key ASAE5guIOJCp0_TBxZ-a9B-k0qmSTG4sMm_Nuw6OWbRxbAo

To claim this, I am signing this object: