|
3 | 3 | namespace Drupal\islandora_iiif_hocr_extend\Plugin\search_api\processor; |
4 | 4 |
|
5 | 5 | use Drupal\Core\Entity\EntityTypeManagerInterface; |
6 | | -use Drupal\Core\Session\AnonymousUserSession; |
7 | | -use Drupal\file\FileInterface; |
8 | | -use Drupal\islandora_hocr\Plugin\search_api\processor\Property\HOCRFieldProperty; |
9 | | -use Drupal\media\Plugin\media\Source\File; |
10 | 6 | use Drupal\node\NodeInterface; |
11 | | -use Drupal\search_api\Datasource\DatasourceInterface; |
12 | 7 | use Drupal\search_api\Item\ItemInterface; |
13 | 8 | use Drupal\search_api\Plugin\PluginFormTrait; |
14 | | -use Drupal\search_api\Processor\ProcessorPluginBase; |
15 | 9 | use Drupal\search_api\SearchApiException; |
16 | 10 | use Drupal\islandora_hocr\Plugin\search_api\processor\HOCRField; |
17 | 11 | use Symfony\Component\DependencyInjection\ContainerInterface; |
@@ -56,7 +50,6 @@ public static function create(ContainerInterface $container, array $configuratio |
56 | 50 |
|
57 | 51 | /** |
58 | 52 | * {@inheritDoc} |
59 | | - * |
60 | 53 | */ |
61 | 54 | public function addFieldValues(ItemInterface $item) { |
62 | 55 | try { |
@@ -109,20 +102,21 @@ public function addFieldValues(ItemInterface $item) { |
109 | 102 | // populated. |
110 | 103 | $content = $info['callable'](); |
111 | 104 |
|
112 | | - // Null check to only process if content is not NULL |
113 | | - if($content !== NULL) { |
114 | | - // strip all tags of xml |
| 105 | + // Null check to only process if content is not NULL. |
| 106 | + if ($content !== NULL) { |
| 107 | + // Strip all tags of xml. |
115 | 108 | $cleaned = \strip_tags($content); |
116 | 109 |
|
117 | | - // remove white space and new line after strip_tags |
| 110 | + // Remove white space and new line after strip_tags. |
118 | 111 | $cleaned = preg_replace('/\s+/', ' ', $cleaned); |
119 | 112 |
|
120 | | - // remove if any "- ", if there is |
| 113 | + // Remove if any "- ", if there is. |
121 | 114 | $cleaned = str_replace('- ', '', $cleaned); |
122 | 115 | $field->addValue($cleaned); |
123 | 116 | } |
124 | 117 | } |
125 | 118 | } |
126 | 119 | } |
127 | 120 | } |
| 121 | + |
128 | 122 | } |
0 commit comments