@@ -8,7 +8,6 @@ |
||
| 8 | 8 | namespace Drupal\crop\Entity; |
| 9 | 9 | |
| 10 | 10 | use Drupal\Core\Config\Entity\ConfigEntityBundleBase; |
| 11 | -use Drupal\Core\Entity\EntityConstraintViolationList; |
|
| 12 | 11 | use Drupal\crop\CropTypeInterface; |
| 13 | 12 | use Symfony\Component\Validator\ConstraintViolationList; |
| 14 | 13 | |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | */ |
| 108 | 108 | public static function getCropTypeNames() { |
| 109 | 109 | return array_map( |
| 110 | - function ($bundle_info) { return $bundle_info['label'];}, |
|
| 110 | + function($bundle_info) { return $bundle_info['label']; }, |
|
| 111 | 111 | \Drupal::entityManager()->getBundleInfo('crop') |
| 112 | 112 | ); |
| 113 | 113 | } |
@@ -128,8 +128,7 @@ |
||
| 128 | 128 | |
| 129 | 129 | if ($status == SAVED_UPDATED) { |
| 130 | 130 | drupal_set_message(t('The crop type %name has been updated.', $t_args)); |
| 131 | - } |
|
| 132 | - elseif ($status == SAVED_NEW) { |
|
| 131 | + } elseif ($status == SAVED_NEW) { |
|
| 133 | 132 | drupal_set_message(t('The crop type %name has been added.', $t_args)); |
| 134 | 133 | $context = array_merge($t_args, array('link' => $this->l(t('View'), new Url('crop.overview_types')))); |
| 135 | 134 | $this->logger('crop')->notice('Added crop type %name.', $context); |
@@ -139,8 +139,7 @@ |
||
| 139 | 139 | $other_image_styles = array_splice($image_styles, 2); |
| 140 | 140 | if ($other_image_styles) { |
| 141 | 141 | $usage_message = t('@first, @second and @count more', ['@first' => $usage[0], '@second' => $usage[1], '@count' => count($other_image_styles)]); |
| 142 | - } |
|
| 143 | - else { |
|
| 142 | + } else { |
|
| 144 | 143 | $usage_message = implode(', ', $usage); |
| 145 | 144 | } |
| 146 | 145 | $row['usage']['data']['#markup'] = $usage_message; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * @return \Drupal\crop\CropInterface |
| 54 | 54 | * Crop object this is being called on. |
| 55 | 55 | */ |
| 56 | - public function setSize($width, $height); |
|
| 56 | + public function setSize($width, $height); |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Gets crop anchor (top-left corner of crop area). |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | $this->assertRaw($edit['description']); |
| 100 | 100 | |
| 101 | 101 | // See if crop type appears on image effect configuration form. |
| 102 | - $this->drupalGet('admin/config/media/image-styles/manage/' . $this->testStyle->id() . '/add/crop_crop'); |
|
| 102 | + $this->drupalGet('admin/config/media/image-styles/manage/'.$this->testStyle->id().'/add/crop_crop'); |
|
| 103 | 103 | $option = $this->xpath("//select[@id='edit-data-crop-type']/option"); |
| 104 | 104 | $this->assert(strpos($option[0]->asXML(), $edit['label']) !== FALSE, 'Crop type label found on image effect page.'); |
| 105 | - $this->drupalPostForm('admin/config/media/image-styles/manage/' . $this->testStyle->id() . '/add/crop_crop', ['data[crop_type]' => $edit['id']], t('Add effect')); |
|
| 105 | + $this->drupalPostForm('admin/config/media/image-styles/manage/'.$this->testStyle->id().'/add/crop_crop', ['data[crop_type]' => $edit['id']], t('Add effect')); |
|
| 106 | 106 | $this->assertText(t('The image effect was successfully applied.')); |
| 107 | 107 | $this->assertText(t('Manual crop uses @name crop type', ['@name' => $edit['label']])); |
| 108 | 108 | $this->testStyle = $this->container->get('entity.manager')->getStorage('image_style')->loadUnchanged($this->testStyle->id()); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Try to access edit form as anonymous user. |
| 114 | 114 | $this->drupalLogout(); |
| 115 | - $this->drupalGet('admin/config/media/crop/manage/' . $edit['id']); |
|
| 115 | + $this->drupalGet('admin/config/media/crop/manage/'.$edit['id']); |
|
| 116 | 116 | $this->assertResponse(403); |
| 117 | 117 | $this->drupalLogin($this->adminUser); |
| 118 | 118 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $this->assertLink('Test image style'); |
| 126 | 126 | $this->clickLink(t('Delete')); |
| 127 | 127 | $this->assertText(t('Are you sure you want to delete the crop type @name?', ['@name' => $edit['label']])); |
| 128 | - $this->drupalPostForm('admin/config/media/crop/manage/' . $edit['id'] . '/delete', [], t('Delete')); |
|
| 128 | + $this->drupalPostForm('admin/config/media/crop/manage/'.$edit['id'].'/delete', [], t('Delete')); |
|
| 129 | 129 | $this->assertRaw(t('The crop type %name has been deleted.', ['%name' => $edit['label']])); |
| 130 | 130 | $this->assertText(t('No crop types available.')); |
| 131 | 131 | } |