Skip to content

Commit b1e63d5

Browse files
author
Mohamed Khaled
committed
Fix duplicate meetsRequirements() method after rebase
Remove duplicate method declaration that was causing fatal error. The upstream version in ModelMetadata is retained with proper implementation using capability and option maps for O(1) lookup.
1 parent 63fe203 commit b1e63d5

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/Providers/Models/DTO/ModelMetadata.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -244,42 +244,6 @@ public function toArray(): array
244244
];
245245
}
246246

247-
/**
248-
* Checks whether this model meets the specified requirements.
249-
*
250-
* @since n.e.x.t
251-
*
252-
* @param ModelRequirements $requirements The requirements to check against.
253-
* @return bool True if the model meets all requirements, false otherwise.
254-
*/
255-
public function meetsRequirements(ModelRequirements $requirements): bool
256-
{
257-
// Check if all required capabilities are supported using map lookup
258-
foreach ($requirements->getRequiredCapabilities() as $requiredCapability) {
259-
if (!isset($this->capabilitiesMap[$requiredCapability->value])) {
260-
return false;
261-
}
262-
}
263-
264-
// Check if all required options are supported with the specified values
265-
foreach ($requirements->getRequiredOptions() as $requiredOption) {
266-
// Use map lookup instead of linear search
267-
if (!isset($this->optionsMap[$requiredOption->getName()])) {
268-
return false;
269-
}
270-
271-
$supportedOption = $this->optionsMap[$requiredOption->getName()];
272-
273-
// Check if the required value is supported by this option
274-
if (!$supportedOption->isSupportedValue($requiredOption->getValue())) {
275-
return false;
276-
}
277-
}
278-
279-
return true;
280-
}
281-
282-
283247
/**
284248
* {@inheritDoc}
285249
*

0 commit comments

Comments
 (0)