protected function getParentClass(PackageClass $package_class)
    {
        try {
            $base_class = new \ReflectionClass($package_class->getName());
        } catch (\ReflectionException $e) {
            return null;
        }
        if (false === ($parent_reflection = $base_class->getParentClass())
            || dirname($parent_reflection->getFileName()) !== dirname($base_class->getFileName())
        ) {
            return null;
        }

        return new PackageClass($parent_reflection->getName(), $parent_reflection->getFileName());
    }