App method causes PHP Fatal error

I register a simple method on my app/controllers/app.php file

public static function latestTestimonials()
        $posts = new \WP_Query([
            'post_type'         => 'depoimento',
            'posts_per_page'    => '3'
        return $posts;

I call this method inside a partial blade file

Testing the return with @php(var_dump(App::latestTestimonials())) show the object correctly. But when I try to run the loop:

@while(App::latestTestimonials()->have_posts()) @php(App::latestTestimonials()->the_post())
  <div @php(post_class('col-sm-4'))>

debug.log report PHP Fatal error:

Allowed memory size of 134217728 bytes exhausted

OK, I solved the problem converting the method from a static function to a public function. I don’t konwn this is the best approach, but now I can reuse this method in multiples pages.