Skip to content
Snippets Groups Projects
Commit ef96f9ae authored by Omkar Deshpande's avatar Omkar Deshpande Committed by Wim Leers
Browse files

Issue #3484045 by omkar-pd, atul_ghate, longwave: Update XB to match the...

Issue #3484045 by omkar-pd, atul_ghate, longwave: Update XB to match the latest Drupal 11 phpcs.xml.dist- 2024-10-28
parent 3be48dcb
Branches
Tags
1 merge request!375#3484045: Update XB to match the latest Drupal 11 phpcs.xml.dist- 2024-10-28
Pipeline #333350 failed
......@@ -66,14 +66,17 @@
<rule ref="Drupal.Commenting.DocCommentLongArraySyntax"/>
<rule ref="Drupal.Commenting.DocCommentStar"/>
<rule ref="Drupal.Commenting.FileComment"/>
<rule ref="Drupal.Commenting.FunctionComment">
<exclude name="Drupal.Commenting.FunctionComment.InvalidNoReturn"/>
<exclude name="Drupal.Commenting.FunctionComment.Missing"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingParamType"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/>
<exclude name="Drupal.Commenting.FunctionComment.ParamCommentFullStop"/>
<exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
</rule>
<rule ref="Drupal.Commenting.FunctionComment.MissingParamType">
<include-pattern>core/lib/Component/*</include-pattern>
</rule>
<rule ref="Drupal.Commenting.GenderNeutralComment"/>
<rule ref="Drupal.Commenting.HookComment"/>
<rule ref="Drupal.Commenting.InlineComment">
......@@ -144,8 +147,10 @@
<!-- Drupal Practice sniffs -->
<rule ref="DrupalPractice.CodeAnalysis.VariableAnalysis">
<!-- @todo exclude tests -->
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/Functional/*</exclude-pattern>
<exclude-pattern>*/FunctionalJavascript/*</exclude-pattern>
<exclude-pattern>*/core/tests/*</exclude-pattern>
<exclude-pattern>*/core/profiles/*/tests/*</exclude-pattern>
<!-- Do not run this sniff on API files or transliteration data. -->
<exclude-pattern>*.api.php</exclude-pattern>
<exclude-pattern>core/lib/Drupal/Component/Transliteration/data/*.php</exclude-pattern>
......
......@@ -32,24 +32,23 @@ final class OpenApiSpecValidationTest extends UnitTestCase {
*/
protected function setUp(): void {
parent::setUp();
$possible_start_paths = [dirname(DRUPAL_ROOT), DRUPAL_ROOT];
$tested_paths = [];
foreach ($possible_start_paths as $path) {
$finder = new DrupalFinderComposerRuntime();
$vendor_directory = $finder->getVendorDir();
if (!$vendor_directory) {
continue;
}
$finder = new DrupalFinderComposerRuntime();
$vendor_directory = $finder->getVendorDir();
if ($vendor_directory) {
$document_location = $vendor_directory . '/devizzent/cebe-php-openapi/schemas/openapi-v3.1.json';
if (!file_exists($document_location)) {
if (file_exists($document_location)) {
$this->documentLocation = $document_location;
}
else {
$tested_paths[] = $document_location;
continue;
}
$this->documentLocation = $document_location;
break;
}
if (!$this->documentLocation) {
throw new \Exception(sprintf('Could not OpenAPI 3.0 schema at %s.', implode(' or ', $tested_paths)));
throw new \Exception(sprintf('Could not find OpenAPI 3.0 schema at %s.', implode(' or ', $tested_paths)));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment