: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace NinjaForms\Blocks\DataBuilder;
class SubmissionsBuilderFactory {
* @return SubmissionsBuilder
public function make( $formID, $perPage = -1, $page = 0 ) {
'posts_per_page' => $perPage,
$submissions = array_map( function( $post ) {
return array_map( [ self::class, 'flattenPostmeta' ], get_post_meta( $post->ID ) );
return new SubmissionsBuilder( $submissions );
protected static function flattenPostmeta( $postmeta ) {
$postmeta = (array) $postmeta;
return reset( $postmeta );