webalternatif/flysystem-composite

A simple interface for composite Flysystem adapters

v0.2.0 2022-04-02 16:25 UTC

This package is auto-updated.

Last update: 2022-05-02 16:38:32 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