Skip to content

Commit b68d392

Browse files
committed
separate API from implementation
1 parent fd3d598 commit b68d392

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+224
-3302
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,3 @@ install:
3434

3535
script:
3636
- vendor/bin/phpspec run
37-
- if [[ "$xdebug" = "yes" ]]; then phpunit --coverage-clover=coverage.clover; else phpunit; fi
38-
- if [[ "$xdebug" = "yes" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
39-
- if [[ "$xdebug" = "yes" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

CHANGELOG.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,34 @@ CHANGELOG
44
0.4.0
55
-----
66

7-
* Added a `SerializerFactoryInterface` with a default implementation in
8-
`SerializerFactory` that abstracts the creation of serializer instances.
7+
* The serializer implementation has been separated from its API definition.
8+
This package now no longer ships with an implementation.
9+
10+
The Symfony Serializer component integration has been moved to the separate
11+
[php-xapi/symfony-serializer package](https://github.com/php-xapi/symfony-serializer).
12+
13+
A default implementation of the `SerializerRegistryInterface` is still part
14+
of the `php-xapi/serializer` package though.
15+
16+
This package ships with the following interfaces that must be implemented
17+
by packages that want to provide the xAPI serialization functionality:
18+
19+
* `ActorSerializerInterface`
20+
* `DocumentDataSerializerInterface`
21+
* `StatementResultSerializerInterface`
22+
* `StatementSerializerInterface`
23+
* `StatementFactoryInterface`
24+
25+
Implementors of the API provided by this package are advised to add the
26+
`php-xapi/serializer-implementation` package to the `provide` section of
27+
their `composer.json` file.
28+
29+
The `Tests` subnamespace of this package contains a set of base abstract
30+
PHPUnit test classes integrators can use to make sure that their implementation
31+
adheres to the API specified by the `php-xapi/serializer` package.
32+
33+
* Added a `SerializerFactoryInterface` that abstracts the creation of serializer
34+
instances.
935

1036
* The `SerializerRegistry` class is now final. If you need custom behavior
1137
inside the serializer registry, create your own implementation of the

UPGRADE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ UPGRADE
44
Upgrading from 0.3 to 0.4
55
-------------------------
66

7+
* The serializer implementation has been separated from its API definition.
8+
This package now no longer ships with an implementation.
9+
10+
The Symfony Serializer component integration has been moved to the separate
11+
[php-xapi/symfony-serializer package](https://github.com/php-xapi/symfony-serializer).
12+
13+
A default implementation of the `SerializerRegistryInterface` is still part
14+
of the `php-xapi/serializer` package though.
15+
16+
This package ships with the following interfaces that must be implemented
17+
by packages that want to provide the xAPI serialization functionality:
18+
19+
* `ActorSerializerInterface`
20+
* `DocumentDataSerializerInterface`
21+
* `StatementResultSerializerInterface`
22+
* `StatementSerializerInterface`
23+
* `StatementFactoryInterface`
24+
25+
Implementors of the API provided by this package are advised to add the
26+
`php-xapi/serializer-implementation` package to the `provide` section of
27+
their `composer.json` file.
28+
29+
The `Tests` subnamespace of this package contains a set of base abstract
30+
PHPUnit test classes integrators can use to make sure that their implementation
31+
adheres to the API specified by the `php-xapi/serializer` package.
32+
733
* The `SerializerRegistry` class is now final. If you need custom behavior
834
inside the serializer registry, create your own implementation of the
935
`SerializerRegistryInterface`.

composer.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,20 @@
1313
],
1414
"require": {
1515
"php": ">=5.3.0",
16+
"php-xapi/json-test-fixtures": "^0.2.3",
1617
"php-xapi/model": "^0.5.0",
17-
"symfony/serializer": "~2.8|~3.0"
18+
"php-xapi/test-fixtures": "^0.5.0"
1819
},
1920
"require-dev": {
20-
"php-xapi/json-test-fixtures": "^0.2.3",
21-
"php-xapi/test-fixtures": "^0.5.0",
2221
"phpspec/phpspec": "^2.3"
2322
},
2423
"conflict": {
2524
"xabbuh/xapi-serializer": "*"
2625
},
2726
"autoload": {
2827
"psr-4": {
29-
"Xabbuh\\XApi\\Serializer\\": "src/"
30-
}
31-
},
32-
"autoload-dev": {
33-
"psr-4": {
28+
"spec\\Xabbuh\\XApi\\Serializer\\": "spec/",
29+
"Xabbuh\\XApi\\Serializer\\": "src/",
3430
"Xabbuh\\XApi\\Serializer\\Tests\\": "tests/"
3531
}
3632
},

phpunit.xml.dist

Lines changed: 0 additions & 18 deletions
This file was deleted.

spec/Normalizer/AccountNormalizerSpec.php

Lines changed: 0 additions & 40 deletions
This file was deleted.

spec/Normalizer/ActorNormalizerSpec.php

Lines changed: 0 additions & 63 deletions
This file was deleted.

spec/Normalizer/AttachmentNormalizerSpec.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

spec/Normalizer/DefinitionNormalizerSpec.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

spec/Normalizer/DocumentDataNormalizerSpec.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)