11<?php
2- declare (strict_types=1 );
3-
4- /*
5- * This file is part of JSON:API implementation for PHP.
2+ /**
3+ * This file is part of JSON:API implementation for PHP.
64 *
7- * (c) Alexey Karapetov <karapetov@gmail.com>
5+ * (c) Alexey Karapetov <karapetov@gmail.com>
86 *
9- * For the full copyright and license information, please view the LICENSE
10- * file that was distributed with this source code.
7+ * For the full copyright and license information, please view the LICENSE
8+ * file that was distributed with this source code.
119 */
10+ declare (strict_types=1 );
1211
13- namespace JsonApiPhp \JsonApi \ Document ;
12+ namespace JsonApiPhp \JsonApi ;
1413
14+ use JsonApiPhp \JsonApi \Document \Error ;
15+ use JsonApiPhp \JsonApi \Document \LinksTrait ;
16+ use JsonApiPhp \JsonApi \Document \Meta ;
17+ use JsonApiPhp \JsonApi \Document \MetaTrait ;
1518use JsonApiPhp \JsonApi \Document \Resource \ResourceInterface ;
1619use JsonApiPhp \JsonApi \Document \Resource \ResourceObject ;
1720
18- final class Document implements \JsonSerializable
21+ class Document implements \JsonSerializable
1922{
2023 const MEDIA_TYPE = 'application/vnd.api+json ' ;
2124 const DEFAULT_API_VERSION = '1.0 ' ;
@@ -33,10 +36,10 @@ private function __construct()
3336 {
3437 }
3538
36- public static function fromMeta (array $ meta ): self
39+ public static function fromMeta (Meta $ meta ): self
3740 {
3841 $ doc = new self ;
39- $ doc ->replaceMeta ($ meta );
42+ $ doc ->setMeta ($ meta );
4043 return $ doc ;
4144 }
4245
0 commit comments