original_string: protected function loadComponents($paths)
      {
          $paths = array_unique(is_array($paths) ? $paths : (array) $paths);
  
          $paths = array_filter($paths, function ($path) {
              return is_dir($path);
          });
  
          if (empty($paths)) {
              return;
          }
  
          $namespace = $this->app->getNamespace();
  
          foreach ((new Finder())->in($paths)->exclude('Observers')->files() as $file) {
              $class = trim($namespace, '\\') . '\\'
                  . str_replace(
                      ['/', '.php'],
                      ['\\', ''],
                      Str::after(
                          realpath($file->getPathname()),
                          app_path() . DIRECTORY_SEPARATOR
                      )
                  );
  
              if (is_subclass_of($class, Component::class)
                  && ! (new \ReflectionClass($class))->isAbstract()
              ) {
                  $this->registerComponent($class);
              }
          }
      }
code: protected function loadComponents($paths)
      {
          $paths = array_unique(is_array($paths) ? $paths : (array) $paths);
  
          $paths = array_filter($paths, function ($path) {
              return is_dir($path);
          });
  
          if (empty($paths)) {
              return;
          }
  
          $namespace = $this->app->getNamespace();
  
          foreach ((new Finder())->in($paths)->exclude('Observers')->files() as $file) {
              $class = trim($namespace, '\\') . '\\'
                  . str_replace(
                      ['/', '.php'],
                      ['\\', ''],
                      Str::after(
                          realpath($file->getPathname()),
                          app_path() . DIRECTORY_SEPARATOR
                      )
                  );
  
              if (is_subclass_of($class, Component::class)
                  && ! (new \ReflectionClass($class))->isAbstract()
              ) {
                  $this->registerComponent($class);
              }
          }
      }
code_tokens: protected function loadComponents ( $ paths ) { $ paths = array_unique ( is_array ( $ paths ) ? $ paths : ( array ) $ paths ) ; $ paths = array_filter ( $ paths , function ( $ path ) { return is_dir ( $ path ) ; } ) ; if ( empty ( $ paths ) ) { return ; } $ namespace = $ this -> app -> getNamespace ( ) ; foreach ( ( new Finder ( ) ) -> in ( $ paths ) -> exclude ( 'Observers' ) -> files ( ) as $ file ) { $ class = trim ( $ namespace , '\\' ) . '\\' . str_replace ( [ '/' , '.php' ] , [ '\\' , '' ] , Str :: after ( realpath ( $ file -> getPathname ( ) ) , app_path ( ) . DIRECTORY_SEPARATOR ) ) ; if ( is_subclass_of ( $ class , Component :: class ) && ! ( new \ ReflectionClass ( $ class ) ) -> isAbstract ( ) ) { $ this -> registerComponent ( $ class ) ; } } }
docstring: Load component class from the paths
  
  @param mixed $paths
  @throws \ReflectionException
docstring_tokens: Load component class from the paths