Skip to content

Commit 3dc93a2

Browse files
avvertixgithub-actions[bot]
authored andcommitted
Fix styling
1 parent 7aa4673 commit 3dc93a2

2 files changed

Lines changed: 24 additions & 26 deletions

File tree

src/DocumentFormat/DocumentNode.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ public function toArray(): array
9797
return [
9898
'category' => 'doc',
9999
'attributes' => null,
100-
'content' => $this->content
100+
'content' => $this->content,
101101
];
102102
}
103-
103+
104104
/**
105105
* Return a JSON serialization of the document node
106106
*/
@@ -115,7 +115,6 @@ public function jsonSerialize(): mixed
115115
return $this->toArray();
116116
}
117117

118-
119118
/**
120119
* Create a document node from associative array
121120
*/
@@ -154,10 +153,10 @@ public static function fromString(string $data): DocumentNode
154153
'content' => $data,
155154
'marks' => [],
156155
'attributes' => [],
157-
]
158-
]
159-
]
160-
]
156+
],
157+
],
158+
],
159+
],
161160
]);
162161
}
163162
}

tests/DocumentNodeTest.php

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use OneOffTech\Parse\Client\Exceptions\InvalidDocumentFormatException;
66

77
test('node created from string', function () {
8-
8+
99
$document = DocumentNode::fromString('test content');
1010

1111
expect($document)
@@ -45,10 +45,10 @@
4545
'content' => 'This is the page one text',
4646
'marks' => [],
4747
'attributes' => [],
48-
]
49-
]
50-
]
51-
]
48+
],
49+
],
50+
],
51+
],
5252
]);
5353

5454
expect($document)
@@ -91,10 +91,10 @@
9191
'content' => 'This is the page one text',
9292
'marks' => [],
9393
'attributes' => [],
94-
]
95-
]
96-
]
97-
]
94+
],
95+
],
96+
],
97+
],
9898
]);
9999

100100
})->throws(InvalidDocumentFormatException::class, 'Unexpected document structure. Missing category or content.');
@@ -124,10 +124,10 @@
124124
'content' => 'This is the page one text',
125125
'marks' => [],
126126
'attributes' => [],
127-
]
128-
]
129-
]
130-
]
127+
],
128+
],
129+
],
130+
],
131131
]);
132132

133133
})->throws(InvalidDocumentFormatException::class, 'Unexpected node category. Expecting [doc] found [something].');
@@ -136,12 +136,11 @@
136136
DocumentNode::fromArray([
137137
'category' => 'doc',
138138
'attributes' => null,
139-
'content' => 'a string'
139+
'content' => 'a string',
140140
]);
141141

142142
})->throws(InvalidDocumentFormatException::class, 'Unexpected content format. Expecting [array].');
143143

144-
145144
test('can be serialized in json', function () {
146145

147146
$expectedContent = [
@@ -160,10 +159,10 @@
160159
'content' => 'This is the page one text',
161160
'marks' => [],
162161
'attributes' => [],
163-
]
164-
]
165-
]
166-
]
162+
],
163+
],
164+
],
165+
],
167166
];
168167

169168
$document = DocumentNode::fromArray($expectedContent);

0 commit comments

Comments
 (0)