Skip to content

Commit 27625c3

Browse files
committed
WIP
Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
1 parent 56e9498 commit 27625c3

File tree

3 files changed

+106
-9
lines changed

3 files changed

+106
-9
lines changed

docs/book/v1/component/collection.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Collections can be created only in APIs.
44
5-
To create a collection, use either of the following commands:
5+
To create a Collection, use either of the following commands:
66

77
```shell
88
composer make collection
@@ -14,37 +14,37 @@ OR
1414
./vendor/bin/dot-maker collection
1515
```
1616

17-
The command must identify in which module you want to create the new collection.
17+
`dot-maker` needs to determine in which module you want to create the new Collection.
1818
To determine this, it will prompt you to enter the name of an existing module:
1919

2020
> Existing module name:
2121
22-
If you input a module name which does not exist (like, "NonExistentModule"), the command throws an error:
22+
If you input a module name which does not exist (like, "NonExistentModule"), an error will be thrown:
2323

2424
> Module "NonExistentModule" not found
2525
2626
and will keep prompting for a valid module name until you provide one.
2727

2828
---
2929

30-
Once the target module has been identified, the command will prompt you to input a name for the collection:
30+
Once the target module has been identified, you will be prompted to input a name for the Collection:
3131

3232
> Collection name:
3333
3434
**The name must contain only letters and numbers.**
3535

36-
If you leave the name blank, the command will exit.
36+
If you leave the name blank, the process will exit.
3737

38-
If you input an invalid name (like, "."), the command throws an error:
38+
If you input an invalid name (like, "."), an error will be thrown:
3939

4040
> Invalid Collection name: "."
4141
42-
If you input the name of an existing collection (like, "ExistingCollection"), the command throws an error:
42+
If you input the name of an existing Collection (like, "ExistingCollection"), an error will be thrown:
4343

4444
> Class "ExistingCollection" already exists at /path/to/project/src/ExistingModule/src/Collection/ExistingCollection.php
4545
46-
If you input a valid name, the command will create the collection and output a success message:
46+
If you input a valid name, `dot-maker` will create the Collection and output a success message:
4747

4848
> Created Collection: /path/to/project/src/ExistingModule/src/Collection/NewCollection.php
4949
50-
To allow the creation of multiple collections, the command will loop until you leave the name blank.
50+
To allow the creation of multiple Collections, the process will loop until you leave the name blank.

docs/book/v1/component/command.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
11
# Create Command
2+
3+
To create a Command, use either of the following commands:
4+
5+
```shell
6+
composer make command
7+
```
8+
9+
OR
10+
11+
```shell
12+
./vendor/bin/dot-maker command
13+
```
14+
15+
`dot-maker` needs to determine in which module you want to create the new Command.
16+
To determine this, it will prompt you to enter the name of an existing module:
17+
18+
> Existing module name:
19+
20+
If you input a module name which does not exist (like, "NonExistentModule"), an error will be thrown:
21+
22+
> Module "NonExistentModule" not found
23+
24+
and will keep prompting for a valid module name until you provide one.
25+
26+
---
27+
28+
Once the target module has been identified, you will be prompted to input a name for the Command:
29+
30+
> Command name:
31+
32+
**The name must contain only letters and numbers.**
33+
34+
If you leave the name blank, the process will exit.
35+
36+
If you input an invalid name (like, "."), an error will be thrown:
37+
38+
> Invalid Command name: "."
39+
40+
If you input the name of an existing Command (like, "ExistingCommand"), an error will be thrown:
41+
42+
> Class "ExistingCommand" already exists at /path/to/project/src/ExistingModule/src/Command/ExistingCommand.php
43+
44+
If you input a valid name, `dot-maker` will create the Command and output a success message:
45+
46+
> Created Collection: /path/to/project/src/ExistingModule/src/Command/NewCommand.php
47+
48+
To allow the creation of multiple Commands, the process will loop until you leave the name blank.
49+
50+
> dot-maker will look for a matching ServiceInterface in the module (e.g.: BookServiceInterface — BookCommand).
51+
> If it finds one, it will automatically inject it into the Command.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
11
# Create Middleware
2+
3+
To create a Middleware, use either of the following commands:
4+
5+
```shell
6+
composer make middleware
7+
```
8+
9+
OR
10+
11+
```shell
12+
./vendor/bin/dot-maker middleware
13+
```
14+
15+
`dot-maker` needs to determine in which module you want to create the new Middleware.
16+
To determine this, it will prompt you to enter the name of an existing module:
17+
18+
> Existing module name:
19+
20+
If you input a module name which does not exist (like, "NonExistentModule"), an error will be thrown:
21+
22+
> Module "NonExistentModule" not found
23+
24+
and will keep prompting for a valid module name until you provide one.
25+
26+
---
27+
28+
Once the target module has been identified, you will be prompted to input a name for the Middleware:
29+
30+
> Middleware name:
31+
32+
**The name must contain only letters and numbers.**
33+
34+
If you leave the name blank, the process will exit.
35+
36+
If you input an invalid name (like, "."), an error will be thrown:
37+
38+
> Invalid Middleware name: "."
39+
40+
If you input the name of an existing Middleware (like, "ExistingMiddleware"), an error will be thrown:
41+
42+
> Class "ExistingMiddleware" already exists at /path/to/project/src/ExistingModule/src/Middleware/ExistingMiddleware.php
43+
44+
If you input a valid name, `dot-maker` will create the Command and output a success message:
45+
46+
> Created Middleware: /path/to/project/src/ExistingModule/src/Middleware/NewMiddleware.php
47+
48+
To allow the creation of multiple Middleware, the process will loop until you leave the name blank.

0 commit comments

Comments
 (0)