Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/codding standards #1008

Merged
merged 4 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 7 additions & 3 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
->files()
->in([
__DIR__ . '/bin',
__DIR__ . '/src',
__DIR__ . '/src/core/**/src',
__DIR__ . '/src/core/**/tests',
__DIR__ . '/src/adapter/**/src',
Expand All @@ -32,7 +33,9 @@
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'blank_line_after_opening_tag' => false,
'blank_line_after_opening_tag' => true,
'group_import' => true,
'single_import_per_statement' => false,
'blank_line_before_statement' => [
'statements' => [
'break',
Expand Down Expand Up @@ -74,7 +77,7 @@
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_constant_invocation' => false,
'native_function_invocation' => ['include' => ['@all']], // todo
'native_function_invocation' => false,
'new_with_parentheses' => false,
'nullable_type_declaration_for_default_null_value' => true,
'no_extra_blank_lines' => true, // todo?
Expand Down Expand Up @@ -129,7 +132,6 @@
'phpdoc_order' => true,
'phpdoc_to_comment' => false,
'phpdoc_types_order' => true,
'php_unit_method_casing' => ['case' => 'snake_case'],
'protected_to_private' => true,
'return_assignment' => false,
'return_type_declaration' => ['space_before' => 'one'],
Expand All @@ -139,5 +141,7 @@
'ternary_to_null_coalescing' => true,
'yoda_style' => false,
'void_return' => true,
'php_unit_method_casing' => ['case' => 'snake_case'],
'php_unit_test_case_static_method_calls' => ['call_type' => 'static'],
])
->setFinder($finder);
10 changes: 3 additions & 7 deletions bin/flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

declare(strict_types=1);

use Flow\ETL\DataFrame;
use Flow\ETL\Exception\InvalidFileFormatException;
use Flow\ETL\FlowVersion;
use Flow\ETL\PipelineFactory;
use Flow\ParquetViewer\Command\ReadDataCommand;
use Flow\ParquetViewer\Command\ReadMetadataCommand;
use Flow\ETL\{DataFrame, FlowVersion, PipelineFactory};
use Flow\ParquetViewer\Command\{ReadDataCommand, ReadMetadataCommand};
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\{InputArgument, InputInterface};
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

Expand Down
4 changes: 3 additions & 1 deletion examples/autoload.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

if (!($_ENV['FLOW_PHAR_APP'] ?? false)) {
require __DIR__ . '/../vendor/autoload.php';
Expand Down
4 changes: 3 additions & 1 deletion examples/run.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env php
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

require __DIR__ . '/../vendor/autoload.php';

Expand Down
9 changes: 1 addition & 8 deletions examples/topics/aggregations/average/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\average;
use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{average, df, from_rows, int_entry, ref, row, rows, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
9 changes: 1 addition & 8 deletions examples/topics/aggregations/first/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\first;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{df, first, from_rows, int_entry, ref, row, rows, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
5 changes: 1 addition & 4 deletions examples/topics/aggregations/group_by/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_array;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_array, ref, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
6 changes: 1 addition & 5 deletions examples/topics/aggregations/group_by_sum/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_array;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\sum;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_array, ref, sum, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
9 changes: 1 addition & 8 deletions examples/topics/aggregations/last/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\last;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{df, from_rows, int_entry, last, ref, row, rows, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
9 changes: 1 addition & 8 deletions examples/topics/aggregations/max/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\max;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{df, from_rows, int_entry, max, ref, row, rows, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
9 changes: 1 addition & 8 deletions examples/topics/aggregations/min/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\min;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{df, from_rows, int_entry, min, ref, row, rows, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
9 changes: 1 addition & 8 deletions examples/topics/aggregations/sum/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\sum;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{df, from_rows, int_entry, ref, row, rows, sum, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
9 changes: 2 additions & 7 deletions examples/topics/data_frame/cache/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@

declare(strict_types=1);

use function Flow\ETL\DSL\config_builder;
use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_cache;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{config_builder, df, from_cache, ref, to_output};
use Flow\ETL\Adapter\Http\DynamicExtractor\NextRequestFactory;
use Flow\ETL\Adapter\Http\PsrHttpClientDynamicExtractor;
use Flow\ETL\Cache\PSRSimpleCache;
use Http\Client\Curl\Client;
use Nyholm\Psr7\Factory\Psr17Factory;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\{RequestInterface, ResponseInterface};
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;

Expand Down
10 changes: 1 addition & 9 deletions examples/topics/data_frame/data_frame/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\array_entry;
use function Flow\ETL\DSL\array_expand;
use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\from_rows;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\row;
use function Flow\ETL\DSL\rows;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{array_entry, array_expand, df, from_rows, int_entry, ref, row, rows, to_output};

// flow.phar run examples/topics/phar/data_frame/code.php
// when executing data processing pipeline through phar make sure to not use any trigger, like ->run();
Expand Down
6 changes: 2 additions & 4 deletions examples/topics/data_frame/overwrite/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

declare(strict_types=1);

use function Flow\ETL\Adapter\CSV\from_csv;
use function Flow\ETL\Adapter\CSV\to_csv;
use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\overwrite;
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
use function Flow\ETL\DSL\{df, overwrite};

require __DIR__ . '/../../../autoload.php';

Expand Down
4 changes: 1 addition & 3 deletions examples/topics/data_source/array/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_array;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_array, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
3 changes: 1 addition & 2 deletions examples/topics/data_source/csv/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use function Flow\ETL\Adapter\CSV\from_csv;
use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
6 changes: 1 addition & 5 deletions examples/topics/data_source/data_frame/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_array;
use function Flow\ETL\DSL\from_data_frame;
use function Flow\ETL\DSL\lit;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_array, from_data_frame, lit, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
4 changes: 1 addition & 3 deletions examples/topics/data_source/http_dynamic/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, ref, to_output};
use Flow\ETL\Adapter\Http\DynamicExtractor\NextRequestFactory;
use Flow\ETL\Adapter\Http\PsrHttpClientDynamicExtractor;
use Http\Client\Curl\Client;
Expand Down
3 changes: 1 addition & 2 deletions examples/topics/data_source/json/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use function Flow\ETL\Adapter\JSON\from_json;
use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
3 changes: 1 addition & 2 deletions examples/topics/data_source/parquet/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
declare(strict_types=1);

use function Flow\ETL\Adapter\Parquet\from_parquet;
use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
4 changes: 1 addition & 3 deletions examples/topics/data_source/sequence_date/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_sequence_date_period;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_sequence_date_period, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_sequence_date_period_recurrences;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_sequence_date_period_recurrences, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
4 changes: 1 addition & 3 deletions examples/topics/data_source/sequence_number/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_sequence_number;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, from_sequence_number, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
4 changes: 1 addition & 3 deletions examples/topics/data_source/xml/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
declare(strict_types=1);

use function Flow\ETL\Adapter\XML\from_xml;
use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\ref;
use function Flow\ETL\DSL\to_output;
use function Flow\ETL\DSL\{data_frame, ref, to_output};

require __DIR__ . '/../../../autoload.php';

Expand Down
7 changes: 2 additions & 5 deletions examples/topics/join/left_anti/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

declare(strict_types=1);

use function Flow\ETL\DSL\data_frame;
use function Flow\ETL\DSL\from_array;
use function Flow\ETL\DSL\to_output;
use Flow\ETL\Join\Expression;
use Flow\ETL\Join\Join;
use function Flow\ETL\DSL\{data_frame, from_array, to_output};
use Flow\ETL\Join\{Expression, Join};

require __DIR__ . '/../../../autoload.php';

Expand Down
15 changes: 3 additions & 12 deletions examples/topics/join/left_anti_each/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@

declare(strict_types=1);

use function Flow\ETL\DSL\df;
use function Flow\ETL\DSL\int_entry;
use function Flow\ETL\DSL\str_entry;
use function Flow\ETL\DSL\to_output;
use Flow\ETL\DataFrame;
use Flow\ETL\DataFrameFactory;
use Flow\ETL\Extractor;
use Flow\ETL\FlowContext;
use function Flow\ETL\DSL\{df, int_entry, str_entry, to_output};
use Flow\ETL\Join\Comparison\Equal;
use Flow\ETL\Join\Expression;
use Flow\ETL\Join\Join;
use Flow\ETL\Row;
use Flow\ETL\Rows;
use Flow\ETL\Join\{Expression, Join};
use Flow\ETL\{DataFrame, DataFrameFactory, Extractor, FlowContext, Row, Rows};

require __DIR__ . '/../../../autoload.php';

Expand Down
Loading
Loading