@param  string  $fq_classlike_name
@param  string|null $file_path
@param  string|null $file_contents

@return ClassLikeStorage
198427
public function exhume($fq_classlike_name, $file_path, $file_contents)
    {
        $fq_classlike_name_lc = strtolower($fq_classlike_name);

        if (isset(self::$storage[$fq_classlike_name_lc])) {
            return self::$storage[$fq_classlike_name_lc];
        }

        if (!$this->cache) {
            throw new \LogicException('Cannot exhume when there’s no cache');
        }

        $cached_value = $this->cache->getLatestFromCache($fq_classlike_name_lc, $file_path, $file_contents);

        self::$storage[$fq_classlike_name_lc] =  $cached_value;
        self::$new_storage[$fq_classlike_name_lc] =  $cached_value;

        return $cached_value;
    }
398145
public function getReportingLevelForClass($issue_type, $fq_classlike_name)
    {
        if (isset($this->issue_handlers[$issue_type])) {
            return $this->issue_handlers[$issue_type]->getReportingLevelForClass($fq_classlike_name);
        }
    }
574078
public static function ClassPathToRealFilePath ($class_path, $class_file_ext = self::CLASS_FILE_EXT) {
		return static::$_VendorRootDir . str_replace(static::NAMESPACE_SEPARATOR, '/', $class_path) . $class_file_ext;
	}
234791
private final static function getInstance($fqcn, $name)
    {
        $instances = self::getInstances($fqcn);

        if (!isset($instances[$name])) {
            return null;
        } else {
            return $instances[$name];
        }
    }
89270
public function getClassLikeStorageForMethod($method_id)
    {
        list($fq_class_name, $method_name) = explode('::', $method_id);

        if ($this->existence_provider->has($fq_class_name)) {
            if ($this->existence_provider->doesMethodExist(
                $fq_class_name,
                $method_name,
                null,
                null
            )) {
                return $this->classlike_storage_provider->get($fq_class_name);
            }
        }

        $declaring_method_id = $this->getDeclaringMethodId($method_id);

        if (!$declaring_method_id) {
            if (CallMap::inCallMap($method_id)) {
                $declaring_method_id = $method_id;
            } else {
                throw new \UnexpectedValueException('$storage should not be null for ' . $method_id);
            }
        }

        list($declaring_fq_class_name) = explode('::', $declaring_method_id);

        return $this->classlike_storage_provider->get($declaring_fq_class_name);
    }
157328
public static function load ($class_name)
	{
		$file_name = str_replace(self::MOLLIE_PREFIX, '', strtolower($class_name), $count);
		if (empty($count)) {
			return;
		}

		if (file_exists($file_name = __DIR__ . DIRECTORY_SEPARATOR . "$file_name.php")) {
			require $file_name;
		}
	}
434347
private function getCacheLocationForPath($file_path, $create_directory = false)
    {
        $root_cache_directory = $this->config->getCacheDirectory();

        if (!$root_cache_directory) {
            throw new \UnexpectedValueException('No cache directory defined');
        }

        $parser_cache_directory = $root_cache_directory . DIRECTORY_SEPARATOR . self::FILE_STORAGE_CACHE_DIRECTORY;

        if ($create_directory && !is_dir($parser_cache_directory)) {
            mkdir($parser_cache_directory, 0777, true);
        }

        return $parser_cache_directory
            . DIRECTORY_SEPARATOR
            . sha1($file_path)
            . ($this->config->use_igbinary ? '-igbinary' : '');
    }
1066612
public function uploadFileByFile(UploadedFile $file_request, $fieldName, $classFileString) {
        $file_content = file_get_contents($file_request->getPathname());
        $file_extension = $file_request->getClientOriginalExtension();

        $file_app_object = $this->writeFileBytes($file_content, $file_extension, $fieldName, $classFileString);
        $this->em->persist($file_app_object);
        $this->em->flush();

        return $file_app_object;
    }
