Skip to content

Commit de57847

Browse files
authored
Merge pull request #136 from apisearch-io/feature/some-changes-for-major-version
Some changes for major version
2 parents e1890de + 349f7e8 commit de57847

File tree

9 files changed

+328
-148
lines changed

9 files changed

+328
-148
lines changed

.phpunit.result.cache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Model/User.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,23 @@ public static function createFromArray(array $array)
9898
throw InvalidFormatException::userFormatNotValid([]);
9999
}
100100

101-
return new self(
101+
return self::createFromId(
102102
$array['id'],
103103
$array['attributes'] ?? []
104104
);
105105
}
106+
107+
/**
108+
* @param string $id
109+
* @param array $attributes
110+
*
111+
* @return User
112+
*/
113+
public static function createFromId(string $id, array $attributes = []): User
114+
{
115+
return new self(
116+
$id,
117+
$attributes
118+
);
119+
}
106120
}

0 commit comments

Comments
 (0)