summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
diff options
context:
space:
mode:
authorxjm2017-03-03 19:20:24 -0600
committerxjm2017-03-03 19:20:24 -0600
commit52e3eec616efab4d5201e30d085a09ba5c4817e6 (patch)
treed295cc8b862edc04018ba0e04ded752fd1a2f5c6 /core/modules/rest/src/Plugin/rest/resource/EntityResource.php
parent3aba956a39a4852f42cad8483e4e6e307bedbd0e (diff)
Issue #2776975 by joelpittet, dawehner, tim.plunkett, xjm, pfrenssen: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase
Diffstat (limited to 'core/modules/rest/src/Plugin/rest/resource/EntityResource.php')
-rw-r--r--core/modules/rest/src/Plugin/rest/resource/EntityResource.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
index a66d5ab..a4162b5 100644
--- a/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/src/Plugin/rest/resource/EntityResource.php
@@ -184,7 +184,7 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
$this->validate($entity);
try {
$entity->save();
- $this->logger->notice('Created entity %type with ID %id.', array('%type' => $entity->getEntityTypeId(), '%id' => $entity->id()));
+ $this->logger->notice('Created entity %type with ID %id.', ['%type' => $entity->getEntityTypeId(), '%id' => $entity->id()]);
// 201 Created responses return the newly created entity in the response
// body. These responses are not cacheable, so we add no cacheability
@@ -296,7 +296,7 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
$this->validate($original_entity);
try {
$original_entity->save();
- $this->logger->notice('Updated entity %type with ID %id.', array('%type' => $original_entity->getEntityTypeId(), '%id' => $original_entity->id()));
+ $this->logger->notice('Updated entity %type with ID %id.', ['%type' => $original_entity->getEntityTypeId(), '%id' => $original_entity->id()]);
// Return the updated entity in the response body.
return new ModifiedResourceResponse($original_entity, 200);
@@ -324,7 +324,7 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
}
try {
$entity->delete();
- $this->logger->notice('Deleted entity %type with ID %id.', array('%type' => $entity->getEntityTypeId(), '%id' => $entity->id()));
+ $this->logger->notice('Deleted entity %type with ID %id.', ['%type' => $entity->getEntityTypeId(), '%id' => $entity->id()]);
// DELETE responses have an empty body.
return new ModifiedResourceResponse(NULL, 204);
@@ -376,7 +376,7 @@ class EntityResource extends ResourceBase implements DependentPluginInterface {
$route = parent::getBaseRoute($canonical_path, $method);
$definition = $this->getPluginDefinition();
- $parameters = $route->getOption('parameters') ?: array();
+ $parameters = $route->getOption('parameters') ?: [];
$parameters[$definition['entity_type']]['type'] = 'entity:' . $definition['entity_type'];
$route->setOption('parameters', $parameters);