Skip to content
Snippets Groups Projects
Commit a6a92e42 authored by Luhur Abdi Rizal's avatar Luhur Abdi Rizal
Browse files

Issue #3437762 by el7cosmos: Update coding standard ruleset

parent 080779af
No related branches found
No related tags found
1 merge request!2update coding standard ruleset
Pipeline #135909 passed
<?xml version="1.0"?> <?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Drupal Coding Standards"> <ruleset name="drupal_project">
<description>Enforce Drupal coding standards with some exceptions</description> <arg name="extensions" value="engine,inc,install,module,php,profile,test,theme,yml"/>
<description>Default PHP CodeSniffer configuration for Drupal project.</description>
<rule ref="./web/core/phpcs.xml.dist">
<exclude name="Drupal.Commenting.ClassComment.Short"/>
</rule>
<!-- Drupal sniffs -->
<rule ref="Drupal"/> <rule ref="Drupal"/>
<rule ref="DrupalPractice"> <!-- Drupal Practice sniffs -->
<exclude name="DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter"/> <rule ref="DrupalPractice"/>
<!-- Generic sniffs -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/>
<!-- PSR-2 sniffs -->
<rule ref="PSR2.Classes.PropertyDeclaration">
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
</rule>
<!-- SlevomatCodingStandard sniffs -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="@inheritDoc"/>
<element value="@inheritdoc"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array">
<element value="/@inheritDoc/"/>
</property>
</properties>
</rule> </rule>
</ruleset> </ruleset>
...@@ -4,6 +4,9 @@ namespace Drupal\msgpack\Serialization; ...@@ -4,6 +4,9 @@ namespace Drupal\msgpack\Serialization;
use Drupal\Component\Serialization\SerializationInterface; use Drupal\Component\Serialization\SerializationInterface;
/**
* Provides a MessagePack serialization implementation.
*/
class MessagePack implements SerializationInterface { class MessagePack implements SerializationInterface {
/** /**
......
...@@ -5,13 +5,22 @@ namespace Drupal\Tests\msgpack\Unit; ...@@ -5,13 +5,22 @@ namespace Drupal\Tests\msgpack\Unit;
use Drupal\msgpack\Serialization\MessagePack; use Drupal\msgpack\Serialization\MessagePack;
use Drupal\Tests\UnitTestCase; use Drupal\Tests\UnitTestCase;
/**
* MessagePack tests.
*/
class MessagePackTest extends UnitTestCase { class MessagePackTest extends UnitTestCase {
/**
* Test MessagePack encoding and decoding.
*/
public function testMessagePack(): void { public function testMessagePack(): void {
$object = $this->randomObject(); $object = $this->randomObject();
$this->assertEquals($object, MessagePack::decode(MessagePack::encode($object))); $this->assertEquals($object, MessagePack::decode(MessagePack::encode($object)));
} }
/**
* Test MessagePack file extension.
*/
public function testGetFileExtension(): void { public function testGetFileExtension(): void {
$this->assertEquals('msgpack', MessagePack::getFileExtension()); $this->assertEquals('msgpack', MessagePack::getFileExtension());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment