@@ -168,42 +168,36 @@ public function hidePrivateMethods(): bool
168168 }
169169
170170 /**
171- * @return array <string>
171+ * @return list <string>
172172 */
173- public function fromClass (): array
173+ public function relTargetsFrom (): array
174174 {
175- if (!isset ($ this ->opt ['rel-target-from ' ])) {
176- return [];
175+ $ targets = [];
176+ if (isset ($ this ->opt ['rel-target-from ' ])) {
177+ $ targets = [...$ targets , ...explode (', ' , $ this ->opt ['rel-target-from ' ])];
177178 }
178-
179- return explode (', ' , $ this ->opt ['rel-target-from ' ]);
180- }
181-
182- /**
183- * @return array<string>
184- */
185- public function toClass (): array
186- {
187- if (!isset ($ this ->opt ['rel-target-to ' ])) {
188- return [];
179+ if (isset ($ this ->opt ['rel-target ' ])) {
180+ $ targets = [...$ targets , ...explode (', ' , $ this ->opt ['rel-target ' ])];
189181 }
190-
191- return explode (', ' , $ this ->opt ['rel-target-to ' ]);
182+ return array_values ($ targets );
192183 }
193184
194185 /**
195- * @return array <string>
186+ * @return list <string>
196187 */
197- public function targetClass (): array
188+ public function relTargetsTo (): array
198189 {
199- if (!isset ($ this ->opt ['rel-target ' ])) {
200- return [];
190+ $ targets = [];
191+ if (isset ($ this ->opt ['rel-target-to ' ])) {
192+ $ targets = [...$ targets , ...explode (', ' , $ this ->opt ['rel-target-to ' ])];
201193 }
202-
203- return explode (', ' , $ this ->opt ['rel-target ' ]);
194+ if (isset ($ this ->opt ['rel-target ' ])) {
195+ $ targets = [...$ targets , ...explode (', ' , $ this ->opt ['rel-target ' ])];
196+ }
197+ return array_values ($ targets );
204198 }
205199
206- public function depth (): int
200+ public function relTargetsDepth (): int
207201 {
208202 return (int ) ($ this ->opt ['rel-target-depth ' ] ?? PHP_INT_MAX );
209203 }
0 commit comments