Actualización

This commit is contained in:
Xes
2025-04-10 12:36:07 +02:00
parent 1da7c3f3b9
commit 4aff98e77b
3147 changed files with 320647 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Class ImsLtiServiceRequestFactory.
*/
class ImsLtiServiceRequestFactory
{
/**
* @return ImsLtiServiceRequest|null
*/
public static function create(SimpleXMLElement $xml)
{
$bodyChildren = $xml->imsx_POXBody->children();
if (!empty($bodyChildren)) {
$name = $bodyChildren->getName();
switch ($name) {
case 'replaceResultRequest':
return new ImsLtiServiceReplaceRequest($xml);
case 'readResultRequest':
return new ImsLtiServiceReadRequest($xml);
case 'deleteResultRequest':
return new ImsLtiServiceDeleteRequest($xml);
default:
$name = str_replace(['ResultRequest', 'Request'], '', $name);
return new ImsLtiServiceUnsupportedRequest($xml, $name);
}
}
return null;
}
}