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
Branches
Tags
1 merge request!2update coding standard ruleset
Pipeline #135909 passed
<?xml version="1.0"?>
<ruleset name="Drupal Coding Standards">
<description>Enforce Drupal coding standards with some exceptions</description>
<rule ref="./web/core/phpcs.xml.dist">
<exclude name="Drupal.Commenting.ClassComment.Short"/>
</rule>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="drupal_project">
<arg name="extensions" value="engine,inc,install,module,php,profile,test,theme,yml"/>
<description>Default PHP CodeSniffer configuration for Drupal project.</description>
<!-- Drupal sniffs -->
<rule ref="Drupal"/>
<rule ref="DrupalPractice">
<exclude name="DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter"/>
<!-- Drupal Practice sniffs -->
<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>
</ruleset>
......@@ -4,6 +4,9 @@ namespace Drupal\msgpack\Serialization;
use Drupal\Component\Serialization\SerializationInterface;
/**
* Provides a MessagePack serialization implementation.
*/
class MessagePack implements SerializationInterface {
/**
......
......@@ -5,13 +5,22 @@ namespace Drupal\Tests\msgpack\Unit;
use Drupal\msgpack\Serialization\MessagePack;
use Drupal\Tests\UnitTestCase;
/**
* MessagePack tests.
*/
class MessagePackTest extends UnitTestCase {
/**
* Test MessagePack encoding and decoding.
*/
public function testMessagePack(): void {
$object = $this->randomObject();
$this->assertEquals($object, MessagePack::decode(MessagePack::encode($object)));
}
/**
* Test MessagePack file extension.
*/
public function testGetFileExtension(): void {
$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