Data manipulation #22

Merged
c.fahner merged 7 commits from issues/3 into main 2026-08-22 09:46:17 +02:00
Owner

Resolves #3.

Adds MutableDocument.
Adds Update (+ implementations), Update\Visitor, Update\DocumentUpdate (query builder)

Resolves #3. Adds MutableDocument. Adds Update (+ implementations), Update\Visitor, Update\DocumentUpdate (query builder)
c.fahner added this to the v0.1 milestone 2026-08-21 20:57:03 +02:00
@ -0,0 +43,4 @@
#[Override]
public function offsetSet(mixed $offset, mixed $value): void {
if ($offset === null) {
throw new LogicException('Expected offset to be a non-empty string');
Author
Owner

Message should say appending is not possible

Message should say appending is not possible
c.fahner marked this conversation as resolved
@ -0,0 +13,4 @@
* @author C. Fahner
* @copyright Slendium 2026
*/
final class MutableDocumentTest extends TestCase {
Author
Owner

Add test to ensure appending throws

Add test to ensure appending throws
c.fahner marked this conversation as resolved
@ -0,0 +21,4 @@
public FieldPath $field,
/** @since 1.0 */
public float|int $amount = 1,
Author
Owner

Should not have a default value

Should not have a default value
c.fahner marked this conversation as resolved
@ -0,0 +21,4 @@
public FieldPath $field,
/** @since 1.0 */
public float|int $amount = 1,
Author
Owner

Should not have a default value. Besides, a default value of 1 for multiplication does not make sense since it's a no-op.

Should not have a default value. Besides, a default value of 1 for multiplication does not make sense since it's a no-op.
c.fahner marked this conversation as resolved
@ -0,0 +90,4 @@
$result = \count($sut);
$iterations = 0;
foreach ($sut as $_) {
Author
Owner

Add an assertion that checks if the key exists in $values.

Add an assertion that checks if the key exists in `$values`.
c.fahner marked this conversation as resolved
@ -0,0 +16,4 @@
*/
final class VisitorTest extends TestCase {
public function test_interface_shouldCoverAllExprs(): void {
Author
Owner

_shouldCoverAllStmts

`_shouldCoverAllStmts`
c.fahner marked this conversation as resolved
@ -0,0 +29,4 @@
foreach ($method->getParameters() as $i => $parameter) {
$type = $parameter->getType();
$this->assertInstanceOf(ReflectionNamedType::class, $type);
$this->assertTrue(isset($variants[$type->getName()]), "Visitor interface contains method for non-existant expression $type");
Author
Owner

"expression""statement"

`"expression"` → `"statement"`
c.fahner marked this conversation as resolved
c.fahner added spent time 2026-08-22 07:47:45 +02:00
15 minutes
* Renamed test that referenced "expressions" instead of "statements"
* Changed exception message to reference "statements" instead of "expressions"
Added some assertions to guarantee field names are iterated correctly
Removed default values for the 'amount' property
Adds test to ensure appending to the document throws
Changed the exception message for when attempting to append the document
c.fahner deleted branch issues/3 2026-08-22 09:46:17 +02:00
c.fahner referenced this pull request from a commit 2026-08-22 09:46:19 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 15 minutes
c.fahner
15 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
slendium/ocd!22
No description provided.