1171915
private function loadFromCache($file_path)
    {
        $cache_location = $this->getCacheLocationForPath($file_path);

        if (file_exists($cache_location)) {
            if ($this->config->use_igbinary) {
                $storage = igbinary_unserialize((string)file_get_contents($cache_location));

                if ($storage instanceof FileStorage) {
                    return $storage;
                }

                return null;
            }

            $storage = unserialize((string)file_get_contents($cache_location));

            if ($storage instanceof FileStorage) {
                return $storage;
            }

            return null;
        }

        return null;
    }
925123
public static List<String> readFileFromClassPathAsList(String _fileName) {
    	List<String> result = readFileFromClassPathAsList(_fileName, Charset.defaultCharset(), false);
        return result == null ? new ArrayList<String>() : result;
    }
327708
public function classOrInterfaceExists($fq_class_name, CodeLocation $code_location = null)
    {
        return $this->classlikes->classOrInterfaceExists($fq_class_name, $code_location);
    }
798810
public function _fetchContents( $filePath, $fname = false )
    {
        if ( $fname )
            $fname .= "::_fetchContents($filePath)";
        else
            $fname = "_fetchContents($filePath)";
        $metaData = $this->_fetchMetadata( $filePath, $fname );
        // @todo Throw an exception
        if ( !$metaData )
        {
            eZDebug::writeError( "File '$filePath' does not exist while trying to fetch its contents.", __METHOD__ );
            return false;
        }

        // @todo Catch an exception
        if ( !$contents = $this->dfsbackend->getContents( $filePath ) )
        {
            eZDebug::writeError("An error occurred while reading contents of DFS://$filePath", __METHOD__ );
            return false;
        }
        return $contents;
    }
429961
private function populateClassLikeStorage(ClassLikeStorage $storage, array $dependent_classlikes = [])
    {
        if ($storage->populated) {
            return;
        }

        $fq_classlike_name_lc = strtolower($storage->name);

        if (isset($dependent_classlikes[$fq_classlike_name_lc])) {
            if ($storage->location && IssueBuffer::accepts(
                new CircularReference(
                    'Circular reference discovered when loading ' . $storage->name,
                    $storage->location
                )
            )) {
                // fall through
            }

            return;
        }

        $storage_provider = $this->classlike_storage_provider;

        $this->populateDataFromTraits($storage, $storage_provider, $dependent_classlikes);

        $dependent_classlikes[$fq_classlike_name_lc] = true;

        if ($storage->parent_classes) {
            $this->populateDataFromParentClass($storage, $storage_provider, $dependent_classlikes);
        }

        if (!strpos($fq_classlike_name_lc, '\\')
            && !isset($storage->methods['__construct'])
            && isset($storage->methods[$fq_classlike_name_lc])
            && !$storage->is_interface
            && !$storage->is_trait
        ) {
            $storage->methods['__construct'] = $storage->methods[$fq_classlike_name_lc];
        }

        $this->populateInterfaceDataFromParentInterfaces($storage, $storage_provider, $dependent_classlikes);

        $this->populateDataFromImplementedInterfaces($storage, $storage_provider, $dependent_classlikes);

        if ($storage->location) {
            $file_path = $storage->location->file_path;

            foreach ($storage->parent_interfaces as $parent_interface_lc) {
                $this->file_reference_provider->addFileInheritanceToClass($file_path, $parent_interface_lc);
            }

            foreach ($storage->parent_classes as $parent_class_lc => $_) {
                $this->file_reference_provider->addFileInheritanceToClass($file_path, $parent_class_lc);
            }

            foreach ($storage->class_implements as $implemented_interface) {
                $this->file_reference_provider->addFileInheritanceToClass(
                    $file_path,
                    strtolower($implemented_interface)
                );
            }

            foreach ($storage->used_traits as $used_trait_lc => $_) {
                $this->file_reference_provider->addFileInheritanceToClass($file_path, $used_trait_lc);
            }
        }

        if ($storage->internal
            && !$storage->is_interface
            && !$storage->is_trait
        ) {
            foreach ($storage->methods as $method) {
                $method->internal = true;
            }

            foreach ($storage->properties as $property) {
                $property->internal = true;
            }
        }

        $this->populateOverriddenMethods($storage);

        if ($this->debug_output) {
            echo 'Have populated ' . $storage->name . "\n";
        }

        $storage->populated = true;
    }
