Skip to content

Commit f4542bd

Browse files
committed
Prepared release 0.19.0
1 parent 152e22e commit f4542bd

File tree

33 files changed

+1063
-101
lines changed

33 files changed

+1063
-101
lines changed

composer.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
22
| name | html_url | blog | login | public_repos | followers | created_at |
33
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
4-
| Flow PHP | https://github.com/flow-php | http://flow-php.com | flow-php | 40 | 125 | 2020-10-26T18:40:27Z |
4+
| Flow PHP | https://github.com/flow-php | http://flow-php.com | flow-php | 40 | 129 | 2020-10-26T18:40:27Z |
55
+----------+-----------------------------+---------------------+----------+--------------+-----------+----------------------+
66
1 rows
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+------+-----------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
22
| took | timed_out | _shards | hits |
33
+------+-----------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4-
| 0 | false | {"total":1,"successful":1,"skipped":0,"failed":0} | {"total":{"value":6,"relation":"eq"},"max_score":1,"hits":[{"_index":"test_index","_type":"_doc","_id":"1","_score":1,"_source":{"id":1,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"2","_score":1,"_source":{"id":2,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"3","_score":1,"_source":{"id":3,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"4","_score":1,"_source":{"id":4,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"5","_score":1,"_source":{"id":5,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"6","_score":1,"_source":{"id":6,"text":"lorem ipsum"}}]} |
4+
| 1 | false | {"total":1,"successful":1,"skipped":0,"failed":0} | {"total":{"value":6,"relation":"eq"},"max_score":1,"hits":[{"_index":"test_index","_type":"_doc","_id":"1","_score":1,"_source":{"id":1,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"2","_score":1,"_source":{"id":2,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"3","_score":1,"_source":{"id":3,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"4","_score":1,"_source":{"id":4,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"5","_score":1,"_source":{"id":5,"text":"lorem ipsum"}},{"_index":"test_index","_type":"_doc","_id":"6","_score":1,"_source":{"id":6,"text":"lorem ipsum"}}]} |
55
+------+-----------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
66
1 rows
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use function Flow\ETL\DSL\{data_frame,
6+
from_rows,
7+
lit,
8+
match_cases,
9+
match_condition,
10+
ref,
11+
row,
12+
rows,
13+
string_entry,
14+
to_stream
15+
};
16+
use function Flow\Types\DSL\type_integer;
17+
18+
require __DIR__ . '/vendor/autoload.php';
19+
20+
data_frame()
21+
->read(
22+
from_rows(
23+
rows(
24+
row(string_entry('string', 'string-with-dashes')),
25+
row(string_entry('string', '123')),
26+
row(string_entry('string', '14%')),
27+
row(string_entry('string', '+14')),
28+
row(string_entry('string', ''))
29+
)
30+
)
31+
)
32+
->withEntry(
33+
'string',
34+
match_cases(
35+
[
36+
match_condition(ref('string')->contains('-'), ref('string')->strReplace('-', ' ')),
37+
match_condition(ref('string')->call('is_numeric'), ref('string')->cast(type_integer())),
38+
match_condition(ref('string')->endsWith('%'), ref('string')->strReplace('%', '')->cast(type_integer())),
39+
match_condition(ref('string')->startsWith('+'), ref('string')->strReplace('+', '')->cast(type_integer())),
40+
],
41+
default: lit('DEFAULT')
42+
)
43+
)
44+
->write(to_stream(__DIR__ . '/output.txt', truncate: false))
45+
->run();
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "flow-php/examples",
3+
"description": "Flow PHP - Examples",
4+
"license": "MIT",
5+
"type": "library",
6+
"require": {
7+
"flow-php/etl": "1.x-dev"
8+
},
9+
"archive": {
10+
"exclude": [
11+
".env",
12+
"vendor"
13+
]
14+
}
15+
}

0 commit comments

Comments
 (0)