Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 7211c8f

Browse files
committed
add position
1 parent 385b90c commit 7211c8f

9 files changed

+4892
-26
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/vendor/
2+
3+
4+
###> friendsofphp/php-cs-fixer ###
5+
/.php_cs
6+
/.php_cs.cache
7+
###< friendsofphp/php-cs-fixer ###

.php_cs.dist

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
//https://cs.symfony.com/
4+
5+
$finder = PhpCsFixer\Finder::create()
6+
->in(__DIR__.'/src')
7+
;
8+
9+
return PhpCsFixer\Config::create()
10+
->setRiskyAllowed(true)
11+
->setRules([
12+
'@Symfony' => true,
13+
'@DoctrineAnnotation' => true,
14+
'phpdoc_summary' => false,
15+
'no_unneeded_final_method' => false,
16+
'no_superfluous_phpdoc_tags' => true,
17+
"no_unused_imports" => true,
18+
'concat_space' => ['spacing' => 'none'],
19+
'phpdoc_to_comment' => false,
20+
'native_constant_invocation' => true,
21+
'native_function_invocation' => ['include' => ['@compiler_optimized']],
22+
'PedroTroller/useless_code_after_return' => true,
23+
'array_syntax' => ['syntax' => 'short'],
24+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
25+
'yoda_style' => false,
26+
'increment_style' => ['style' => 'post']
27+
])
28+
->setFinder($finder)
29+
->setRiskyAllowed(true)
30+
->setCacheFile(__DIR__ . '/.php_cs.cache')
31+
->registerCustomFixers([
32+
new PedroTroller\CS\Fixer\CodingStyle\LineBreakBetweenStatementsFixer,
33+
new PedroTroller\CS\Fixer\Comment\UselessCommentFixer,
34+
new PedroTroller\CS\Fixer\DeadCode\UselessCodeAfterReturnFixer(),
35+
]);

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONSOLE = php bin/console
2+
3+
fix:
4+
php -d memory_limit=1024m vendor/bin/php-cs-fixer fix -v

README.md

+29-8
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ artgris_easy_admin_commands:
101101
format: 'dd/MM/yyyy'
102102

103103
list:
104-
exclude: ['id']
104+
excluded:
105+
- id
105106
form:
106-
exclude: ['id']
107+
excluded:
108+
- id
107109
```
108110
109111
```bash
@@ -147,6 +149,8 @@ artgris_easy_admin_commands:
147149
dir: '%kernel.project_dir%/config/packages/easy_admin/entities/'
148150
namespaces:
149151
- 'App\Entity'
152+
entities:
153+
- 'App\Entity\Example'
150154
types:
151155
text:
152156
type_options:
@@ -159,23 +163,40 @@ artgris_easy_admin_commands:
159163
...
160164

161165
list:
162-
include: ['name', ...]
163-
exclude: ['id', ... ]
166+
included:
167+
- name
168+
- ...
169+
exclude:
170+
- id
171+
- ...
172+
position:
173+
- name
174+
- ...
164175
form:
165-
include: ['name', ...]
166-
exclude: ['id', ... ]
176+
included:
177+
- name
178+
- ...
179+
exclude:
180+
- id
181+
- ...
182+
position:
183+
- name
184+
- ...
167185
```
168186
169187
**dir** : The folder in which the configuration is generated
170188
171189
**namespaces** : Entity search namespaces
172190
191+
**entities** : Entities restriction
192+
173193
**types** : If a doctrine type [metadata type](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.9/reference/types.html) is found, the generator will use the associated configuration
174194
175195
**regex** : forces the type of an entity field according to its name and a regex
176196
177197
**list**
178-
- **include** : only includes these fields in the list (if they are present in the entity)
179-
- **exclude** : exclude the following fields from the list (if they are present in the entity)
198+
- **included** : only includes these fields in the list (if they are present in the entity)
199+
- **excluded** : exclude the following fields from the list (if they are present in the entity)
200+
- **position** : position of fields in the list (if they are present in the entity)
180201
181202
**form** : *same as list*

composer.json

+4
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,9 @@
2828
"psr-4": {
2929
"Artgris\\Bundle\\EasyAdminCommandsBundle\\": "src/"
3030
}
31+
},
32+
"require-dev": {
33+
"friendsofphp/php-cs-fixer": "^2.15",
34+
"pedrotroller/php-cs-custom-fixer": "^2.19"
3135
}
3236
}

0 commit comments

Comments
 (0)