File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,17 @@ public function getId(): string
6666 }
6767
6868 /**
69- * @return string
69+ * @return string|null
7070 */
71- public function getSequence (): string
71+ public function getSequence (): ? string
7272 {
73- return $ this ->getAttribute ('$sequence ' , '' );
73+ $ sequence = $ this ->getAttribute ('$sequence ' );
74+
75+ if ($ sequence === null ) {
76+ return null ;
77+ }
78+
79+ return $ sequence ;
7480 }
7581
7682 /**
@@ -172,10 +178,12 @@ public function getUpdatedAt(): ?string
172178 public function getTenant (): ?int
173179 {
174180 $ tenant = $ this ->getAttribute ('$tenant ' );
175- if ($ tenant !== null ) {
176- return (int )$ tenant ;
181+
182+ if ($ tenant === null ) {
183+ return null ;
177184 }
178- return null ;
185+
186+ return (int ) $ tenant ;
179187 }
180188
181189 /**
Original file line number Diff line number Diff line change @@ -1968,9 +1968,6 @@ public function testFindByInternalID(array $data): void
19681968 ]);
19691969
19701970 $ this ->assertEquals (1 , count ($ documents ));
1971-
1972- $ empty = new Document ();
1973- $ this ->assertEquals ('' , $ empty ->getSequence ());
19741971 }
19751972
19761973 public function testFindOrderBy (): void
Original file line number Diff line number Diff line change @@ -409,4 +409,12 @@ public function testGetArrayCopy(): void
409409 ], $ this ->document ->getArrayCopy ());
410410 $ this ->assertEquals ([], $ this ->empty ->getArrayCopy ());
411411 }
412+
413+ public function testEmptyDocumentSequence (): void
414+ {
415+ $ empty = new Document ();
416+
417+ $ this ->assertNull ($ empty ->getSequence ());
418+ $ this ->assertNotSame ('' , $ empty ->getSequence ());
419+ }
412420}
You can’t perform that action at this time.
0 commit comments