$attributes * * @param array $attributes - Array of attributes. * * @phpstan-return array * @return array - Array of PHP-shaped attributes. */ public function translate_attributes_to_array( array $attributes ): array { return \array_map( function( $attribute ) { if ( $attribute instanceof Attribute ) { return $attribute->to_array(); } return $attribute; }, $attributes ); } /** * No longer used. * * @deprecated in favor of translate_attributes_to_array. * * @template T of string * * @phpstan-param array $attributes * * @param array $attributes - Array of attributes. * * @phpstan-return array * @return array */ public function translate_attributes_to_php( array $attributes ): array { return $this->translate_attributes_to_array( $attributes ); } }