Configure phpcs, fix errors

This commit is contained in:
Oliver Davies 2025-06-15 16:31:51 +01:00
parent fcf0ae04bb
commit af83b3c431
5 changed files with 37 additions and 2 deletions

View file

@ -13,6 +13,7 @@ trait DailyEmailTestTrait {
/** /**
* @param non-empty-string $title * @param non-empty-string $title
* @param bool $isPublished
*/ */
protected function createDailyEmailNode( protected function createDailyEmailNode(
string $title, string $title,

View file

@ -75,4 +75,5 @@ class PodcastTokenTest extends BrowserTestBase {
'type' => Episode::NODE_TYPE, 'type' => Episode::NODE_TYPE,
]); ]);
} }
} }

View file

@ -36,7 +36,7 @@ readonly final class Events implements \Countable, \IteratorAggregate {
} }
/** /**
* @param non-empty-string[] $events * @param non-empty-string[] $dates
*/ */
public static function fromDateStrings(string ...$dates): self { public static function fromDateStrings(string ...$dates): self {
$events = array_map( $events = array_map(

View file

@ -18,6 +18,7 @@ trait PresentationCreationTrait {
/** /**
* @param Event[] $events * @param Event[] $events
* @param bool $isPublished
*/ */
private function createPresentation(Events $events, bool $isPublished = TRUE): Presentation { private function createPresentation(Events $events, bool $isPublished = TRUE): Presentation {
$presentation = $this->createNode([ $presentation = $this->createNode([
@ -47,4 +48,3 @@ trait PresentationCreationTrait {
} }
} }

33
phpcs.xml.dist Normal file
View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="phpcs-standard">
<description>Codestyle ruleset for Drupal</description>
<rule ref="Drupal"/>
<rule ref="DrupalPractice"/>
<arg name="colors"/>
<arg value="np"/>
<file>modules</file>
<file>themes</file>
<rule ref="Drupal">
<exclude name="Drupal.Commenting.ClassComment.Missing"/>
<exclude name="Drupal.Commenting.DataTypeNamespace.DataTypeNamespace"/>
<exclude name="Drupal.Commenting.Deprecated"/>
<exclude name="Drupal.Commenting.DocComment.ContentAfterOpen"/>
<exclude name="Drupal.Commenting.DocComment.MissingShort"/>
<exclude name="Drupal.Commenting.FunctionComment.IncorrectParamVarName"/>
<exclude name="Drupal.Commenting.FunctionComment.IncorrectTypeHint"/>
<exclude name="Drupal.Commenting.FunctionComment.InvalidReturn"/>
<exclude name="Drupal.Commenting.FunctionComment.Missing"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingParamComment"/>
<exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/>
<exclude name="Drupal.Commenting.FunctionComment.ParamTypeSpaces"/>
<exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/>
<exclude name="Drupal.Commenting.InlineComment.DocBlock"/>
<exclude name="Drupal.Commenting.VariableComment.Missing"/>
<exclude name="Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps"/>
<exclude name="DrupalPractice.Objects.StrictSchemaDisabled.StrictConfigSchema"/>
</rule>
</ruleset>