Skip to content

Commit 349f7e8

Browse files
committed
Some changes for major version
- Added and normalized suggestions and autocomplete in Query and Result - Result is now built with an entire Query object, but this one is never passed in array serialization - Query text now trims and strip tags - A User can be created with an ID with a direct method
1 parent e1890de commit 349f7e8

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)