/etl-transformer

Primary LanguagePHPMIT LicenseMIT

ETL Adapter: Filter

Minimum PHP Version

Description

ETL Adapter that provides Loaders that can filter rows.

Transformer - FilterRows

<?php

use Flow\ETL\Adapter\Filter\StringEntryEqualsToFilter;
use Flow\ETL\Adapter\FilterRows;
use Flow\ETL\Row;
use Flow\ETL\Rows;

$transformer = new FilterRows(
    new StringEntryEqualsToFilter('status', 'NEW'),
);

$transformer->transform(
    new Rows(
        Row::create(new Row\Entry\StringEntry('status', 'PENDING')),
        Row::create(new Row\Entry\StringEntry('status', 'SHIPPED')),
        Row::create(new Row\Entry\StringEntry('status', 'NEW')),
    )
);

Development

In order to install dependencies please, launch following commands:

composer install
composer install --working-dir ./tools

Run Tests

In order to execute full test suite, please launch following command:

composer build

It's recommended to use pcov for code coverage however you can also use xdebug by setting XDEBUG_MODE=coverage env variable.