fix phpdocs and some readability

This commit is contained in:
André Menrath 2023-11-25 10:38:22 +01:00
parent 768d190be0
commit e5d19f2b6a

View file

@ -236,7 +236,6 @@ class Transformers_Manager {
do_action( 'activitypub_transformers_register', $this );
}
/**
* Get available ActivityPub transformers.
*
@ -246,7 +245,7 @@ class Transformers_Manager {
* @since version_number_transformer_management_placeholder
* @access public
*
* @param string $transformers Optional. Transformer name. Default is null.
* @param string $transformer_name Optional. Transformer name. Default is null.
*
* @return Base|Base[]|null Registered transformers.
*/
@ -270,7 +269,7 @@ class Transformers_Manager {
* @since version_number_transformer_management_placeholder
* @access public
*
* @param WP_Post|WP_Comment $wp_post The WordPress Post/Comment.
* @param WP_Post|WP_Comment $object The WordPress Post/Comment.
*
* @return \ActivityPub\Transformer\Base|null Registered transformers.
*/
@ -280,7 +279,8 @@ class Transformers_Manager {
$post_type = get_post_type( $object );
$transformer_mapping = \get_option( 'activitypub_transformer_mapping', self::DEFAULT_TRANSFORMER_MAPPING );
$transformer_name = $transformer_mapping[ $post_type ];
$transformer_instance = new ( $this->get_transformers( $transformer_name ) );
$transformer_class = $this->get_transformers( $transformer_name );
$transformer_instance = new $transformer_class();
$transformer_instance->set_wp_post( $object );
return $transformer_instance;
case 'WP_Comment':