original_string: protected function register_batches(){
  		static $batch_registered = false;
  		if( !$batch_registered ){
  			// Register Batches
  			/** @var AutoLoader $auto_loader */
  			$auto_loader = AutoLoader::get_instance();
  			$root = $auto_loader->namespace_root;
  			$namespace = $auto_loader->namespace;
  			if( $namespace && $root && is_dir($root.'/Batches') ){
  				// Scan directory and find batch children
  				foreach( scandir($root.'/Batches') as $file ){
  					if( preg_match('/\.php$/', $file) ){
  						$class_name = $namespace.'\\Batches\\'.str_replace('.php', '', $file);
  						if( class_exists($class_name) && $this->is_sub_class_of($class_name, Batch::class) ){
  							$this->batches[] = $class_name;
  						}
  					}
  				}
  			}
  			$batch_registered = true;
  		}
  	}
code: protected function register_batches(){
  		static $batch_registered = false;
  		if( !$batch_registered ){
  			// Register Batches
  			/** @var AutoLoader $auto_loader */
  			$auto_loader = AutoLoader::get_instance();
  			$root = $auto_loader->namespace_root;
  			$namespace = $auto_loader->namespace;
  			if( $namespace && $root && is_dir($root.'/Batches') ){
  				// Scan directory and find batch children
  				foreach( scandir($root.'/Batches') as $file ){
  					if( preg_match('/\.php$/', $file) ){
  						$class_name = $namespace.'\\Batches\\'.str_replace('.php', '', $file);
  						if( class_exists($class_name) && $this->is_sub_class_of($class_name, Batch::class) ){
  							$this->batches[] = $class_name;
  						}
  					}
  				}
  			}
  			$batch_registered = true;
  		}
  	}
code_tokens: protected function register_batches ( ) { static $ batch_registered = false ; if ( ! $ batch_registered ) { // Register Batches /** @var AutoLoader $auto_loader */ $ auto_loader = AutoLoader :: get_instance ( ) ; $ root = $ auto_loader -> namespace_root ; $ namespace = $ auto_loader -> namespace ; if ( $ namespace && $ root && is_dir ( $ root . '/Batches' ) ) { // Scan directory and find batch children foreach ( scandir ( $ root . '/Batches' ) as $ file ) { if ( preg_match ( '/\.php$/' , $ file ) ) { $ class_name = $ namespace . '\\Batches\\' . str_replace ( '.php' , '' , $ file ) ; if ( class_exists ( $ class_name ) && $ this -> is_sub_class_of ( $ class_name , Batch :: class ) ) { $ this -> batches [ ] = $ class_name ; } } } } $ batch_registered = true ; } }
docstring: Register Batch classes
docstring_tokens: Register Batch classes