Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
msgpack
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
msgpack
Commits
a6a92e42
Commit
a6a92e42
authored
1 year ago
by
Luhur Abdi Rizal
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3437762
by el7cosmos: Update coding standard ruleset
parent
080779af
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2
update coding standard ruleset
Pipeline
#135909
passed
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
phpcs.xml.dist
+32
-9
32 additions, 9 deletions
phpcs.xml.dist
src/Serialization/MessagePack.php
+3
-0
3 additions, 0 deletions
src/Serialization/MessagePack.php
tests/src/Unit/MessagePackTest.php
+9
-0
9 additions, 0 deletions
tests/src/Unit/MessagePackTest.php
with
44 additions
and
9 deletions
phpcs.xml.dist
+
32
−
9
View file @
a6a92e42
<?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>
This diff is collapsed.
Click to expand it.
src/Serialization/MessagePack.php
+
3
−
0
View file @
a6a92e42
...
...
@@ -4,6 +4,9 @@ namespace Drupal\msgpack\Serialization;
use
Drupal\Component\Serialization\SerializationInterface
;
/**
* Provides a MessagePack serialization implementation.
*/
class
MessagePack
implements
SerializationInterface
{
/**
...
...
This diff is collapsed.
Click to expand it.
tests/src/Unit/MessagePackTest.php
+
9
−
0
View file @
a6a92e42
...
...
@@ -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
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment