Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / crop / src / Form / CropTypeForm.php
index 6874a437a5226cb89202e76432d10dfa968b3a0c..9d89df647ea3cbe2bb400ba74028d7e54d3f89c9 100644 (file)
@@ -5,7 +5,6 @@ namespace Drupal\crop\Form;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Link;
-use Drupal\Core\Url;
 use Symfony\Component\Validator\ConstraintViolationListInterface;
 
 /**
@@ -22,7 +21,7 @@ class CropTypeForm extends EntityForm {
     $type = $this->entity;
     $form['#title'] = $this->operation == 'add' ? $this->t('Add crop type')
         :
-        $this->t('Edit %label crop type', array('%label' => $type->label()));
+        $this->t('Edit %label crop type', ['%label' => $type->label()]);
 
     $form['label'] = [
       '#title' => $this->t('Name'),
@@ -169,14 +168,14 @@ class CropTypeForm extends EntityForm {
 
     $status = $type->save();
 
-    $t_args = array('%name' => $type->label());
+    $t_args = ['%name' => $type->label()];
 
     if ($status == SAVED_UPDATED) {
       drupal_set_message($this->t('The crop type %name has been updated.', $t_args));
     }
     elseif ($status == SAVED_NEW) {
       drupal_set_message($this->t('The crop type %name has been added.', $t_args));
-      $context = array_merge($t_args, array('link' => Link::createFromRoute($this->t('View'), 'crop.overview_types')->toString()));
+      $context = array_merge($t_args, ['link' => Link::createFromRoute($this->t('View'), 'crop.overview_types')->toString()]);
       $this->logger('crop')->notice('Added crop type %name.', $context);
     }