Skip to content

Commit 30ad796

Browse files
committed
some readme updates; fix some docblocks;
1 parent 222a45a commit 30ad796

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/vendor
2-
composer.lock
2+
/composer.lock

README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ Build a pipeline to pour your data through!
88
## About
99

1010
This is a low level lib that helps you with building a data migration process.
11-
It requires a little bootstrapping to float, but it can be easily done if you need just a minimal process
12-
or just looking to test things out.
11+
It requires a little bootstrapping to float, but it can be easily done if you just need a minimal process
12+
or looking to test things out.
13+
14+
The main idea is that you're building a pipeline where each section can mutate the data that's flowing through.
15+
It allows process to be extremely flexible, since each new step can potentially get (**completely**) transformed data.
16+
It also can be very dangerous, since mistake can be costly, hence we crafted awesome error handling and reporting mechanisms.
1317

1418
## Examples
1519

@@ -99,14 +103,14 @@ $pipeline = (new PipelineBuilder($emitter))
99103
![results](examples/example1-import-cli/2-cli-runs.png)
100104

101105
## Goals
102-
* Easy to maintain. Strong reporting shows what exactly is wrong with the data or the process.
103-
* Flexible. Extremely flexible workflow allows to work with different import/export/migration scenarios.
106+
* **Easy to maintain**. Strong reporting shows what exactly went wrong.
107+
* **Flexible**. Extremely flexible workflow allows to work with different import/export/migration scenarios.
104108
* one file -> multiple tables
105109
* multiple files -> one table
106-
* supports dynamic connection
110+
* supports dynamic DB connection
107111
* supports different source types and destination types
108-
* Fast. Low level operations produce maximum flow speed.
109-
* Stable. Strong test coverage guarantees bug-free groundwork.
112+
* **Fast**. Low level operations produce maximum flow speed.
113+
* **Stable**. Strong test coverage guarantees bug-free groundwork.
110114

111115
## Influences
112116
* [Ddeboer Data Import library](https://github.com/ddeboer/data-import)

src/Pipe/Copy.php

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public function __construct(string $id, string $from, string $to)
3030
$this->to = $to;
3131
}
3232

33+
/**
34+
* Copy data from one key to another. Create if doesn't exist.
35+
*
36+
* @param DataBagInterface $dataBag
37+
* @return DataBagInterface
38+
*/
3339
public function pass(DataBagInterface $dataBag): DataBagInterface
3440
{
3541
$from = $dataBag[$this->from] ?? null;

src/Pipe/Delete.php

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public function __construct(string $id, string ...$fieldNames)
2525
$this->fieldNames = $fieldNames;
2626
}
2727

28+
/**
29+
* Delete data from the bag by key[s]
30+
*
31+
* @param DataBagInterface $dataBag
32+
* @return DataBagInterface
33+
*/
2834
public function pass(DataBagInterface $dataBag): DataBagInterface
2935
{
3036
foreach ($this->fieldNames as $name) {

src/Pipe/Swap.php

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public function __construct(string $id, string $first, string $second)
3030
$this->second = $second;
3131
}
3232

33+
/**
34+
* Swap one key with another.
35+
*
36+
* @param DataBagInterface $dataBag
37+
* @return DataBagInterface
38+
*/
3339
public function pass(DataBagInterface $dataBag): DataBagInterface
3440
{
3541
$first = $dataBag[$this->first] ?? null;

0 commit comments

Comments
 (0)