Skip to content

Commit 6a66bc4

Browse files
committed
Add defaults for patch data deserialization to allow painless v1.x -> v2.x migration.
1 parent 8f76c4d commit 6a66bc4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Patch.php

+7
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ public static function createFromConfig($sourcePackage, $targetPackage, array $c
126126

127127
public static function createFromArray(array $data)
128128
{
129+
$data = array_merge([
130+
'version_constraint' => '*',
131+
'description' => null,
132+
'strip_path_components' => 1,
133+
'method' => PatchApplicator::METHOD_PATCH,
134+
'keep_empty_files' => false,
135+
], $data);
129136

130137
return new static(
131138
$data['source_package'],

0 commit comments

Comments
 (0)