Skip to content

Commit 0ff5d82

Browse files
committed
The String class is not suported in PHP 7.
Refactor String Class to Str Class to prevent conflict with reserve keys in PHP 7
1 parent a239144 commit 0ff5d82

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

src/Account.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class Account extends Element {
44
protected $props = [
55
'homePage' => 'Locker\XApi\IRI',
6-
'name' => 'Locker\XApi\String',
6+
'name' => 'Locker\XApi\Str',
77
];
88
protected $required_props = ['homePage', 'name'];
99
}

src/Agent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Agent extends Element {
66
use TypedElement;
77

88
protected $props = [
9-
'name' => 'Locker\XApi\String',
9+
'name' => 'Locker\XApi\Str',
1010
'mbox' => 'Locker\XApi\Mailto',
1111
'mbox_sha1sum' => 'Locker\XApi\Sha1',
1212
'openid' => 'Locker\XApi\IRI',

src/Attachment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Attachment extends Element {
77
'description' => 'Locker\XApi\LanguageMap',
88
'contentType' => 'Locker\XApi\IMT',
99
'length' => 'Locker\XApi\Integer',
10-
'sha2' => 'Locker\XApi\String',
10+
'sha2' => 'Locker\XApi\Str',
1111
'fileUrl' => 'Locker\XApi\IRI'
1212
];
1313
protected $required_props = ['usageType', 'display', 'contentType', 'length', 'sha2'];

src/Context.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ class Context extends Element {
66
'instructor' => 'Locker\XApi\Actor',
77
'team' => 'Locker\XApi\Group',
88
'contextActivities' => 'Locker\XApi\ContextActivities',
9-
'revision' => 'Locker\XApi\String',
10-
'platform' => 'Locker\XApi\String',
9+
'revision' => 'Locker\XApi\Str',
10+
'platform' => 'Locker\XApi\Str',
1111
'language' => 'Locker\XApi\Language',
1212
'statement' => 'Locker\XApi\StatementRef',
1313
'extensions' => 'Locker\XApi\Extensions'

src/InteractionComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class InteractionComponent extends Element {
44
protected $props = [
5-
'id' => 'Locker\XApi\String',
5+
'id' => 'Locker\XApi\Str',
66
'description' => 'Locker\XApi\LanguageMap'
77
];
88
}

src/LanguageMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function validate() {
1111
$errors = array_merge($errors, (new Language($set_prop))->validate());
1212
$errors = array_merge($errors, array_map(function ($error) use ($set_prop) {
1313
return $error->addTrace($set_prop);
14-
}, (new String($this->value->{$set_prop}))->validate()));
14+
}, (new Str($this->value->{$set_prop}))->validate()));
1515
}
1616
return array_merge($errors, parent::validate());
1717
}

src/ObjectDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class ObjectDefinition extends Definition {
44
protected $props = [
55
'interactionType' => 'Locker\XApi\InteractionType',
6-
'correctResponsesPattern' => 'Locker\XApi\Strings',
6+
'correctResponsesPattern' => 'Locker\XApi\Strs',
77
'choices' => 'Locker\XApi\InteractionComponents',
88
'scale' => 'Locker\XApi\InteractionComponents',
99
'source' => 'Locker\XApi\InteractionComponents',

src/Result.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Result extends Element {
55
'score' => 'Locker\XApi\Score',
66
'success' => 'Locker\XApi\Boolean',
77
'completion' => 'Locker\XApi\Boolean',
8-
'response' => 'Locker\XApi\String',
8+
'response' => 'Locker\XApi\Str',
99
'duration' => 'Locker\XApi\Duration',
1010
'extensions' => 'Locker\XApi\Extensions',
1111
];
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php namespace Locker\XApi;
22

3-
class String extends TypedAtom {
3+
class Str extends TypedAtom {
44
protected static $expected_types = ['string'];
55
}

src/Strings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php namespace Locker\XApi;
22

33
class Strings extends Collection {
4-
protected $member_type = 'Locker\XApi\String';
4+
protected $member_type = 'Locker\XApi\Str';
55
}

0 commit comments

Comments
 (0)