summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src/Entity/Node.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/node/src/Entity/Node.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/node/src/Entity/Node.php')
-rw-r--r--core/modules/node/src/Entity/Node.php54
1 files changed, 27 insertions, 27 deletions
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index 263f7c8..c11a188 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -371,15 +371,15 @@ class Node extends ContentEntityBase implements NodeInterface {
->setTranslatable(TRUE)
->setRevisionable(TRUE)
->setSetting('max_length', 255)
- ->setDisplayOptions('view', array(
+ ->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'string',
'weight' => -5,
- ))
- ->setDisplayOptions('form', array(
+ ])
+ ->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -5,
- ))
+ ])
->setDisplayConfigurable('form', TRUE);
$fields['uid'] = BaseFieldDefinition::create('entity_reference')
@@ -389,20 +389,20 @@ class Node extends ContentEntityBase implements NodeInterface {
->setSetting('target_type', 'user')
->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId')
->setTranslatable(TRUE)
- ->setDisplayOptions('view', array(
+ ->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
- ))
- ->setDisplayOptions('form', array(
+ ])
+ ->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete',
'weight' => 5,
- 'settings' => array(
+ 'settings' => [
'match_operator' => 'CONTAINS',
'size' => '60',
'placeholder' => '',
- ),
- ))
+ ],
+ ])
->setDisplayConfigurable('form', TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
@@ -410,15 +410,15 @@ class Node extends ContentEntityBase implements NodeInterface {
->setDescription(t('The time that the node was created.'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
- ->setDisplayOptions('view', array(
+ ->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'timestamp',
'weight' => 0,
- ))
- ->setDisplayOptions('form', array(
+ ])
+ ->setDisplayOptions('form', [
'type' => 'datetime_timestamp',
'weight' => 10,
- ))
+ ])
->setDisplayConfigurable('form', TRUE);
$fields['changed'] = BaseFieldDefinition::create('changed')
@@ -432,13 +432,13 @@ class Node extends ContentEntityBase implements NodeInterface {
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDefaultValue(TRUE)
- ->setDisplayOptions('form', array(
+ ->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
- 'settings' => array(
+ 'settings' => [
'display_label' => TRUE,
- ),
+ ],
'weight' => 15,
- ))
+ ])
->setDisplayConfigurable('form', TRUE);
$fields['sticky'] = BaseFieldDefinition::create('boolean')
@@ -446,13 +446,13 @@ class Node extends ContentEntityBase implements NodeInterface {
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setDefaultValue(FALSE)
- ->setDisplayOptions('form', array(
+ ->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
- 'settings' => array(
+ 'settings' => [
'display_label' => TRUE,
- ),
+ ],
'weight' => 16,
- ))
+ ])
->setDisplayConfigurable('form', TRUE);
$fields['revision_timestamp'] = BaseFieldDefinition::create('created')
@@ -471,13 +471,13 @@ class Node extends ContentEntityBase implements NodeInterface {
->setDescription(t('Briefly describe the changes you have made.'))
->setRevisionable(TRUE)
->setDefaultValue('')
- ->setDisplayOptions('form', array(
+ ->setDisplayOptions('form', [
'type' => 'string_textarea',
'weight' => 25,
- 'settings' => array(
+ 'settings' => [
'rows' => 4,
- ),
- ));
+ ],
+ ]);
$fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Revision translation affected'))
@@ -498,7 +498,7 @@ class Node extends ContentEntityBase implements NodeInterface {
* An array of default values.
*/
public static function getCurrentUserId() {
- return array(\Drupal::currentUser()->id());
+ return [\Drupal::currentUser()->id()];
}
}