Skip to content

Commit 46e5a89

Browse files
committed
Fix PHP 8.1 compatibiltiy issues
1 parent 87a02d9 commit 46e5a89

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
}
1717
},
1818
"config": {
19-
"sort-packages": true
19+
"sort-packages": true,
20+
"allow-plugins": {
21+
"dealerdirect/phpcodesniffer-composer-installer": false
22+
}
2023
},
2124
"extra": {
2225
"branch-alias": {

phpcs.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
<file>./scripts</file>
66
<file>./src</file>
77
<file>./tests</file>
8-
<rule ref="vendor/drupal/coder/coder_sniffer/Drupal"/>
8+
<rule ref="vendor/drupal/coder/coder_sniffer/Drupal">
9+
<!-- Conflicts with PHP attributes. -->
10+
<exclude name="Drupal.Commenting.InlineComment.DocBlock"/>
11+
<exclude name="Drupal.Commenting.FunctionComment.Missing"/>
12+
</rule>
913
<rule ref="vendor/drupal/coder/coder_sniffer/DrupalPractice">
1014
<exclude name="Drupal.Commenting.VariableComment.Missing"/>
1115
<exclude name="Drupal.Arrays.Array.LongLineDeclaration"/>

src/Asset/AssetCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function __construct(array $assets = []) {
2727
/**
2828
* {@inheritdoc}
2929
*/
30+
#[\ReturnTypeWillChange]
3031
public function offsetSet($key, $value) {
3132
if ($key === NULL) {
3233
$this->assets[] = $value;
@@ -39,6 +40,7 @@ public function offsetSet($key, $value) {
3940
/**
4041
* {@inheritdoc}
4142
*/
43+
#[\ReturnTypeWillChange]
4244
public function offsetGet($key) {
4345
if (isset($this->assets[$key])) {
4446
return $this->assets[$key];

0 commit comments

Comments
 (0)