File tree Expand file tree Collapse file tree 2 files changed +65
-2
lines changed
Expand file tree Collapse file tree 2 files changed +65
-2
lines changed Original file line number Diff line number Diff line change 66use Symfony \Component \Serializer \Encoder \JsonDecode ;
77use Symfony \Component \Serializer \Encoder \JsonEncoder ;
88
9- abstract class EntityCollection implements \Iterator , \Countable
9+ abstract class EntityCollection implements EntityCollectionInterface , \Countable
1010{
1111 use CollectionRelLinkTrait;
1212
@@ -72,7 +72,7 @@ public function key()
7272 /**
7373 * {@inheritdoc}
7474 */
75- public function valid ()
75+ public function valid (): bool
7676 {
7777 return isset ($ this ->rawData ->list [$ this ->iteratorPosition ]);
7878 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Hussainweb \DrupalApi \Entity \Collection ;
4+
5+ /**
6+ * Interface representing a collection of entities loaded from drupal.org.
7+ */
8+ interface EntityCollectionInterface extends \Iterator
9+ {
10+
11+ /**
12+ * @return bool|\GuzzleHttp\Psr7\Uri
13+ */
14+ public function getSelfLink ();
15+
16+ /**
17+ * @return bool|\GuzzleHttp\Psr7\Uri
18+ */
19+ public function getFirstLink ();
20+
21+ /**
22+ * @return bool|\GuzzleHttp\Psr7\Uri
23+ */
24+ public function getPreviousLink ();
25+
26+ /**
27+ * @return bool|\GuzzleHttp\Psr7\Uri
28+ */
29+ public function getNextLink ();
30+
31+ /**
32+ * @return bool|\GuzzleHttp\Psr7\Uri
33+ */
34+ public function getLastLink ();
35+
36+ /**
37+ * {@inheritdoc}
38+ */
39+ public function current ();
40+
41+ /**
42+ * {@inheritdoc}
43+ */
44+ public function next ();
45+
46+ /**
47+ * {@inheritdoc}
48+ */
49+ public function key ();
50+
51+ /**
52+ * {@inheritdoc}
53+ */
54+ public function valid (): bool ;
55+
56+ /**
57+ * {@inheritdoc}
58+ *
59+ * If a collection does not support rewinding, implement this method with an
60+ * empty body.
61+ */
62+ public function rewind ();
63+ }
You can’t perform that action at this time.
0 commit comments