58838
public static function SendFile ($file_path, $file_name = null, $mime_type = null, $options = []) {
		//==============================================
		//オプション展開
		//==============================================
		$filename_from_charset	= $options['from_charset']			?? Encoding::UTF_8;
		$filename_to_charset	= $options['to_charset']			?? Encoding::SJIS;
		$chunk_size				= $options['chunk_size']			?? static::CHUNK_SIZE;
		$content_disposition	= $options['content_disposition']	?? static::CONTENT_DISPOSITION_ATTACHMENT;

		//==============================================
		//ファイル存在確認
		//==============================================
		if (($status = FileSystem::IsReadableFile($file_path, $options)) !== true) {
			return $status;
		}

		//==============================================
		//ファイル情報取得
		//==============================================
		$file_size = filesize($file_path);

		//==============================================
		//ファイル名確定
		//==============================================
		$file_name = $file_name ?: basename($file_path);

		//==============================================
		//mime type確定
		//==============================================
		if ($mime_type === null) {
			$ext = pathinfo($file_name, \PATHINFO_EXTENSION);
			$mime_type = isset(self::GetMimeTypeMapForExt()[$ext]) ? self::GetMimeTypeMapForExt()[$ext] : self::MIME_TYPE_BINARY;
		}

		//==============================================
		//ファイル送信開始
		//==============================================
		//HTTP ResponseHeaderの出力
		foreach (static::GetHttpHeaderContentDispositionAttachment(
			$file_name,
			$file_size,
			$mime_type,
			$content_disposition,
			$filename_to_charset,
			$filename_from_charset
		) as $header) {
			header(str_replace(["\r", "\n"], '', $header));
		}

		//----------------------------------------------
		//実処理の開始
		//----------------------------------------------
		//既存の出力を全て送信
		OutputBuffer::Clean();
		flush();

		//file pointer open
		$fp = fopen($file_path, 'rb');

		//timeout引き延ばし処理：実行開始秒
		$split_time = time();

		//チャンクサイズごとに送信
		while (!feof($fp)) {
			print fread($fp, $chunk_size);
			flush();

			//3秒以上経過ごとにタイムリミットを延長する
			if (time() - $split_time > 3) {
				set_time_limit(time() - $split_time);
			}
		}

		//==============================================
		//処理の終了
		//==============================================
		fclose($fp);
	}
759109
private function getFirstClassNameInFile(File $file): ?string
    {
        $position = $file->findNext(T_CLASS, 0);

        if ($position === false) {
            return null;
        }

        $fileClassName = ClassHelper::getFullyQualifiedName($file, $position);

        return ltrim($fileClassName, '\\');
    }
1256569
public function get_file_info($component, $filearea, $itemid, $filepath, $filename) {
        global $DB;

        if (!core_course_category::can_view_category($this->category)) {
            if (empty($component)) {
                // we can not list the category contents, so try parent, or top system
                if ($this->category->parent and $pc = $DB->get_record('course_categories', array('id'=>$this->category->parent))) {
                    $parent = context_coursecat::instance($pc->id, IGNORE_MISSING);
                    return $this->browser->get_file_info($parent);
                } else {
                    return $this->browser->get_file_info();
                }
            }
            return null;
        }

        if (empty($component)) {
            return $this;
        }

        $methodname = "get_area_{$component}_{$filearea}";
        if (method_exists($this, $methodname)) {
            return $this->$methodname($itemid, $filepath, $filename);
        }

        return null;
    }
1077516
def classes_from_path(dir_path)
      Dir["#{dir_path}/*.rb"].sort.inject({ }) do |memo, file_path|
        klass = File.basename(file_path, '.rb').camelize.constantize

        if !memo[klass.kind].nil?
          raise "Kind #{klass.kind} already used by class #{memo[klass.kind]} so can't use it for class #{klass}"
        end

        memo[klass.kind] = klass

        memo
      end
    end