webalternatif/flysystem-composite

A simple interface for composite Flysystem adapters

v0.2.2 2024-01-08 15:52 UTC

This package is auto-updated.

Last update: 2024-11-10 15:33:44 UTC


README

Source code Software license GitHub issues Test status Psalm coverage Psalm level

A simple interface for composite Flysystem adapters.

Installation

$ composer require webalternatif/flysystem-composite

Usage

use Webf\Flysystem\Composite\CompositeFilesystemAdapter;

/**
 * @template T of FilesystemAdapter
 * @template-implements CompositeFilesystemAdapter<T>
 */
class MyWrapperAdapter implements CompositeFilesystemAdapter
{
    /**
     * @param T $innerAdapter
     */
    public function __construct(private FilesystemAdapter $innerAdapter)
    {
    }

    public function getInnerAdapters() : iterable
    {
        return [$this->innerAdapter];
    }
    
    // ... (implementation of FilesystemAdapter's methods)
}

Tests

To run all tests, execute the command:

$ composer test

This will run Psalm and a PHP-CS-Fixer check, but you can run them individually like this:

$ composer psalm
$ composer cs-check