Skip to content

Commit 2dab195

Browse files
committed
Prioritize transformers over raw extensions while packing
1 parent fe26397 commit 2dab195

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Packer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,16 @@ public function pack($value)
119119
if (\is_float($value)) {
120120
return $this->packFloat($value);
121121
}
122-
if ($value instanceof Ext) {
123-
return $this->packExt($value->type, $value->data);
124-
}
125122
if ([] !== $this->transformers) {
126123
foreach ($this->transformers as $transformer) {
127124
if (null !== $packed = $transformer->pack($this, $value)) {
128125
return $packed;
129126
}
130127
}
131128
}
129+
if ($value instanceof Ext) {
130+
return $this->packExt($value->type, $value->data);
131+
}
132132

133133
throw PackingFailedException::unsupportedType($value);
134134
}

0 commit comments

Comments
 (0)