Skip to content

Commit fff486e

Browse files
#148 Update documentation according to Symfony best practices
1 parent bdea763 commit fff486e

8 files changed

+205
-155
lines changed

CONTRIBUTING.md

+44-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,50 @@
11
Contributing
22
============
33

4-
Every contributions are welcomed. This bundle aims to provide a standalone set of generic component.
5-
If a contribution is too specific or requires dependencies, it might be put in a separated sub-bundle.
4+
First of all, **thank you** for contributing, **you are awesome**!
65

7-
Ideally every PR should contain documentation and unit test updates.
6+
Here are a few rules to follow in order to ease code reviews, and discussions before
7+
maintainers accept and merge your work.
8+
9+
You MUST run the quality & test suites.
10+
11+
You SHOULD write (or update) unit tests.
12+
13+
You SHOULD write documentation.
14+
15+
Please, write [commit messages that make sense](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
16+
and [rebase your branch](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) before submitting your Pull Request.
17+
18+
One may ask you to [squash your commits](https://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)
19+
too. This is used to "clean" your Pull Request before merging it (we don't want
20+
commits such as `fix tests`, `fix 2`, `fix 3`, etc.).
21+
22+
Thank you!
23+
24+
## Running the quality & test suites
25+
26+
Tests suite uses Docker environments in order to be idempotent to OS's. More than this
27+
PHP version is written inside the Dockerfile; this assures to test the bundle with
28+
the same resources. No need to have PHP installed.
29+
30+
You only need Docker set it up.
31+
32+
To allow testing environments more smooth we implemented **Makefile**.
33+
You have two commands available:
34+
35+
```bash
36+
make quality
37+
```
38+
39+
```bash
40+
make tests
41+
```
42+
43+
which will execute all tests inside the docker.
44+
45+
```bash
46+
make test TEST="Tests/Util/FilenameUtilsTest.php"
47+
```
848

949
## Deprecations notices
1050

@@ -14,4 +54,5 @@ When a feature should be deprecated, or when you have a breaking change for a fu
1454
* Trigger a deprecation error: `@trigger_error('This feature will be deprecated in v4.0', E_USER_DEPRECATED);`
1555

1656
You can check which deprecation notice is triggered in tests
57+
* `make bash`
1758
* `SYMFONY_DEPRECATIONS_HELPER=0 ./vendor/bin/phpunit`

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ bash: #[Docker] Connect to php container with current host user
3737
logs: #[Docker] Show logs
3838
$(DOCKER_COMPOSE) logs -f
3939

40+
quality: phpstan php-cs-fixer rector #[Quality] Run all quality checks
41+
4042
phpstan: #[Quality] Run PHPStan
4143
$(DOCKER_RUN_PHP) "vendor/bin/phpstan --no-progress --memory-limit=1G analyse"
4244

@@ -46,5 +48,7 @@ php-cs-fixer: #[Quality] Run PHP-CS-Fixer
4648
rector: #[Quality] Run Rector
4749
$(DOCKER_RUN_PHP) "vendor/bin/rector"
4850

51+
tests: phpunit #[Tests] Run all tests
52+
4953
phpunit: #[Tests] Run PHPUnit
5054
$(DOCKER_RUN_PHP) "vendor/bin/phpunit"

README.md

+2-140
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
CleverAge/ProcessBundle
22
=======================
33

4-
## Introduction
5-
64
This bundle allows to configure series of tasks to be performed on a certain order.
75
Basically, it will greatly ease the configuration of import and exports but can do much more.
86

@@ -12,144 +10,8 @@ Demo project can be found on [there](https://github.com/cleverage/process-bundle
1210

1311
## Documentation
1412

15-
- [Quick start](doc/01-quick_start.md)
16-
- [Task types](doc/02-task_types.md)
17-
- [Custom tasks and development](doc/03-custom_tasks.md)
18-
- [Advanced workflow](doc/04-advanced_workflow.md)
19-
- Cookbooks
20-
- [Common Setup](doc/cookbooks/01-common_setup.md)
21-
- [Transformations]
22-
- [Flow manipulation]
23-
- [Dummy tasks]
24-
- [Debugging]
25-
- [Logging]
26-
- [Subprocess]
27-
- [File manipulation]
28-
- [Direct call (in controller)]
29-
- [Performances monitoring](doc/cookbooks/performances_monitoring.md)
30-
- [Memory usage analysis](doc/cookbooks/memory_usage_graph.md)
31-
- Reference
32-
- [Process definition](doc/reference/01-process_definition.md)
33-
- [Task definition](doc/reference/02-task_definition.md)
34-
- Basic and debug
35-
- [ConstantOutputTask](doc/reference/tasks/constant_output_task.md)
36-
- [ConstantIterableOutputTask](doc/reference/tasks/constant_iterable_output_task.md)
37-
- [CounterTask]
38-
- [DebugTask](doc/reference/tasks/debug_task.md)
39-
- [DieTask](doc/reference/tasks/die_task.md)
40-
- [DummyTask](doc/reference/tasks/dummy_task.md)
41-
- [ErrorForwarderTask]
42-
- [EventDispatcherTask](doc/reference/tasks/event_dispatcher_task.md)
43-
- [MemInfoDumpTask]
44-
- [StopwatchTask]
45-
- Data manipulation and transformations
46-
- [DenormalizerTask](doc/reference/tasks/denormalizer_task.md)
47-
- [NormalizerTask](doc/reference/tasks/normalizer_task.md)
48-
- [DeserializerTask]
49-
- [SerializerTask]
50-
- [PropertyGetterTask](doc/reference/tasks/property_getter_task.md)
51-
- [PropertySetterTask](doc/reference/tasks/property_setter_task.md)
52-
- [ObjectUpdaterTask]
53-
- [SplitJoinLineTask]
54-
- [TransformerTask](doc/reference/tasks/transformer_task.md)
55-
- [ValidatorTask]
56-
- File/CSV
57-
- [CsvReaderTask](doc/reference/tasks/csv_reader_task.md)
58-
- [CsvWriterTask](doc/reference/tasks/csv_writer_task.md)
59-
- [CSVSplitterTask]
60-
- [InputCsvReaderTask]
61-
- File/JsonStream
62-
- [JsonStreamReaderTask]
63-
- File/XML
64-
- [XmlReaderTask](doc/reference/tasks/xml_reader_task.md)
65-
- [XmlWriterTask](doc/reference/tasks/xml_writer_task.md)
66-
- File/Yaml
67-
- [YamlReaderTask]
68-
- [YamlWriterTask]
69-
- File
70-
- [FileMoverTask]
71-
- [FileReaderTask]
72-
- [FileRemoverTask]
73-
- [FileWriterTask]
74-
- [FolderBrowserTask]
75-
- [InputFolderBrowserTask]
76-
- Flow manipulation
77-
- [AggregateIterableTask](doc/reference/tasks/aggregate_iterable_task.md)
78-
- [InputAggregatorTask](doc/reference/tasks/input_aggregator_task.md)
79-
- [InputIteratorTask](doc/reference/tasks/input_iterator_task.md)
80-
- [ArrayMergeTask]
81-
- [ColumnAggregatorTask]
82-
- [RowAggregatorTask]
83-
- [FilterTask]
84-
- [GroupByAggregateIterableTask]
85-
- [SimpleBatchTask]
86-
- [IterableBatchTask]
87-
- [SkipEmptyTask]
88-
- [StopTask]
89-
- Process
90-
- [CommandRunnerTask]
91-
- [ProcessExecutorTask]
92-
- [ProcessLauncherTask]
93-
- Reporting
94-
- [AdvancedStatCounterTask]
95-
- [LoggerTask]
96-
- [StatCounterTask]
97-
- Transformers
98-
- Basic and debug
99-
- [CachedTransformer]
100-
- [CallbackTransformer]
101-
- [CastTransformer]
102-
- [ConstantTransformer]
103-
- [ConvertValueTransformer]
104-
- [DebugTransformer]
105-
- [DefaultTransformer]
106-
- [GenericTransformer]
107-
- [EvaluatorTransformer]
108-
- [ExpressionLanguageMapTransformer]
109-
- [MappingTransformer](doc/reference/transformers/mapping_transformer.md)
110-
- [MultiReplaceTransformer]
111-
- [PregFilterTransformer]
112-
- [RulesTransformer](doc/reference/transformers/rules_transformer.md)
113-
- [TypeSetterTransformer]
114-
- [UnsetTransformer]
115-
- [WrapperTransformer]
116-
- Array
117-
- [ArrayElementTransformer]
118-
- [ArrayFilterTransformer](doc/reference/transformers/array_filter_transformer.md)
119-
- [ArrayFirstTransformer]
120-
- [ArrayLastTransformer]
121-
- [ArrayMapTransformer]
122-
- [ArrayUnsetTransformer]
123-
- Date
124-
- [DateFormatTransformer](doc/reference/transformers/date_format.md)
125-
- [DateParserTransformer](doc/reference/transformers/date_parser.md)
126-
- Object
127-
- [InstantiateTransformer]
128-
- [PropertyAccessorTransformer]
129-
- [RecursivePropertySetterTransformer]
130-
- Serialization
131-
- [DenormalizeTransformer]
132-
- [NormalizeTransformer]
133-
- String
134-
- [ExplodeTransformer]
135-
- [HashTransformer]
136-
- [ImplodeTransformer]
137-
- [SlugifyTransformer]
138-
- [SprintfTransformer]
139-
- [TrimTransformer]
140-
- XML
141-
- [XpathEvaluatorTransformer](doc/reference/transformers/xpath_evaluator.md)
142-
- Other bridges
143-
- [Doctrine](https://github.com/cleverage/doctrine-process-bundle)
144-
- [Eav](https://github.com/cleverage/eav-process-bundle)
145-
- [Soap](https://github.com/cleverage/soap-process-bundle)
146-
- [Another Soap](https://github.com/cleverage/process-soap-bundle)
147-
- [Rest](https://github.com/cleverage/rest-process-bundle)
148-
- [Enqueue](https://github.com/cleverage/enqueue-process-bundle)
149-
- [Flysystem](https://github.com/cleverage/flysystem-process-bundle)
150-
- [Cache](https://github.com/cleverage/cache-process-bundle)
151-
- [Generic transformers definition](doc/reference/03-generic_transformers_definition.md)
152-
- [UI](https://github.com/cleverage/processuibundle)
13+
For usage documentation, see:
14+
[docs/index.md](doc/index.md)
15315

15416
## Support & Contribution
15517

docs/01-quick_start.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ The most common example is the ETL. It's a kind of application whose main purpos
2020

2121
## Installation
2222

23-
This bundle requires Symfony 6.3 minimum. You can install it using composer:
23+
Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
24+
of the Composer documentation.
25+
26+
Open a command console, enter your project directory and install it using composer:
2427

2528
```bash
2629
composer require cleverage/process-bundle
2730
```
2831

29-
Remember to add the following line to bundles.php (not required if Symfony Flex is used)
32+
Remember to add the following line to config/bundles.php (not required if Symfony Flex is used)
3033

3134
```php
3235
CleverAge\ProcessBundle\CleverAgeProcessBundle::class => ['all' => true],
@@ -97,11 +100,11 @@ Then you can add tasks in this array. They consist of a `service`, optionally co
97100
```
98101

99102
Below you can see a minimal working ETL example. It consist of 3 tasks:
100-
- the first *extract* some data (the [constant output task](./reference/tasks/constant_output_task.md) outputs... a constant value): it's an array with 3
103+
- the first *extract* some data (the [constant output task](reference/tasks/constant_output_task.md) outputs... a constant value): it's an array with 3
101104
keys/values
102-
- the second *transform* the given value (the [transformer task](./reference/tasks/transformer_task.md) is one of the most important!): the output is then an
105+
- the second *transform* the given value (the [transformer task](reference/tasks/transformer_task.md) is one of the most important!): the output is then an
103106
array with 2 keys/values, created using the value from previous task
104-
- finally, the last will just display the result (it's a cheap *load*, using the [debug task](./reference/tasks/debug_task.md), only for development
107+
- finally, the last will just display the result (it's a cheap *load*, using the [debug task](reference/tasks/debug_task.md), only for development
105108
purpose!)
106109

107110
```yaml
@@ -193,4 +196,4 @@ Once everything is working fine, you may want to automate your processes. The st
193196
194197
To check if everything went fine, logs are stored in database:
195198
- `clever_process_history`: logs process started, with `process_code`, `start_date`, `end_date` and `statut`
196-
- `clever_task_history`: logs custom tasks logs (see [logging]()), with `task_code`, `message`, `logged_at` date, `level`, a `reference` and `context`
199+
- `clever_task_history`: logs custom tasks logs (see [logging]), with `task_code`, `message`, `logged_at` date, `level`, a `reference` and `context`

docs/02-task_types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Transformers are a special subset of this bundle. They're not tasks strictly spe
8181
point for Transformers is the `CleverAge\ProcessBundle\Task\TransformerTask`, whose only purpose is to take some input,
8282
pass it to a transformer and transfer the output to next task.
8383

84-
The idea is to allow a great flexibility (especially using the [MappingTransformer]()), without using too much code.
84+
The idea is to allow a great flexibility (especially using the [MappingTransformer]), without using too much code.
8585

8686
They implement `CleverAge\ProcessBundle\Transformer\TransformerInterface` or
8787
`CleverAge\ProcessBundle\Transformer\ConfigurableTransformerInterface`.

docs/03-custom_tasks.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ method will be called and the `$state` will contain a new input (`ProcessState::
2525
may pass a new output to the next task (`ProcessState::setOutput`).
2626

2727
The State also provide reporting tools:
28-
* `ProcessState::log`: register a new log message (see[logging]())
28+
* `ProcessState::log`: register a new log message (see[logging])
2929
* `ProcessState::getConsoleOutput`: direct link to Symfony's Console Output (deprecated, prefer log)
3030

3131
Sometimes, when you execute a task, you need to change how the process may continue. It will be detailed in depth in
32-
the [next chapter about error management]() but here are the main methods
32+
the [next chapter about error management] but here are the main methods
3333
* `ProcessState::setSkipped`: process won't continue to next step
3434
* `ProcessState::setStopped`: process will fully stop
3535
* `ProcessState::setErrorOutput`: allow to direct an output to an error branch from your workflow
@@ -50,14 +50,14 @@ Defining your tasks as Iterable or Blocking is as simple as implementing one of
5050
* `CleverAge\ProcessBundle\Model\IterableTaskInterface`: the `next` method should behave almost the same as PHP's native
5151
[next](https://secure.php.net/manual/en/function.next.php) function for arrays (except it only returns a boolean)
5252
* `CleverAge\ProcessBundle\Model\BlockingTaskInterface`: every `execute` method call should only accumulate data from
53-
the input and once every previous task is _resolved_, the `proceed` method should provide an output (see [TODO]() for
53+
the input and once every previous task is _resolved_, the `proceed` method should provide an output (see [TODO] for
5454
the exact definition of a resolved method)
5555

5656
It's up to you to know when you should be using one of those, but basically:
5757
* When you loop over a collection of independent elements, you should use an Iterable task. It may help you reduce the
5858
memory footprint.
5959
* When you need to collect, upload, ... data as a whole, then you might need a Blocking task. Be sure to read [previous
60-
chapter's notice]() about performance.
60+
chapter's notice] about performance.
6161

6262
Tasks cannot be both Iterable and Blocking.
6363

0 commit comments

Comments
 (0)