diff --git a/core/modules/rest/src/LinkManager/CollectionLinkManager.php b/core/modules/rest/src/LinkManager/CollectionLinkManager.php index 79c8747..2b3ff99 100644 --- a/core/modules/rest/src/LinkManager/CollectionLinkManager.php +++ b/core/modules/rest/src/LinkManager/CollectionLinkManager.php @@ -16,7 +16,8 @@ class CollectionLinkManager implements CollectionLinkManagerInterface { */ public function getCollectionItemRelation($collection_id) { // By default, use the item IANA Link Relation, which is a generic way to - // link to items from a collection. See http://tools.ietf.org/html/rfc6573. + // link to items from a collection. + // @see http://tools.ietf.org/html/rfc6573. return 'item'; } diff --git a/core/modules/rest/src/LinkManager/CollectionLinkManagerInterface.php b/core/modules/rest/src/LinkManager/CollectionLinkManagerInterface.php index 2713f6b..1e4be98 100644 --- a/core/modules/rest/src/LinkManager/CollectionLinkManagerInterface.php +++ b/core/modules/rest/src/LinkManager/CollectionLinkManagerInterface.php @@ -13,7 +13,7 @@ interface CollectionLinkManagerInterface { /** - * Get link relating collection to item. + * Get link relations to items in a collection. * * @param string $collection_id * The identifier of a collection (e.g. View name). diff --git a/core/modules/rest/src/Plugin/views/style/Serializer.php b/core/modules/rest/src/Plugin/views/style/Serializer.php index c3f823f..68ba03a 100644 --- a/core/modules/rest/src/Plugin/views/style/Serializer.php +++ b/core/modules/rest/src/Plugin/views/style/Serializer.php @@ -53,7 +53,7 @@ class Serializer extends StylePluginBase { * * @var array */ - protected $formats = array(); + protected $formats = []; /** * The URL generator service. @@ -186,14 +186,14 @@ public function getCollection() { // Inject the page into the canonical URI of the view. if ($this->view->getCurrentPage() > 0) { - $uri = $this->urlGenerator->generateFromRoute($route_name, array(), array('query' => array('page' => $this->view->getCurrentPage()), 'absolute' => TRUE)); + $uri = $this->urlGenerator->generateFromRoute($route_name, [], array('query' => array('page' => $this->view->getCurrentPage()), 'absolute' => TRUE)); } else { - $uri = $this->urlGenerator->generateFromRoute($route_name, array(), array('absolute' => TRUE)); + $uri = $this->urlGenerator->generateFromRoute($route_name, [], array('absolute' => TRUE)); } $collection->setUri($uri); - $rows = array(); + $rows = []; foreach ($this->view->result as $row) { $rows[] = $this->view->rowPlugin->render($row); } @@ -209,14 +209,14 @@ public function getCollection() { // Starting at page=0 we need to decrement. $total = ceil($pager->getTotalItems() / $pager->getItemsPerPage()) - 1; - $collection->setLink('first', $this->urlGenerator->generateFromRoute($route_name, array(), array( + $collection->setLink('first', $this->urlGenerator->generateFromRoute($route_name, [], array( 'query' => array('page' => 0), 'absolute' => TRUE, ))); // If we are not on the first page add a previous link. if ($current_page > 0) { - $collection->setLink('prev', $this->urlGenerator->generateFromRoute($route_name, array(), array( + $collection->setLink('prev', $this->urlGenerator->generateFromRoute($route_name, [], array( 'query' => array('page' => $current_page - 1), 'absolute' => TRUE, ))); @@ -224,13 +224,13 @@ public function getCollection() { // If we are not on the last page add a next link. if ($current_page < $total) { - $collection->setLink('next', $this->urlGenerator->generateFromRoute($route_name, array(), array( + $collection->setLink('next', $this->urlGenerator->generateFromRoute($route_name, [], array( 'query' => array('page' => $current_page + 1), 'absolute' => TRUE, ))); } - $collection->setLink('last', $this->urlGenerator->generateFromRoute($route_name, array(), array( + $collection->setLink('last', $this->urlGenerator->generateFromRoute($route_name, [], array( 'query' => array('page' => $total), 'absolute' => TRUE, ))); diff --git a/core/modules/serialization/src/Collection.php b/core/modules/serialization/src/Collection.php index 451af3d..e3fd9aa 100644 --- a/core/modules/serialization/src/Collection.php +++ b/core/modules/serialization/src/Collection.php @@ -23,7 +23,7 @@ class Collection implements \IteratorAggregate { * * @var array */ - protected $items; + protected $items = []; /** * The title of the collection. @@ -51,7 +51,7 @@ class Collection implements \IteratorAggregate { * * @var array */ - protected $links = array(); + protected $links = []; /** * Constructor.