5.5 KiB
UPGRADE
Upgrading from 2.x to 3.0
- The
Objectclass has been renamed toStatementObject.
Upgrading from 1.x to 2.0
- The
StatementsFilter::format(),StatementsFilter::includeAttachments(), andStatementsFilter::excludeAttachments()methods have been removed.
Upgrading from 1.0 to 1.1
-
The
StatementsFilter::format(),StatementsFilter::includeAttachments(), andStatementsFilter::excludeAttachments()methods are deprecated and will be removed in 2.0. -
Constructing an
Attachmentinstance with specifying neither a file URL nor the raw attachment content throws an\InvalidArgumentException.
Upgrading from 0.4 to 0.5
-
The type of the following properties has been changed from
stringto instances of the newIRIclass:Activity::$idAttachment::$usageTypeDefinition::$typeInverseFunctionalIdentifier::$mboxVerb::$id
Type hints of respective methods have been updated accordingly.
-
The type of the following properties has been changed from
stringto instances of the newIRLclass:Account::$homePageAttachment::$fileUrlDefinition::$moreInfoStatementResult::$moreUrlPath
Type hints of respective methods have been updated accordingly.
-
The
$displayproperty of theVerbclass as well as the$nameand$descriptionproperties of theDefinitionclass are no longer plain PHP arrays, but are now instances ofLanguageMap. -
Statement ids are no longer plain strings, but are
StatementIdvalue objects:Before:
// passing an id to the Statement constructor $statement = new Statement('16fd2706-8baf-433b-82eb-8c7fada847da', ...); // building a new statement based on an existing one with a different id $statement = $statement->withId('39e24cc4-69af-4b01-a824-1fdc6ea8a3af'); // reference another statement with its id $statementRef = new StatementReference('16fd2706-8baf-433b-82eb-8c7fada847da');After:
// passing an id to the Statement constructor $statement = new Statement(StatementId::fromString('16fd2706-8baf-433b-82eb-8c7fada847da'), ...); // building a new statement based on an existing one with a different id $statement = $statement->withId(StatementId::fromString('39e24cc4-69af-4b01-a824-1fdc6ea8a3af')); // reference another statement with its id $statementRef = new StatementReference(StatementId::fromString('16fd2706-8baf-433b-82eb-8c7fada847da')); -
The constructor of the
SubStatementclass now throws an exception when aSubStatementinstance is passed as the$objectargument to comply with the Experience API spec which does not allow to nest sub statements. -
The
$idattribute has been removed from theSubStatementclass. Also, the$idargument of the class constructor has been removed respectively. The first constructor argument is now the sub statement's actor. -
The
getStatementReference()andgetVoidStatement()methods have been removed from theSubStatementclass as they are not usable without an id.
Upgrading from 0.3 to 0.4
- The argument type of the
equals()method in theActorbase class was changed fromActortoObjectto be compatible with the same method from the parentObjectclass.
Upgrading from 0.2 to 0.3
- The default value of the
displayproperty of theVerbclass was changed tonull(was the empty array before).
Upgrading from 0.2.0 to 0.2.1
- Data passed to the
Scoreclass during construction is no longer cast tofloatvalues to ensure that integers are not needlessly cast. You need to make sure to always pass the expected data types when buildScoreobjects.
Upgrading from 0.1 to 0.2
-
the getter methods to retrieve the inverse functional identifier properties
mbox,mboxsha1sum,openid, andaccounthave been removed from theActorclass -
the
getInverseFunctionalIdentifier()method in theActorclass no longer returns a string, but returns anInverseFunctionalIdentifierinstance instead -
A new class
InverseFunctionalIdentifierwas introduced to reflect the inverse functional identifier of an actor. It reflects the fact that an IRI must only contain exactly one property ofmbox,mboxsha1sum,openid, andaccountby providing four factory methods to obtain an IRI instance:-
withMbox() -
withMboxSha1Sum() -
withOpenId() -
withAccount()
You now need to pass an
InverseFunctionalIdentifierwhen creating an actor or group.Before:
use Xabbuh\XApi\Model\Agent; use Xabbuh\XApi\Model\Group; $agent = new Agent( 'mailto:christian@example.com', null, null, null, 'Christian' ); $group = new Group( null, null, null, new Account('GroupAccount', 'http://example.com/homePage'), 'Example Group' );After:
use Xabbuh\XApi\Model\Agent; use Xabbuh\XApi\Model\Group; use Xabbuh\XApi\Model\InverseFunctionalIdentifier; $agent = new Agent( InverseFunctionalIdentifier::withMbox('mailto:christian@example.com'), 'Christian' ); $group = new Group( InverseFunctionalIdentifier::withAccount( new Account('GroupAccount', 'http://example.com/homePage') ), 'Example Group' ); -
-
The
Statementclass is now marked as final. This means that you can no longer extend it.