diff -u b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php --- b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php +++ b/core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php @@ -124,28 +124,14 @@ * @param string $filename * Filename to import. * - * @return $data, $translated_languages - * - * - */ - - - /** - * Process article data into article node structure. - * - - * @param array $data - * Data of line that was read from the file. - * - * @return $header + * @return array $header * Columns in the file being imported * - * @return $data + * @return array $data * All multilingual content that was read from the files. * - * @return $translated_languages + * @return array $translated_languages * List of language codes that need to be imported. - * */ protected function readMultilingualContent($filename) { // Find all the language directories available for default content. @@ -153,12 +139,12 @@ $translated_languages = []; $default_content_path = $module_path . "/default_content/languages/"; $dir_handle = opendir($default_content_path); - while($languages_directory = readdir($dir_handle)) { + while ($languages_directory = readdir($dir_handle)) { switch ($languages_directory) { case ".": - break; + break; case "..": - break; + break; default: array_push($translated_languages, $languages_directory); } @@ -167,7 +153,7 @@ // Load all content in all languages. $data = []; - foreach($translated_languages as $language) { + foreach ($translated_languages as $language) { if (file_exists($default_content_path . "$language/$filename") && ($handle = fopen($default_content_path . "$language/$filename", 'r')) !== FALSE) { $first_csv_line = fgetcsv($handle); @@ -209,7 +195,7 @@ */ protected function importTerms() { $module_path = $this->moduleHandler->getModule('demo_umami_content')->getPath(); - $vocabularies = array("tags","recipe_categories"); + $vocabularies = ["tags","recipe_categories"]; // import all vocabularies foreach ($vocabularies as $vocabulary) { @@ -373,7 +359,7 @@ * @param string $vocabulary * Machine name of vocabulary to which we should save terms. * - * @return $values + * @return array $values * Data structured as a term. */ protected function processTerm(array $data, $vocabulary) { @@ -395,7 +381,7 @@ * @param array $data * Data of line that was read from the file. * - * @return $values + * @return array $values * Data structured as a page node. */ protected function processPage(array $data) { @@ -430,7 +416,7 @@ * @param array $data * Data of line that was read from the file. * - * @return $values + * @return array $values * Data structured as a recipe node. */ protected function processRecipe($module_path, array $data) { @@ -516,7 +502,6 @@ return $values; } - /** * Process article data into article node structure. * @@ -525,7 +510,7 @@ * @param array $data * Data of line that was read from the file. * - * @return $values + * @return array $values * Data structured as an article node. */ protected function processArticle($module_path, array $data) { @@ -575,7 +560,7 @@ return $values; } - /** + /** * Process block_banner data into block_banner block structure. * * @param string $module_path @@ -583,7 +568,7 @@ * @param array $data * Data of line that was read from the file. * - * @return $values + * @return array $values * Data structured as a block. */ protected function processBlock($module_path, array $data, $block_type) { @@ -646,7 +631,7 @@ 'field_summary' => [ 'value' => $data['field_summary'], ], - 'field_banner_image' => [ + 'field_promo_image' => [ 'target_id' => $this->createFileEntity($module_path . '/default_content/images/' . $data['field_promo_image_target_id']), 'alt' => $data['field_promo_image_alt'], ], @@ -764,7 +749,7 @@ */ protected function importBlockContent() { $module_path = $this->moduleHandler->getModule('demo_umami_content')->getPath(); - $block_types = array("banner_block","disclaimer_block","footer_promo_block"); + $block_types = ["banner_block", "disclaimer_block", "footer_promo_block"]; // import all block types foreach ($block_types as $block_type) {