Skip to content
Snippets Groups Projects
Commit 212652a3 authored by yas's avatar yas
Browse files

Converted the array syntax from array(...) to [...]

parent 0cea8eb8
No related branches found
No related tags found
No related merge requests found
Showing
with 395 additions and 395 deletions
...@@ -28,10 +28,10 @@ class CloudServerTemplateController extends ControllerBase { ...@@ -28,10 +28,10 @@ class CloudServerTemplateController extends ControllerBase {
debug('CloudServerTemplateController::getCloudServerTemplateList()'); debug('CloudServerTemplateController::getCloudServerTemplateList()');
return array( return [
'#type' => 'markup', '#type' => 'markup',
'#markup' => t('THIS IS A DEBUG MESSAGE at CloudServerTemplateController::getCloudServerTemplateList()'), '#markup' => t('THIS IS A DEBUG MESSAGE at CloudServerTemplateController::getCloudServerTemplateList()'),
); ];
/** /**
* @TODO: * @TODO:
......
...@@ -24,17 +24,17 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder { ...@@ -24,17 +24,17 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
array('data' => t('Name'), 'specifier' => 'name'), ['data' => t('Name'), 'specifier' => 'name'],
array('data' => t('Description'), 'specifier' => 'description'), ['data' => t('Description'), 'specifier' => 'description'],
array('data' => t('Instance Type'), 'specifier' => 'instance_type'), ['data' => t('Instance Type'), 'specifier' => 'instance_type'],
array('data' => t('Count'), 'specifier' => 'instance_count'), ['data' => t('Count'), 'specifier' => 'instance_count'],
array('data' => t('Date Created'), 'specifier' => 'created'), ['data' => t('Date Created'), 'specifier' => 'created'],
array('data' => t('Date Updated'), 'specifier' => 'changed', 'sort' => 'DESC'), ['data' => t('Date Updated'), 'specifier' => 'changed', 'sort' => 'DESC'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
...@@ -50,11 +50,11 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder { ...@@ -50,11 +50,11 @@ class CloudServerTemplateListBuilder extends CloudContentListBuilder {
$row['name'] = \Drupal::l( $row['name'] = \Drupal::l(
$this->getLabel($entity), $this->getLabel($entity),
new Url( new Url(
'entity.cloud_server_template.canonical', array( 'entity.cloud_server_template.canonical', [
'cloud_server_template' => $entity->id(), 'cloud_server_template' => $entity->id(),
// Need to add. // Need to add.
'cloud_context' => $entity->cloud_context(), 'cloud_context' => $entity->cloud_context(),
) ]
) )
); );
$row['description'] = $entity->description(); $row['description'] = $entity->description();
......
...@@ -58,9 +58,9 @@ class CloudServerTemplate extends ContentEntityBase implements CloudServerTempla ...@@ -58,9 +58,9 @@ class CloudServerTemplate extends ContentEntityBase implements CloudServerTempla
*/ */
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) { public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values); parent::preCreate($storage_controller, $values);
$values += array( $values += [
'user_id' => \Drupal::currentUser()->id(), 'user_id' => \Drupal::currentUser()->id(),
); ];
} }
/** /**
...@@ -215,16 +215,16 @@ class CloudServerTemplate extends ContentEntityBase implements CloudServerTempla ...@@ -215,16 +215,16 @@ class CloudServerTemplate extends ContentEntityBase implements CloudServerTempla
$fields['name'] = BaseFieldDefinition::create('string') $fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name')) ->setLabel(t('Name'))
->setDescription(t('The name of the cloud server templates entity.')) ->setDescription(t('The name of the cloud server templates entity.'))
->setSettings(array( ->setSettings([
'default_value' => '', 'default_value' => '',
'max_length' => 255, 'max_length' => 255,
'text_processing' => 0, 'text_processing' => 0,
)) ])
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'above', 'label' => 'above',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
/* /*
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'string_textfield', 'type' => 'string_textfield',
...@@ -291,21 +291,21 @@ class CloudServerTemplate extends ContentEntityBase implements CloudServerTempla ...@@ -291,21 +291,21 @@ class CloudServerTemplate extends ContentEntityBase implements CloudServerTempla
->setSetting('handler', 'default') ->setSetting('handler', 'default')
->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId') ->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId')
->setTranslatable(TRUE) ->setTranslatable(TRUE)
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'hidden', 'label' => 'hidden',
'type' => 'author', 'type' => 'author',
'weight' => 0, 'weight' => 0,
)) ])
->setDisplayOptions('form', array( ->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete', 'type' => 'entity_reference_autocomplete',
'weight' => 5, 'weight' => 5,
'settings' => array( 'settings' => [
'match_operator' => 'CONTAINS', 'match_operator' => 'CONTAINS',
'size' => '60', 'size' => '60',
'autocomplete_type' => 'tags', 'autocomplete_type' => 'tags',
'placeholder' => '', 'placeholder' => '',
), ],
)) ])
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
......
...@@ -17,11 +17,11 @@ class CloudServerTemplateViewsData extends EntityViewsData implements EntityView ...@@ -17,11 +17,11 @@ class CloudServerTemplateViewsData extends EntityViewsData implements EntityView
public function getViewsData() { public function getViewsData() {
$data = parent::getViewsData(); $data = parent::getViewsData();
$data['cloud_server_template']['table']['base'] = array( $data['cloud_server_template']['table']['base'] = [
'field' => 'id', 'field' => 'id',
'title' => t('Cloud Server Template'), 'title' => t('Cloud Server Template'),
'help' => t('The cloud_server_template entity ID.'), 'help' => t('The cloud_server_template entity ID.'),
); ];
return $data; return $data;
} }
......
...@@ -21,9 +21,9 @@ class CloudServerTemplateDeleteForm extends ContentEntityConfirmFormBase { ...@@ -21,9 +21,9 @@ class CloudServerTemplateDeleteForm extends ContentEntityConfirmFormBase {
*/ */
public function getQuestion() { public function getQuestion() {
$entity = $this->entity; $entity = $this->entity;
return t('Are you sure you want to delete entity %name?', array( return t('Are you sure you want to delete entity %name?', [
'%name' => $entity->label(), '%name' => $entity->label(),
)); ]);
} }
/** /**
......
...@@ -27,7 +27,7 @@ class CloudServerTemplateEditForm extends CloudContentForm { ...@@ -27,7 +27,7 @@ class CloudServerTemplateEditForm extends CloudContentForm {
$form = parent::buildForm($form, $form_state); $form = parent::buildForm($form, $form_state);
$entity = $this->entity; $entity = $this->entity;
$form['name'] = array( $form['name'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Name'), '#title' => $this->t('Name'),
'#maxlength' => 255, '#maxlength' => 255,
...@@ -35,9 +35,9 @@ class CloudServerTemplateEditForm extends CloudContentForm { ...@@ -35,9 +35,9 @@ class CloudServerTemplateEditForm extends CloudContentForm {
'#default_value' => $entity->label(), '#default_value' => $entity->label(),
'#required' => TRUE, '#required' => TRUE,
'#weight' => -5, '#weight' => -5,
); ];
$form['cloud_context'] = array( $form['cloud_context'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Cloud ID'), '#title' => $this->t('Cloud ID'),
'#maxlength' => 255, '#maxlength' => 255,
...@@ -48,9 +48,9 @@ class CloudServerTemplateEditForm extends CloudContentForm { ...@@ -48,9 +48,9 @@ class CloudServerTemplateEditForm extends CloudContentForm {
'#required' => TRUE, '#required' => TRUE,
'#weight' => -5, '#weight' => -5,
'#disabled' => TRUE, '#disabled' => TRUE,
); ];
$form['description'] = array( $form['description'] = [
'#type' => 'textarea', '#type' => 'textarea',
'#title' => $this->t('Description'), '#title' => $this->t('Description'),
'#cols' => 60, '#cols' => 60,
...@@ -58,9 +58,9 @@ class CloudServerTemplateEditForm extends CloudContentForm { ...@@ -58,9 +58,9 @@ class CloudServerTemplateEditForm extends CloudContentForm {
'#default_value' => $entity->description(), '#default_value' => $entity->description(),
'#weight' => -5, '#weight' => -5,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['instance_type'] = array( $form['instance_type'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Instance Type'), '#title' => $this->t('Instance Type'),
'#maxlength' => 255, '#maxlength' => 255,
...@@ -68,77 +68,77 @@ class CloudServerTemplateEditForm extends CloudContentForm { ...@@ -68,77 +68,77 @@ class CloudServerTemplateEditForm extends CloudContentForm {
'#default_value' => $entity->instance_type(), '#default_value' => $entity->instance_type(),
'#required' => TRUE, '#required' => TRUE,
'#weight' => -5, '#weight' => -5,
); ];
$form['image_id'] = array( $form['image_id'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Image ID'), '#title' => $this->t('Image ID'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->image_id(), '#default_value' => $entity->image_id(),
'#weight' => -5, '#weight' => -5,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['kernel_id'] = array( $form['kernel_id'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Kernel ID'), '#title' => $this->t('Kernel ID'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->kernel_id(), '#default_value' => $entity->kernel_id(),
'#weight' => -5, '#weight' => -5,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['ramdisk_id'] = array( $form['ramdisk_id'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Ramdisk ID'), '#title' => $this->t('Ramdisk ID'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->kernel_id(), '#default_value' => $entity->kernel_id(),
'#weight' => -5, '#weight' => -5,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['group_id'] = array( $form['group_id'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Group ID'), '#title' => $this->t('Group ID'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->group_id(), '#default_value' => $entity->group_id(),
'#weight' => -5, '#weight' => -5,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['ssh_key_id'] = array( $form['ssh_key_id'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('SSH Key'), '#title' => $this->t('SSH Key'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->ssh_key_id(), '#default_value' => $entity->ssh_key_id(),
'#weight' => -5, '#weight' => -5,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['user_data'] = array( $form['user_data'] = [
'#type' => 'textarea', '#type' => 'textarea',
'#title' => $this->t('User Data'), '#title' => $this->t('User Data'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->user_data(), '#default_value' => $entity->user_data(),
'#weight' => -5, '#weight' => -5,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['instance_count'] = array( $form['instance_count'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t('Count'), '#title' => $this->t('Count'),
'#size' => 60, '#size' => 60,
'#default_value' => $entity->instance_count(), '#default_value' => $entity->instance_count(),
'#weight' => -5, '#weight' => -5,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['langcode'] = array( $form['langcode'] = [
'#title' => t('Language'), '#title' => t('Language'),
'#type' => 'language_select', '#type' => 'language_select',
'#default_value' => $entity->getUntranslated()->language()->getId(), '#default_value' => $entity->getUntranslated()->language()->getId(),
'#languages' => Language::STATE_ALL, '#languages' => Language::STATE_ALL,
); ];
$form['actions'] = $this->actions($form, $form_state); $form['actions'] = $this->actions($form, $form_state);
......
...@@ -61,7 +61,7 @@ class CloudServerTemplateLocalTasks extends DeriverBase implements ContainerDeri ...@@ -61,7 +61,7 @@ class CloudServerTemplateLocalTasks extends DeriverBase implements ContainerDeri
$this->derivatives[$id]['title'] = $entity->label(); $this->derivatives[$id]['title'] = $entity->label();
$this->derivatives[$id]['route_name'] = 'entity.cloud_server_template.collection'; $this->derivatives[$id]['route_name'] = 'entity.cloud_server_template.collection';
$this->derivatives[$id]['base_route'] = 'cloud_server_template.local_tasks.cloud_context.list_all'; $this->derivatives[$id]['base_route'] = 'cloud_server_template.local_tasks.cloud_context.list_all';
$this->derivatives[$id]['route_parameters'] = array('cloud_context' => $cloud_context); $this->derivatives[$id]['route_parameters'] = ['cloud_context' => $cloud_context];
} }
/** /**
@TODO: Maybe unnecessary code, Clean up later @TODO: Maybe unnecessary code, Clean up later
......
...@@ -28,9 +28,9 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -28,9 +28,9 @@ class CloudServerTemplateTest extends WebTestBase {
* *
* @var array * @var array
*/ */
public static $modules = array('cloud', public static $modules = ['cloud',
'cloud_server_template', 'cloud_server_template',
); ];
/** /**
* The profile to install as a basis for testing. * The profile to install as a basis for testing.
...@@ -45,13 +45,13 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -45,13 +45,13 @@ class CloudServerTemplateTest extends WebTestBase {
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$web_user = $this->drupalCreateUser(array( $web_user = $this->drupalCreateUser([
'add cloud server template', 'add cloud server template',
'list cloud server template', 'list cloud server template',
'view cloud server template', 'view cloud server template',
'edit cloud server template', 'edit cloud server template',
'delete cloud server template', 'delete cloud server template',
)); ]);
$this->drupalLogin($web_user); $this->drupalLogin($web_user);
} }
...@@ -80,33 +80,33 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -80,33 +80,33 @@ class CloudServerTemplateTest extends WebTestBase {
$this->drupalPostForm("/clouds/design/server_template/$cloud_context/add", $this->drupalPostForm("/clouds/design/server_template/$cloud_context/add",
$add[$i], $add[$i],
t('Save')); t('Save'));
$this->assertResponse(200, t('HTTP 200: Add | A New CloudServerTemplate Form #@num', array('@num' => $num))); $this->assertResponse(200, t('HTTP 200: Add | A New CloudServerTemplate Form #@num', ['@num' => $num]));
$this->assertNoText(t('Notice'), t('Make sure w/o Notice')); $this->assertNoText(t('Notice'), t('Make sure w/o Notice'));
$this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); $this->assertNoText(t('Warning'), t('Make sure w/o Warnings'));
$this->assertText(t('The server template "@name" has been saved.', array( $this->assertText(t('The server template "@name" has been saved.', [
'@name' => $add[$i]['name'], '@name' => $add[$i]['name'],
)), ]),
t('Confirm Message') . ': ' t('Confirm Message') . ': '
. t('The server template "@name" has been saved.', array( . t('The server template "@name" has been saved.', [
'@name' => $add[$i]['name'], '@name' => $add[$i]['name'],
)) ])
); );
$this->assertText($add[$i]['name'], $this->assertText($add[$i]['name'],
t('Name: @name ', array( t('Name: @name ', [
'@name' => $add[$i]['name'], '@name' => $add[$i]['name'],
))); ]));
// Make sure listing. // Make sure listing.
$this->drupalGet("/clouds/design/server_template/$cloud_context"); $this->drupalGet("/clouds/design/server_template/$cloud_context");
$this->assertResponse(200, t('HTTP 200: List | Server Template #@num', array('@num' => $num))); $this->assertResponse(200, t('HTTP 200: List | Server Template #@num', ['@num' => $num]));
$this->assertNoText(t('Notice'), t('Make sure w/o Notice')); $this->assertNoText(t('Notice'), t('Make sure w/o Notice'));
$this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); $this->assertNoText(t('Warning'), t('Make sure w/o Warnings'));
for ($j = 0; $j < $i + 1; $j++) { for ($j = 0; $j < $i + 1; $j++) {
$this->assertText($add[$j]['name'], $this->assertText($add[$j]['name'],
t("Make sure w/ Listing @num: @name", array( t("Make sure w/ Listing @num: @name", [
'@num' => $j + 1, '@num' => $j + 1,
'@name' => $add[$j]['name'], '@name' => $add[$j]['name'],
))); ]));
} }
} }
...@@ -119,32 +119,32 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -119,32 +119,32 @@ class CloudServerTemplateTest extends WebTestBase {
$this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/edit", $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/edit",
$edit[$i], $edit[$i],
t('Save')); t('Save'));
$this->assertResponse(200, t('HTTP 200: Edit | A New Server Template #@num', array('@num' => $num))); $this->assertResponse(200, t('HTTP 200: Edit | A New Server Template #@num', ['@num' => $num]));
$this->assertNoText(t('Notice'), t('Make sure w/o Notice')); $this->assertNoText(t('Notice'), t('Make sure w/o Notice'));
$this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); $this->assertNoText(t('Warning'), t('Make sure w/o Warnings'));
$this->assertText(t('The server template "@name" has been saved.', array( $this->assertText(t('The server template "@name" has been saved.', [
'@name' => $edit[$i]['name'], '@name' => $edit[$i]['name'],
)), ]),
t('Confirm Message') . ': ' t('Confirm Message') . ': '
. t('The server template "@name" has been saved.', array( . t('The server template "@name" has been saved.', [
'@name' => $edit[$i]['name'], '@name' => $edit[$i]['name'],
)) ])
); );
$this->assertText($edit[$i]['name'], t('Name: @name ', array( $this->assertText($edit[$i]['name'], t('Name: @name ', [
'@name' => $edit[$i]['name'], '@name' => $edit[$i]['name'],
))); ]));
// Make sure listing. // Make sure listing.
$this->drupalGet("/clouds/design/server_template/$cloud_context"); $this->drupalGet("/clouds/design/server_template/$cloud_context");
$this->assertResponse(200, t('HTTP 200: List | Server Template #@num', array('@num' => $num))); $this->assertResponse(200, t('HTTP 200: List | Server Template #@num', ['@num' => $num]));
$this->assertNoText(t('Notice'), t('Make sure w/o Notice')); $this->assertNoText(t('Notice'), t('Make sure w/o Notice'));
$this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); $this->assertNoText(t('Warning'), t('Make sure w/o Warnings'));
for ($j = 0; $j < $i + 1; $j++) { for ($j = 0; $j < $i + 1; $j++) {
$this->assertText($edit[$j]['name'], $this->assertText($edit[$j]['name'],
t("Make sure w/ Listing @num: @name", array( t("Make sure w/ Listing @num: @name", [
'@num' => $j + 1, '@num' => $j + 1,
'@name' => $edit[$j]['name'], '@name' => $edit[$j]['name'],
))); ]));
} }
} }
...@@ -156,23 +156,23 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -156,23 +156,23 @@ class CloudServerTemplateTest extends WebTestBase {
$this->drupalGet("/clouds/design/server_template/$cloud_context/$num/delete"); $this->drupalGet("/clouds/design/server_template/$cloud_context/$num/delete");
$this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/delete", $this->drupalPostForm("/clouds/design/server_template/$cloud_context/$num/delete",
array(), [],
t('Delete')); t('Delete'));
$this->assertResponse(200, t('HTTP 200: Server Template | Delete #@num', array('@num' => $num))); $this->assertResponse(200, t('HTTP 200: Server Template | Delete #@num', ['@num' => $num]));
$this->assertNoText(t('Notice'), t('Make sure w/o Notice')); $this->assertNoText(t('Notice'), t('Make sure w/o Notice'));
$this->assertNoText(t('warning'), t('Make sure w/o Warnings')); $this->assertNoText(t('warning'), t('Make sure w/o Warnings'));
// Make sure listing. // Make sure listing.
$this->drupalGet("/clouds/design/server_template/$cloud_context"); $this->drupalGet("/clouds/design/server_template/$cloud_context");
$this->assertResponse(200, t('HTTP 200: List | Server Template #@num', array('@num' => $num))); $this->assertResponse(200, t('HTTP 200: List | Server Template #@num', ['@num' => $num]));
$this->assertNoText(t('Notice'), t('Make sure w/o Notice')); $this->assertNoText(t('Notice'), t('Make sure w/o Notice'));
$this->assertNoText(t('Warning'), t('Make sure w/o Warnings')); $this->assertNoText(t('Warning'), t('Make sure w/o Warnings'));
for ($j = 0; $j < $i + 1; $j++) { for ($j = 0; $j < $i + 1; $j++) {
$this->assertNoText($edit[$j]['name'], $this->assertNoText($edit[$j]['name'],
t("Make sure w/ Listing @num: @name", array( t("Make sure w/ Listing @num: @name", [
'@num' => $j + 1, '@num' => $j + 1,
'@name' => $edit[$j]['name'], '@name' => $edit[$j]['name'],
))); ]));
} }
} }
// Filtering server_template information item // Filtering server_template information item
...@@ -209,7 +209,7 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -209,7 +209,7 @@ class CloudServerTemplateTest extends WebTestBase {
$num = $i + 1; $num = $i + 1;
// Input Fields. // Input Fields.
$data[] = array( $data[] = [
// 'cloud_context' => $cloud_context ,. // 'cloud_context' => $cloud_context ,.
'name' => "Template #$num - " . date('Y/m/d') . $random->name(16, TRUE), 'name' => "Template #$num - " . date('Y/m/d') . $random->name(16, TRUE),
'description' => "#$num: " . date('Y/m/d H:i:s - D M j G:i:s T Y') 'description' => "#$num: " . date('Y/m/d H:i:s - D M j G:i:s T Y')
...@@ -221,7 +221,7 @@ class CloudServerTemplateTest extends WebTestBase { ...@@ -221,7 +221,7 @@ class CloudServerTemplateTest extends WebTestBase {
'ramdisk_id' => 'ari-' . $random->name(8, TRUE), 'ramdisk_id' => 'ari-' . $random->name(8, TRUE),
'ssh_key_id' => 'ssh_key_id-' . $random->name(32, TRUE), 'ssh_key_id' => 'ssh_key_id-' . $random->name(32, TRUE),
'instance_count' => $num, 'instance_count' => $num,
); ];
} }
return $data; return $data;
} }
......
...@@ -39,7 +39,7 @@ interface ApiControllerInterface { ...@@ -39,7 +39,7 @@ interface ApiControllerInterface {
/** /**
* ;@inheritdoc}. * ;@inheritdoc}.
*/ */
public function getMockhandlerResult($params = array()); public function getMockhandlerResult($params = []);
/** /**
* ;@inheritdoc}. * ;@inheritdoc}.
......
...@@ -21,19 +21,19 @@ class ConfigListBuilder extends CloudConfigListBuilder { ...@@ -21,19 +21,19 @@ class ConfigListBuilder extends CloudConfigListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Cloud Display Name'), 'specifier' => 'label', 'sort' => 'ASC'), ['data' => t('Cloud Display Name'), 'specifier' => 'label', 'sort' => 'ASC'],
array('data' => t('Cloud ID'), 'specifier' => 'id'), ['data' => t('Cloud ID'), 'specifier' => 'id'],
array('data' => t('Region'), 'specifier' => 'region'), ['data' => t('Region'), 'specifier' => 'region'],
array('data' => t('API Endpoint URI'), 'specifier' => 'endpoint'), ['data' => t('API Endpoint URI'), 'specifier' => 'endpoint'],
array('data' => t('User ID'), 'specifier' => 'user_id'), ['data' => t('User ID'), 'specifier' => 'user_id'],
array('data' => t('Date Created'), 'specifier' => 'created'), ['data' => t('Date Created'), 'specifier' => 'created'],
array('data' => t('Date Updated'), 'specifier' => 'changed'), ['data' => t('Date Updated'), 'specifier' => 'changed'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
...@@ -46,12 +46,12 @@ class ConfigListBuilder extends CloudConfigListBuilder { ...@@ -46,12 +46,12 @@ class ConfigListBuilder extends CloudConfigListBuilder {
$row['label'] = \Drupal::l( $row['label'] = \Drupal::l(
$entity->label(), $entity->label(),
new Url( new Url(
'entity.cloud_context.edit_form', array( 'entity.cloud_context.edit_form', [
// Note: id = "aws_cloud" needs to match to *.routing.yml's parameter: {aws_cloud} // Note: id = "aws_cloud" needs to match to *.routing.yml's parameter: {aws_cloud}
// 'cloud_context' => $entity->id(), // equals to $entity->context() // 'cloud_context' => $entity->id(), // equals to $entity->context()
// equals to $entity->id() // equals to $entity->id()
'cloud_context' => $entity->cloud_context(), 'cloud_context' => $entity->cloud_context(),
) ]
) )
); );
$row['id'] = $entity->cloud_context(); $row['id'] = $entity->cloud_context();
......
...@@ -25,19 +25,19 @@ class ElasticIpListBuilder extends CloudContentListBuilder { ...@@ -25,19 +25,19 @@ class ElasticIpListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'), ['data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'],
array('data' => t('Elastic IP'), 'specifier' => 'public_ip'), ['data' => t('Elastic IP'), 'specifier' => 'public_ip'],
array('data' => t('Allocation ID'), 'specifier' => 'allocation_id'), ['data' => t('Allocation ID'), 'specifier' => 'allocation_id'],
array('data' => t('Instance'), 'specifier' => 'instance_id'), ['data' => t('Instance'), 'specifier' => 'instance_id'],
array('data' => t('Private IP Address'), 'specifier' => 'private_ip_address'), ['data' => t('Private IP Address'), 'specifier' => 'private_ip_address'],
array('data' => t('Scope'), 'specifier' => 'scope'), ['data' => t('Scope'), 'specifier' => 'scope'],
// array('data' => t('Public DNS'), 'specifier' => 'public_dns'), // Need to get from Network Interface // array('data' => t('Public DNS'), 'specifier' => 'public_dns'), // Need to get from Network Interface
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -21,23 +21,23 @@ class ImageListBuilder extends CloudContentListBuilder { ...@@ -21,23 +21,23 @@ class ImageListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'), ['data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'],
array('data' => t('AMI Name'), 'specifier' => 'ami_name'), ['data' => t('AMI Name'), 'specifier' => 'ami_name'],
array('data' => t('AMI ID'), 'specifier' => 'image_id'), ['data' => t('AMI ID'), 'specifier' => 'image_id'],
array('data' => t('Source'), 'specifier' => 'source'), ['data' => t('Source'), 'specifier' => 'source'],
array('data' => t('Owner'), 'specifier' => 'owner'), ['data' => t('Owner'), 'specifier' => 'owner'],
array('data' => t('Visibility'), 'specifier' => 'visibility'), ['data' => t('Visibility'), 'specifier' => 'visibility'],
array('data' => t('Status'), 'specifier' => 'status'), ['data' => t('Status'), 'specifier' => 'status'],
array('data' => t('Architecture'), 'specifier' => 'architecture '), ['data' => t('Architecture'), 'specifier' => 'architecture '],
array('data' => t('Platform'), 'specifier' => 'platform'), ['data' => t('Platform'), 'specifier' => 'platform'],
array('data' => t('Root Device '), 'specifier' => 'root_device type'), ['data' => t('Root Device '), 'specifier' => 'root_device type'],
array('data' => t('Virtualization'), 'specifier' => 'virtualization_type'), ['data' => t('Virtualization'), 'specifier' => 'virtualization_type'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -21,19 +21,19 @@ class InstanceListBuilder extends CloudContentListBuilder { ...@@ -21,19 +21,19 @@ class InstanceListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
array('data' => t('Name'), 'specifier' => 'name'), ['data' => t('Name'), 'specifier' => 'name'],
array('data' => t('Instance ID'), 'specifier' => 'instance_id'), ['data' => t('Instance ID'), 'specifier' => 'instance_id'],
array('data' => t('Public IP'), 'specifier' => 'public_ip'), ['data' => t('Public IP'), 'specifier' => 'public_ip'],
array('data' => t('Instance State'), 'specifier' => 'instance_state'), ['data' => t('Instance State'), 'specifier' => 'instance_state'],
array('data' => t('Zone'), 'specifier' => 'availability_zone'), ['data' => t('Zone'), 'specifier' => 'availability_zone'],
array('data' => t('Key Pair'), 'specifier' => 'key_pair_name'), ['data' => t('Key Pair'), 'specifier' => 'key_pair_name'],
array('data' => t('Launched at'), 'specifier' => 'created'), ['data' => t('Launched at'), 'specifier' => 'created'],
array('data' => t('Date Updated'), 'specifier' => 'changed', 'sort' => 'DESC'), ['data' => t('Date Updated'), 'specifier' => 'changed', 'sort' => 'DESC'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -22,14 +22,14 @@ class KeyPairListBuilder extends CloudContentListBuilder { ...@@ -22,14 +22,14 @@ class KeyPairListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Key Pair Name'), 'specifier' => 'key_pair_name', 'sort' => 'ASC'), ['data' => t('Key Pair Name'), 'specifier' => 'key_pair_name', 'sort' => 'ASC'],
array('data' => t('Key Fingerprint'), 'specifier' => 'fingerprint'), ['data' => t('Key Fingerprint'), 'specifier' => 'fingerprint'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -21,23 +21,23 @@ class NetworkInterfaceListBuilder extends CloudContentListBuilder { ...@@ -21,23 +21,23 @@ class NetworkInterfaceListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Network Interface ID'), 'specifier' => 'network_interface_id', 'sort' => 'ASC'), ['data' => t('Network Interface ID'), 'specifier' => 'network_interface_id', 'sort' => 'ASC'],
array('data' => t('Subnet ID'), 'specifier' => 'subnet_id'), ['data' => t('Subnet ID'), 'specifier' => 'subnet_id'],
array('data' => t('VPC ID'), 'specifier' => 'vpc_id'), ['data' => t('VPC ID'), 'specifier' => 'vpc_id'],
array('data' => t('Zone'), 'specifier' => 'availability_zone'), ['data' => t('Zone'), 'specifier' => 'availability_zone'],
array('data' => t('Security Groups'), 'specifier' => 'security_groups'), ['data' => t('Security Groups'), 'specifier' => 'security_groups'],
array('data' => t('Description'), 'specifier' => 'description'), ['data' => t('Description'), 'specifier' => 'description'],
array('data' => t('Instance ID'), 'specifier' => 'instance_id'), ['data' => t('Instance ID'), 'specifier' => 'instance_id'],
array('data' => t('Status'), 'specifier' => 'status'), ['data' => t('Status'), 'specifier' => 'status'],
array('data' => t('Public IP'), 'specifier' => 'public_ips'), ['data' => t('Public IP'), 'specifier' => 'public_ips'],
array('data' => t('Primary Private IP'), 'specifier' => 'primary_private_ip'), ['data' => t('Primary Private IP'), 'specifier' => 'primary_private_ip'],
array('data' => t('Secondary Private IP'), 'specifier' => 'secondary_private_ips'), ['data' => t('Secondary Private IP'), 'specifier' => 'secondary_private_ips'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -20,16 +20,16 @@ class SecurityGroupListBuilder extends CloudContentListBuilder { ...@@ -20,16 +20,16 @@ class SecurityGroupListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Group Name'), 'specifier' => 'group_name'), ['data' => t('Group Name'), 'specifier' => 'group_name'],
array('data' => t('Group ID'), 'specifier' => 'group_id'), ['data' => t('Group ID'), 'specifier' => 'group_id'],
array('data' => t('VPC ID'), 'specifier' => 'vpc_id'), ['data' => t('VPC ID'), 'specifier' => 'vpc_id'],
array('data' => t('Description'), 'specifier' => 'description'), ['data' => t('Description'), 'specifier' => 'description'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -20,22 +20,22 @@ class SnapshotListBuilder extends CloudContentListBuilder { ...@@ -20,22 +20,22 @@ class SnapshotListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'), ['data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'],
array('data' => t('Snapshot ID'), 'specifier' => 'snapshot_id'), ['data' => t('Snapshot ID'), 'specifier' => 'snapshot_id'],
array('data' => t('Size'), 'specifier' => 'size'), ['data' => t('Size'), 'specifier' => 'size'],
array('data' => t('Description'), 'specifier' => 'description'), ['data' => t('Description'), 'specifier' => 'description'],
array('data' => t('Status'), 'specifier' => 'status'), ['data' => t('Status'), 'specifier' => 'status'],
array('data' => t('Started'), 'specifier' => 'started'), ['data' => t('Started'), 'specifier' => 'started'],
array('data' => t('Progress'), 'specifier' => 'progress'), ['data' => t('Progress'), 'specifier' => 'progress'],
array('data' => t('Encrypted'), 'specifier' => 'encrypted'), ['data' => t('Encrypted'), 'specifier' => 'encrypted'],
array('data' => t('KMS Key ID'), 'specifier' => 'kms_key_id'), ['data' => t('KMS Key ID'), 'specifier' => 'kms_key_id'],
array('data' => t('KMS Key Alias'), 'specifier' => 'kms_key_aliases'), ['data' => t('KMS Key Alias'), 'specifier' => 'kms_key_aliases'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -20,25 +20,25 @@ class VolumeListBuilder extends CloudContentListBuilder { ...@@ -20,25 +20,25 @@ class VolumeListBuilder extends CloudContentListBuilder {
*/ */
public function buildHeader() { public function buildHeader() {
$header = array( $header = [
// The header gives the table the information it needs in order to make // The header gives the table the information it needs in order to make
// the query calls for ordering. TableSort uses the field information // the query calls for ordering. TableSort uses the field information
// to know what database column to sort by. // to know what database column to sort by.
// field should be 'field', not 'specifier' in ConfigEntity. // field should be 'field', not 'specifier' in ConfigEntity.
array('data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'), ['data' => t('Name'), 'specifier' => 'name', 'sort' => 'ASC'],
array('data' => t('Volume ID'), 'specifier' => 'volume_id'), ['data' => t('Volume ID'), 'specifier' => 'volume_id'],
array('data' => t('Size'), 'specifier' => 'size'), ['data' => t('Size'), 'specifier' => 'size'],
array('data' => t('Volume Type'), 'specifier' => 'volume_type'), ['data' => t('Volume Type'), 'specifier' => 'volume_type'],
array('data' => t('IOPS'), 'specifier' => 'iops'), ['data' => t('IOPS'), 'specifier' => 'iops'],
array('data' => t('Snapshot'), 'specifier' => 'snapshot_id'), ['data' => t('Snapshot'), 'specifier' => 'snapshot_id'],
array('data' => t('Created'), 'specifier' => 'created'), ['data' => t('Created'), 'specifier' => 'created'],
array('data' => t('Zone'), 'specifier' => 'availability_zone'), ['data' => t('Zone'), 'specifier' => 'availability_zone'],
array('data' => t('State'), 'specifier' => 'state'), ['data' => t('State'), 'specifier' => 'state'],
array('data' => t('Alarm Status'), 'specifier' => 'alarm_status'), ['data' => t('Alarm Status'), 'specifier' => 'alarm_status'],
array('data' => t('Attachment Information'), 'specifier' => 'attachment_information'), ['data' => t('Attachment Information'), 'specifier' => 'attachment_information'],
array('data' => t('Volume Status'), 'specifier' => 'volume_status'), ['data' => t('Volume Status'), 'specifier' => 'volume_status'],
array('data' => t('Encrypted'), 'specifier' => 'encrypted'), ['data' => t('Encrypted'), 'specifier' => 'encrypted'],
); ];
return $header + parent::buildHeader(); return $header + parent::buildHeader();
} }
......
...@@ -67,9 +67,9 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface { ...@@ -67,9 +67,9 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface {
*/ */
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) { public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values); parent::preCreate($storage_controller, $values);
$values += array( $values += [
'user_id' => \Drupal::currentUser()->id(), 'user_id' => \Drupal::currentUser()->id(),
); ];
} }
/** /**
...@@ -243,16 +243,16 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface { ...@@ -243,16 +243,16 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface {
$fields['name'] = BaseFieldDefinition::create('string') $fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name')) ->setLabel(t('Name'))
->setDescription(t('The Elastic IP address name.')) ->setDescription(t('The Elastic IP address name.'))
->setSettings(array( ->setSettings([
'default_value' => '', 'default_value' => '',
'max_length' => 255, 'max_length' => 255,
'text_processing' => 0, 'text_processing' => 0,
)) ])
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
/* /*
->setDisplayOptions('form', array( ->setDisplayOptions('form', array(
'type' => 'string_textfield', 'type' => 'string_textfield',
...@@ -266,96 +266,96 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface { ...@@ -266,96 +266,96 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface {
$fields['public_ip'] = BaseFieldDefinition::create('string') $fields['public_ip'] = BaseFieldDefinition::create('string')
->setLabel(t('Elastic IP')) ->setLabel(t('Elastic IP'))
->setDescription(t('The Elastic IP Address.')) ->setDescription(t('The Elastic IP Address.'))
->setSettings(array( ->setSettings([
'default_value' => '', 'default_value' => '',
'max_length' => 15, 'max_length' => 15,
'text_processing' => 0, 'text_processing' => 0,
)) ])
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['instance_id'] = BaseFieldDefinition::create('string') $fields['instance_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Instance ID')) ->setLabel(t('Instance ID'))
->setDescription(t('The instance the Elastic IP address is associated with, if applicable.')) ->setDescription(t('The instance the Elastic IP address is associated with, if applicable.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['domain'] = BaseFieldDefinition::create('string') $fields['domain'] = BaseFieldDefinition::create('string')
->setLabel(t('Domain')) ->setLabel(t('Domain'))
->setDescription(t('The instance the Elastic IP address is associated with, if applicable.')) ->setDescription(t('The instance the Elastic IP address is associated with, if applicable.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['scope'] = BaseFieldDefinition::create('string') $fields['scope'] = BaseFieldDefinition::create('string')
->setLabel(t('Scope')) ->setLabel(t('Scope'))
->setDescription(t('Indicates if the Elastic IP address is for use in EC2-Classic (standard) or in a VPC (vpc).')) ->setDescription(t('Indicates if the Elastic IP address is for use in EC2-Classic (standard) or in a VPC (vpc).'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['network_interface_id'] = BaseFieldDefinition::create('string') $fields['network_interface_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Network Interface ID')) ->setLabel(t('Network Interface ID'))
->setDescription(t('For instances in a VPC, indicates the ID of the network interface to which the Elastic IP is associated.')) ->setDescription(t('For instances in a VPC, indicates the ID of the network interface to which the Elastic IP is associated.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['private_ip_address'] = BaseFieldDefinition::create('string') $fields['private_ip_address'] = BaseFieldDefinition::create('string')
->setLabel(t('Private IP Address')) ->setLabel(t('Private IP Address'))
->setDescription(t('The private IP address of the network interface to which the Elastic IP address is associated.')) ->setDescription(t('The private IP address of the network interface to which the Elastic IP address is associated.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['network_interface_owner'] = BaseFieldDefinition::create('string') $fields['network_interface_owner'] = BaseFieldDefinition::create('string')
->setLabel(t('Network Interface Owner')) ->setLabel(t('Network Interface Owner'))
->setDescription(t('The AWS account number of the network interface owner.')) ->setDescription(t('The AWS account number of the network interface owner.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['allocation_id'] = BaseFieldDefinition::create('string') $fields['allocation_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Allocation ID')) ->setLabel(t('Allocation ID'))
->setDescription(t('The allocation ID of the Elastic IP address. Only applicable to Elastic IP addresses used in a VPC.')) ->setDescription(t('The allocation ID of the Elastic IP address. Only applicable to Elastic IP addresses used in a VPC.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['association_id'] = BaseFieldDefinition::create('string') $fields['association_id'] = BaseFieldDefinition::create('string')
->setLabel(t('Association ID')) ->setLabel(t('Association ID'))
->setDescription(t('The ID representing the association of the address with an instance in a VPC.')) ->setDescription(t('The ID representing the association of the address with an instance in a VPC.'))
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'string', 'type' => 'string',
'weight' => -5, 'weight' => -5,
)) ])
->setReadOnly(TRUE); ->setReadOnly(TRUE);
$fields['created'] = BaseFieldDefinition::create('created') $fields['created'] = BaseFieldDefinition::create('created')
...@@ -378,21 +378,21 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface { ...@@ -378,21 +378,21 @@ class ElasticIp extends ContentEntityBase implements ElasticIpInterface {
->setSetting('handler', 'default') ->setSetting('handler', 'default')
->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId') ->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId')
->setTranslatable(TRUE) ->setTranslatable(TRUE)
->setDisplayOptions('view', array( ->setDisplayOptions('view', [
'label' => 'inline', 'label' => 'inline',
'type' => 'author', 'type' => 'author',
'weight' => 0, 'weight' => 0,
)) ])
->setDisplayOptions('form', array( ->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete', 'type' => 'entity_reference_autocomplete',
'weight' => 5, 'weight' => 5,
'settings' => array( 'settings' => [
'match_operator' => 'CONTAINS', 'match_operator' => 'CONTAINS',
'size' => '60', 'size' => '60',
'autocomplete_type' => 'tags', 'autocomplete_type' => 'tags',
'placeholder' => '', 'placeholder' => '',
), ],
)) ])
->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE); ->setDisplayConfigurable('view', TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment