Upgrade from old to sage 10, Class "App\App" not found

I have helpers.php like this:

<?php

namespace App;

function get_article_data( int $article_id, $excerpt_length = 20 ) {
    if ( empty( $article_id ) ) {
        return array();
    }
    $full_excerpt = wp_strip_all_tags( excerpt_remove_blocks( htmlspecialchars_decode( get_the_excerpt( $article_id ) ) ) );
    $particle_excerpt = wp_trim_words(
        $full_excerpt,
        $excerpt_length,
        '...'
    );
    return array(
        'ID' => $article_id,
        'title' => html_entity_decode( get_the_title( $article_id ) ),
        'link' => get_permalink( $article_id ),
        'category' => get_article_primary_category( $article_id ),
        'image' => get_article_thumbnail( $article_id, 'full' ),
        'date_time' => get_the_date( 'M j, Y g:i A', $article_id ),
        'excerpt' => strip_shortcodes( $particle_excerpt ?: wp_trim_excerpt( $particle_excerpt, $article_id ) ),
        'full_excerpt' => strip_shortcodes( $full_excerpt ?: wp_trim_excerpt( $full_excerpt, $article_id ) ),
        'author' => get_article_author( $article_id ),
     
    );
}

and App.php like this:

<?php

namespace App\View\Composers;

use Roots\Acorn\View\Composer;

use function App\get_article_data;

class App extends Composer {

public static function articlePost( $post_id ) {
        
        return get_article_data( $post_id );
    }

and in blade file:

<div class="category">
          @while (have_posts())
            @php the_post();  $article_post = App\View\Composers\App::articlePost(get_the_ID());
            @endphp
            
          @endwhile
          
        </div>

and the browser has error like this:

lass &quot;App\App&quot; not found (View: /Volumes......... list.blade.php) (500 Internal Server Error) 

I have not a Wordpress developer, and a long time ago I have not work with wordpress and sage. Please help me. Thank you so much!

Has this project been previously developed on a Windows filesystem (case insensitive)? Are the directory- and filenames in lowercase, e.g. app/ instead of App/ and app.php instead of App.php? When PHP tries to use the folder-/file-structure (as by the autoloader) on a then case-sensitive filesystem (as usually the case with *nix systems), the folders/files may not be found.

No, It’s been developed on Ubuntu. Now I dev it on a macos.
I have a function secondTitle above articlePost function and It’s OK. I do not know why.

I think the reason in function get_article_data. Because I tried return in this function and there is no error.