Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function run_test() {
$formatted_name = Options_General::locale_name_format( $locale );

// Check if Language Packs exist for the Locale and if the Language Pack major version is the same as the WordPress installed major version.
if ( $locale->has_translations() && isset( $locale_translations_version ) && $translation_project_version === $locale_translations_version ) {
if ( $locale->has_translations() && $translation_project_version === $locale_translations_version ) {

$this->test_status = self::TRANSLATION_TOOLS_SITE_HEALTH_STATUS_GOOD;
$this->test_label = sprintf(
Expand Down
4 changes: 3 additions & 1 deletion includes/class-update-translations.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public function update_translation( $type, $project, $wp_locale, $generate_po_mo
$generate_po = $this->generate_po( $destination, $project, $locale, $download['data'] );
array_push( $result['log'], $generate_po['log'] );
$result['data'] = $generate_po['data'];
/** @var array{log: array, data: true|WP_Error} $result Results. */
\PHPStan\dumpType( $result['data'] );
if ( is_wp_error( $result['data'] ) ) {
return $result;
}
Expand Down Expand Up @@ -305,7 +307,7 @@ public function download_translations( $type, $project, $locale ) {
* @param Locale $locale Locale object.
* @param array $response HTTP response.
*
* @return array|WP_Error Array on success, WP_Error on failure.
* @return array{log:string, data:true}|array{data:WP_Error} Array on success, WP_Error on failure.
*/
public function generate_po( $destination, $project, $locale, $response ) {

Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ parameters:
- assets/lib/locales/locales.php
# TODO Tell PHPStan what is inside arrays.
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false