You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/components/libs/types.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,6 +87,7 @@ By default all types are not nullabe, in order to achieve nullability two types
87
87
88
88
-`type_optional(type_string())` - results in nullable string '?string'
89
89
-`type_union(type_string(),type_integer(),type_null())` - results in `union<string,integer,null>` which is the same as `string|integer|null`
90
+
-`type_intersection(type_integer(),type_string())` - results in `intersection<integer,string>` which is the same as `integer&string`, requiring values to be valid for ALL types in the intersection
Copy file name to clipboardExpand all lines: documentation/contributing/guidelines.md
+36-8Lines changed: 36 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,15 +46,19 @@ The project is structured as follows:
46
46
-`bridge` contains bridges to connect flow libs with other libraries and frameworks.
47
47
-`cli` contains the command line interface application.
48
48
-`core` contains the core functionality of the project, it holds the entire DataFrame.
49
-
-`lib` contains standalone libraries that can be used independently of the project, like `doctrine-dbal-bulk` and `parquet`.
49
+
-`lib` contains standalone libraries that can be used independently of the project, like `doctrine-dbal-bulk` and
50
+
`parquet`.
50
51
-`tools` contains tools used during development.
51
-
-`tools` contains tools used during development, like the `phpstan`, `phpunit` and others, to not pollute project autoloader and
52
+
-`tools` contains tools used during development, like the `phpstan`, `phpunit` and others, to not pollute project
53
+
autoloader and
52
54
to keep tools outside of project dependencies.
53
55
-`var` contains temporary files, like cache and logs.
54
56
-`vendor` contains the dependencies of the project, managed by Composer.
55
57
-`web`
56
-
-`landing` contains the landing page of the project, which is a symfony application that is automatically dumped to static HTML files
57
-
and served by GitHub Pages. It has it's own composer.json that defines the dependencies for the landing page and commands.
58
+
-`landing` contains the landing page of the project, which is a symfony application that is automatically dumped to
59
+
static HTML files
60
+
and served by GitHub Pages. It has it's own composer.json that defines the dependencies for the landing page and
61
+
commands.
58
62
59
63
## Monorepo packages
60
64
@@ -91,7 +95,8 @@ as wide as possible, so we don't block other projects by our constraints.
91
95
Packages from this monorepo can depend on each other, but ther are strict rules about that:
92
96
93
97
-`lib` - libraries can depend only on other `lib` packages, never on anything else.
94
-
-`adapter` - adapters can depend on `lib` / `bridge` and they always depend on `core`. Adpaters should not depend on `cli`
98
+
-`adapter` - adapters can depend on `lib` / `bridge` and they always depend on `core`. Adpaters should not depend on
99
+
`cli`
95
100
-`bridge` - bridges can depend only on `lib`
96
101
-`cli` - CLI can depend on `core`, `lib` and `adapter` and `bridge`, `cli` always depends on `core`
97
102
-`core` - core can depend on `lib` or `bridge`, but should should never depend on `adapter`, or `cli`
@@ -100,7 +105,8 @@ The above rules apply also on namespaces. So for example Adapter for `CSV` can't
100
105
101
106
# PHP Versions
102
107
103
-
This project supports only the latest three PHP versions, for example: 8.2, 8.3, and 8.4. (assuming that 8.4 is the latest version).
108
+
This project supports only the latest three PHP versions, for example: 8.2, 8.3, and 8.4. (assuming that 8.4 is the
109
+
latest version).
104
110
Development is done using the lowest supported version, which is currently PHP 8.2.
105
111
The project is tested against all three versions, so you can use any of them for development.
106
112
@@ -111,7 +117,8 @@ Most of them are available as Composer scripts, so you can run them using `compo
111
117
112
118
-`composer static:analyze` runs static analysis tools like PHPStan to check the code for errors and potential issues.
113
119
-`composer cs:php:fix` runs the PHP CS Fixer and Rector to automatically fix coding standards issues in the code.
114
-
-`composer test` runs all tests in the project, including unit tests, functional tests, and integration tests. It's a combination of all other test commands:
120
+
-`composer test` runs all tests in the project, including unit tests, functional tests, and integration tests. It's
121
+
a combination of all other test commands:
115
122
-`composer test:core`
116
123
-`composer test:cli`
117
124
-`composer test:lib:array-dot`
@@ -120,7 +127,8 @@ Most of them are available as Composer scripts, so you can run them using `compo
120
127
- ...
121
128
-`composer test:adapter:xml`
122
129
- ...
123
-
-`composer test:benchmark` runs the benchmark tests to measure the performance of the certain parts of the project.
130
+
-`composer test:benchmark` runs the benchmark tests to measure the performance of the certain parts of the
131
+
project.
124
132
-`composer test:website` runs the tests for the website
125
133
-`composer test:examples` runs all examples
126
134
-`composer test:mutation` runs the mutation tests to check the quality of the tests.
@@ -135,3 +143,23 @@ All functions defined in DSL (usually in `functions.php` files) are following th
135
143
snake_case is used for function names and arguments in DSL. The only other place where snake_case is used is in the
136
144
tests, where it is used for test method names.
137
145
146
+
To make sure, that the whole project is aligned with the codding standards, run following commands:
147
+
148
+
```
149
+
composer cs:php:fix
150
+
composer static:analyze
151
+
```
152
+
153
+
Only when both commands pass, you should commit your changes.
154
+
155
+
# Testing
156
+
157
+
- Tests in the project are divided into
158
+
-`Unit` - tests a single behavior in isolation, without any dependencies.
159
+
-`Integration` - tests a single behavior with dependencies, like database or external services.
160
+
- Test cases of all packages should extends `\Flow\ETL\Tests\FlowTestCase` class, the only exceptions are `lib` and
161
+
`bridge` packages, which can use their own test cases.
162
+
- Each test method should test only one scenario, when one behavior needs to be tested against multiple input data, use
163
+
`PHPUnit\Framework\Attributes\TestWith` or `PHPUnit\Framework\Attributes\DataProvider` attributes.
0 commit comments