Skip to content

Commit f98eff9

Browse files
committed
[#2106] Updated require-dev to use only necessary packages and updated PHPCS to v4 and Coder to v9.
1 parent 9395f7f commit f98eff9

33 files changed

Lines changed: 294 additions & 156 deletions

File tree

.vortex/docs/content/drupal/composer.mdx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ effective development environment.
141141
Behavior-Driven Development (BDD), allowing you to write human-readable
142142
stories that describe the behavior of your application. It facilitates
143143
communication between developers, stakeholders, and clients.
144+
- [`dantleech/gherkin-lint`](https://github.com/dantleech/gherkin-lint): A
145+
linting tool for Gherkin feature files used in Behat tests. Ensures
146+
consistency and quality in BDD test scenarios by checking syntax and
147+
formatting.
144148
- [`dealerdirect/phpcodesniffer-composer-installer`](https://github.com/Dealerdirect/phpcodesniffer-composer-installer):
145149
This tool automatically configures PHP_CodeSniffer to use the coding
146150
standards (like PSR-2 or Drupal coding standards) installed in a project.
@@ -154,10 +158,12 @@ effective development environment.
154158
collection of pre-defined step definitions for Behat. This package speeds up
155159
the process of writing new Behat tests by providing common step
156160
implementations.
157-
- [`drupal/core-dev`](https://www.drupal.org/project/drupal): Includes
158-
development-specific dependencies and tools primarily for testing and code
159-
analysis, including PHPUnit, PHP_CodeSniffer with rules (
160-
via [Coder](https://www.drupal.org/project/coder) module).
161+
- [`drevops/phpcs-standard`](https://github.com/drevops/phpcs-standard): A
162+
custom PHP_CodeSniffer coding standard that extends Drupal coding standards
163+
with additional rules and best practices specific to DrevOps projects.
164+
- [`drupal/coder`](https://www.drupal.org/project/coder): Provides
165+
PHP_CodeSniffer rules for Drupal coding standards. Version 9.x supports
166+
PHP_CodeSniffer 4.x and includes updated rules for modern Drupal development.
161167
- [`drupal/drupal-extension`](https://github.com/jhedstrom/drupalextension): A
162168
Behat extension that provides integration with Drupal, offering step
163169
definitions specific to Drupal functionality. It facilitates the creation and
@@ -173,7 +179,7 @@ effective development environment.
173179
- [`phpcompatibility/php-compatibility`](https://github.com/PHPCompatibility/PHPCompatibility):
174180
Provides a collection of sniffs for PHP_CodeSniffer to check PHP code for
175181
compatibility with different PHP versions, crucial for ensuring long-term
176-
maintainability.
182+
maintainability. Version 10.x supports PHP_CodeSniffer 4.x.
177183
- [`phpmd/phpmd`](https://github.com/phpmd/phpmd): PHP Mess Detector is a
178184
user-friendly tool that helps you detect several potential problems in your
179185
PHP code, including possible bugs, suboptimal code, and overcomplicated
@@ -184,10 +190,22 @@ effective development environment.
184190
- [`phpstan/extension-installer`](https://github.com/phpstan/extension-installer):
185191
This package automatically installs and enables PHPStan extensions,
186192
streamlining the setup process for PHPStan in your project.
193+
- [`phpstan/phpstan`](https://github.com/phpstan/phpstan): A static analysis
194+
tool for PHP that focuses on finding bugs in code without running it. Helps
195+
catch type errors, incorrect method calls, and other potential issues during
196+
development.
197+
- [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit): The
198+
industry-standard testing framework for PHP. Provides a comprehensive set of
199+
tools for writing and running unit tests, integration tests, and functional
200+
tests.
187201
- [`pyrech/composer-changelogs`](https://github.com/pyrech/composer-changelogs):
188202
Provides a summary of package changes (like updates, removals, and additions)
189203
after running `composer update`, improving the visibility of package changes
190204
and updates in your project.
205+
- [`rector/rector`](https://github.com/rectorphp/rector): An automated
206+
refactoring tool that instantly upgrades and refactors PHP code. Helps with
207+
code modernization, framework migrations, and automated application of coding
208+
standards.
191209
- [`vincentlanglet/twig-cs-fixer`](https://github.com/VincentLanglet/Twig-CS-Fixer): This tool
192210
ensures that Twig templates adhere to a set coding standard, helping maintain
193211
consistency and readability in template files.

.vortex/docs/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"containerisation",
3030
"customisations",
3131
"cweagans",
32+
"dantleech",
3233
"dclint",
3334
"ddev",
3435
"dealerdirect",

.vortex/installer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"bamarni/composer-bin-plugin": "^1.8.2",
3838
"dealerdirect/phpcodesniffer-composer-installer": "^1.2.0",
3939
"drevops/phpcs-standard": "^0.6",
40-
"drupal/coder": "^8.3.31",
40+
"drupal/coder": "^9@alpha",
4141
"ergebnis/composer-normalize": "^2.48.2",
4242
"laravel/serializable-closure": "^2.0.6",
4343
"mockery/mockery": "^1.6.12",

.vortex/installer/composer.lock

Lines changed: 34 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vortex/installer/src/Prompts/Handlers/Tools.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,16 @@ public static function getToolDefinitions(string $filter = 'all'): array {
181181
'present' => fn(): mixed => File::contains($this->dstDir . '/composer.json', 'dealerdirect/phpcodesniffer-composer-installer') ||
182182
File::contains($this->dstDir . '/composer.json', 'drupal/coder') ||
183183
File::contains($this->dstDir . '/composer.json', 'squizlabs/php_codesniffer') ||
184+
File::contains($this->dstDir . '/composer.json', 'phpcompatibility/php-compatibility') ||
185+
File::contains($this->dstDir . '/composer.json', 'drevops/phpcs-standard') ||
184186
File::exists($this->dstDir . '/phpcs.xml'),
185187
'composer.json' => function (JsonManipulator $cj): void {
186188
$cj->removeSubNode('require-dev', 'dealerdirect/phpcodesniffer-composer-installer');
187189
$cj->removeConfigSetting('allow-plugins.dealerdirect/phpcodesniffer-composer-installer');
188190
$cj->removeSubNode('require-dev', 'drupal/coder');
189191
$cj->removeSubNode('require-dev', 'squizlabs/php_codesniffer');
192+
$cj->removeSubNode('require-dev', 'phpcompatibility/php-compatibility');
193+
$cj->removeSubNode('require-dev', 'drevops/phpcs-standard');
190194
},
191195
'files' => ['phpcs.xml'],
192196
'strings' => [
@@ -200,10 +204,13 @@ public static function getToolDefinitions(string $filter = 'all'): array {
200204
'title' => 'PHPStan',
201205
'present' => fn(): mixed => File::contains($this->dstDir . '/composer.json', 'phpstan/phpstan') ||
202206
File::contains($this->dstDir . '/composer.json', 'mglaman/phpstan-drupal') ||
207+
File::contains($this->dstDir . '/composer.json', 'phpstan/extension-installer') ||
203208
File::exists($this->dstDir . '/phpstan.neon'),
204209
'composer.json' => function (JsonManipulator $cj): void {
205210
$cj->removeSubNode('require-dev', 'phpstan/phpstan');
206211
$cj->removeSubNode('require-dev', 'mglaman/phpstan-drupal');
212+
$cj->removeSubNode('require-dev', 'phpstan/extension-installer');
213+
$cj->removeConfigSetting('allow-plugins.phpstan/extension-installer');
207214
},
208215
'files' => ['phpstan.neon'],
209216
'strings' => [
@@ -220,6 +227,7 @@ public static function getToolDefinitions(string $filter = 'all'): array {
220227
File::exists($this->dstDir . '/rector.php'),
221228
'composer.json' => function (JsonManipulator $cj): void {
222229
$cj->removeSubNode('require-dev', 'rector/rector');
230+
$cj->removeSubNode('require-dev', 'palantirnet/drupal-rector');
223231
},
224232
'files' => ['rector.php'],
225233
'strings' => ['/^.*\brector\b.*\n?/m'],
@@ -244,9 +252,11 @@ public static function getToolDefinitions(string $filter = 'all'): array {
244252
self::PHPUNIT => [
245253
'title' => 'PHPUnit',
246254
'present' => fn(): mixed => File::contains($this->dstDir . '/composer.json', 'phpunit/phpunit') ||
255+
File::contains($this->dstDir . '/composer.json', 'phpspec/prophecy-phpunit') ||
247256
File::exists($this->dstDir . '/phpunit.xml'),
248257
'composer.json' => function (JsonManipulator $cj): void {
249258
$cj->removeSubNode('require-dev', 'phpunit/phpunit');
259+
$cj->removeSubNode('require-dev', 'phpspec/prophecy-phpunit');
250260
$cj->removeProperty('autoload-dev.classmap');
251261
$cj->removeMainKeyIfEmpty('autoload-dev');
252262
},
@@ -273,11 +283,17 @@ public static function getToolDefinitions(string $filter = 'all'): array {
273283
'title' => 'Behat',
274284
'present' => fn(): mixed => File::contains($this->dstDir . '/composer.json', 'behat/behat') ||
275285
File::contains($this->dstDir . '/composer.json', 'drupal/drupal-extension') ||
286+
File::contains($this->dstDir . '/composer.json', 'drevops/behat-format-progress-fail') ||
287+
File::contains($this->dstDir . '/composer.json', 'drevops/behat-screenshot') ||
288+
File::contains($this->dstDir . '/composer.json', 'drevops/behat-steps') ||
276289
File::exists($this->dstDir . '/behat.yml'),
277290
'composer.json' => function (JsonManipulator $cj): void {
278291
$cj->removeSubNode('require-dev', 'behat/behat');
279292
$cj->removeSubNode('require-dev', 'drupal/drupal-extension');
280293
$cj->removeSubNode('require-dev', 'dantleech/gherkin-lint');
294+
$cj->removeSubNode('require-dev', 'drevops/behat-format-progress-fail');
295+
$cj->removeSubNode('require-dev', 'drevops/behat-screenshot');
296+
$cj->removeSubNode('require-dev', 'drevops/behat-steps');
281297
},
282298
'files' => [
283299
'behat.yml',

.vortex/installer/tests/Fixtures/install/_baseline/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,18 @@
3636
"drevops/behat-screenshot": "__VERSION__",
3737
"drevops/behat-steps": "__VERSION__",
3838
"drevops/phpcs-standard": "__VERSION__",
39-
"drupal/core-dev": "__VERSION__",
39+
"drupal/coder": "__VERSION__",
4040
"drupal/drupal-extension": "__VERSION__",
4141
"ergebnis/composer-normalize": "__VERSION__",
4242
"mglaman/phpstan-drupal": "__VERSION__",
43+
"mikey179/vfsstream": "__VERSION__",
4344
"palantirnet/drupal-rector": "__VERSION__",
4445
"phpcompatibility/php-compatibility": "__VERSION__",
4546
"phpmd/phpmd": "__VERSION__",
4647
"phpspec/prophecy-phpunit": "__VERSION__",
4748
"phpstan/extension-installer": "__VERSION__",
4849
"phpstan/phpstan": "__VERSION__",
50+
"phpunit/phpunit": "__VERSION__",
4951
"pyrech/composer-changelogs": "__VERSION__",
5052
"rector/rector": "__VERSION__",
5153
"vincentlanglet/twig-cs-fixer": "__VERSION__"

.vortex/installer/tests/Fixtures/install/hosting_acquia/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -117,40 +117,40 @@
1+
@@ -119,40 +119,40 @@
22
"[web-root]/web.config": false
33
},
44
"locations": {

.vortex/installer/tests/Fixtures/install/hosting_project_name___acquia/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -117,40 +117,40 @@
1+
@@ -119,40 +119,40 @@
22
"[web-root]/web.config": false
33
},
44
"locations": {

.vortex/installer/tests/Fixtures/install/starter_drupal_cms_profile/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"require-dev": {
1919
"behat/behat": "__VERSION__",
20-
@@ -59,7 +62,7 @@
20+
@@ -61,7 +64,7 @@
2121
"url": "https://packages.drupal.org/8"
2222
}
2323
],
@@ -26,7 +26,7 @@
2626
"prefer-stable": true,
2727
"autoload": {
2828
"classmap": [
29-
@@ -82,7 +85,11 @@
29+
@@ -84,7 +87,11 @@
3030
"php-http/discovery": true,
3131
"phpstan/extension-installer": true,
3232
"pyrech/composer-changelogs": true,
@@ -39,7 +39,7 @@
3939
},
4040
"audit": {
4141
"abandoned": "report",
42-
@@ -162,7 +169,20 @@
42+
@@ -164,7 +171,20 @@
4343
"patchLevel": {
4444
"drupal/core": "-p2"
4545
},

0 commit comments

Comments
 (0)