File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Laravel GitScrum <https://github.com/GitScrum-Community/laravel-gitscrum>
4+ *
5+ * The MIT License (MIT)
6+ * Copyright (c) 2017 Renato Marinho <renato.marinho@s2move.com>
7+ */
8+
9+ namespace GitScrum \Serializers ;
10+
11+ use League \Fractal \Serializer \ArraySerializer ;
12+
13+ class CustomSerializer extends ArraySerializer
14+ {
15+ /**
16+ * Serialize a collection.
17+ *
18+ * @param string $resourceKey
19+ * @param array $data
20+ *
21+ * @return array
22+ */
23+ public function collection ($ resourceKey , array $ data ): array
24+ {
25+ return $ data ;
26+ }
27+ /**
28+ * Serialize an item.
29+ *
30+ * @param string $resourceKey
31+ * @param array $data
32+ *
33+ * @return array
34+ */
35+ public function item ($ resourceKey , array $ data ): array
36+ {
37+ return $ data ;
38+ }
39+ /**
40+ * Serialize null resource.
41+ *
42+ * @return array
43+ */
44+ public function null (): array
45+ {
46+ return [];
47+ }
48+ }
You can’t perform that action at this time.
0 commit comments