antidot-fw/no-floc-middleware

1.0.3 2021-06-05 12:00 UTC

This package is auto-updated.

Last update: 2022-08-18 18:11:59 UTC


README

Scrutinizer Code Quality Code Coverage Type Coverage Build Status

PSR-15 middleware to opting your Website out of Google's FLoC Network

Installation

Using composer

composer require antidot-fw/no-floc-middleware

Using Laminas config Aggregator

it install the library automatically

Usage

In Antidot, Mezzio or any other PSR-15 middleware application, add it to the global pipeline.

<?php

declare(strict_types=1);

use Antidot\Application\Http\Application;
use Antidot\Application\Http\Middleware\ErrorMiddleware;
use Antidot\Application\Http\Middleware\RouteDispatcherMiddleware;
use Antidot\Application\Http\Middleware\RouteNotFoundMiddleware;
use Antidot\Logger\Application\Http\Middleware\ExceptionLoggerMiddleware;
use Antidot\Logger\Application\Http\Middleware\RequestLoggerMiddleware;
+use Antidot\NoFLoC\NoFLoCMiddleware;

return static function (Application $app) : void {
+    $app->pipe(NoFLoCMiddleware::class)
    $app->pipe(ErrorMiddleware::class);
    $app->pipe(ExceptionLoggerMiddleware::class);
    $app->pipe(RequestLoggerMiddleware::class);
    $app->pipe(RouteDispatcherMiddleware::class);
    $app->pipe(RouteNotFoundMiddleware::class);
};