1 | <?php |
||
31 | final class VersionId implements ValueObjectInterface |
||
32 | { |
||
33 | const HASH_ALGORITHM = 'sha1'; |
||
34 | |||
35 | /** @var string */ |
||
36 | private $hash; |
||
37 | |||
38 | /** |
||
39 | * VersionId constructor. |
||
40 | * |
||
41 | * @param string $hash |
||
42 | * @throws InvalidArgumentException |
||
43 | */ |
||
44 | 140 | public function __construct($hash) |
|
52 | |||
53 | /** |
||
54 | * Returns a string representation of the value. |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 158 | public function toString() |
|
62 | |||
63 | /** |
||
64 | * @inheritdoc |
||
65 | */ |
||
66 | 11 | public function isSameValueAs(ValueObjectInterface $id) |
|
74 | |||
75 | /** |
||
76 | * __toString |
||
77 | * @return string |
||
78 | */ |
||
79 | 58 | public function __toString() |
|
83 | |||
84 | /** |
||
85 | * fromArray |
||
86 | * @param $ids |
||
87 | * @return VersionId[] |
||
88 | */ |
||
89 | public static function fromArray(array $ids) { |
||
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | * |
||
98 | * @throws InvalidArgumentException |
||
99 | */ |
||
100 | 27 | public static function fromNative($value) |
|
112 | |||
113 | /** |
||
114 | * Creates a VersionId based on a migration class. |
||
115 | * |
||
116 | * @param MigrationInterface $migration |
||
117 | * |
||
118 | * @return VersionId |
||
119 | * |
||
120 | * @throws InvalidArgumentException |
||
121 | */ |
||
122 | 17 | public static function fromMigration(MigrationInterface $migration) |
|
127 | } |
||
128 |