src/abstract-plugin.php
private function psr4_get_file_name_from_class( $class ) {
		$class = strtolower( $class );
		if ( stristr( $class, '\\' ) ) {

			// If the first item is == the collection name, trim it off.
			$class = str_ireplace( static::$autoload_class_prefix, '', $class );

			// Maybe fix formatting underscores to dashes and double to single slashes.
			$class     = str_replace( [ '_', '\\' ], [ '-', '/' ], $class );
			$class     = explode( '/', $class );
			$file_name = &$class[ count( $class ) - 1 ];
			$file_name = static::$filename_prefix . $file_name . '.php';
			$file_path = join( DIRECTORY_SEPARATOR, $class );

			return $file_path;
		} else {
			return static::$filename_prefix . str_replace( '_', '-', $class ) . '.php';
		}
	}
private function psr4_get_file_name_from_class( $class ) {
		$class = strtolower( $class );
		if ( stristr( $class, '\\' ) ) {

			// If the first item is == the collection name, trim it off.
			$class = str_ireplace( static::$autoload_class_prefix, '', $class );

			// Maybe fix formatting underscores to dashes and double to single slashes.
			$class     = str_replace( [ '_', '\\' ], [ '-', '/' ], $class );
			$class     = explode( '/', $class );
			$file_name = &$class[ count( $class ) - 1 ];
			$file_name = static::$filename_prefix . $file_name . '.php';
			$file_path = join( DIRECTORY_SEPARATOR, $class );

			return $file_path;
		} else {
			return static::$filename_prefix . str_replace( '_', '-', $class ) . '.php';
		}
	}
private function psr4_get_file_name_from_class ( $ class ) { $ class = strtolower ( $ class ) ; if ( stristr ( $ class , '\\' ) ) { // If the first item is == the collection name, trim it off. $ class = str_ireplace ( static :: $ autoload_class_prefix , '' , $ class ) ; // Maybe fix formatting underscores to dashes and double to single slashes. $ class = str_replace ( [ '_' , '\\' ] , [ '-' , '/' ] , $ class ) ; $ class = explode ( '/' , $ class ) ; $ file_name = & $ class [ count ( $ class ) - 1 ] ; $ file_name = static :: $ filename_prefix . $ file_name . '.php' ; $ file_path = join ( DIRECTORY_SEPARATOR , $ class ) ; return $ file_path ; } else { return static :: $ filename_prefix . str_replace ( '_' , '-' , $ class ) . '.php' ; } }
Take a namespaced class name and turn it into a file name.

@param  string $class The name of the class to load.

@return string
Take a namespaced class name and turn it into a file name .