- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
PHP中有一种NotImplementedError吗?
我想将这些添加到一些 stub 方法和接口(interface)中,以警告扩展我的类,它们仍有工作要做。还是在 PHP 中实现的方式不同?
最佳答案
PHP 没有内置的 NotImplementedException
但是欢迎您创建自己的。我想BadMethodCallException
接近了,这将是一个不错的扩展候选人
class NotImplementedException extends BadMethodCallException
{}
...在你的方法中
public function notImplementedMethod()
{
throw new NotImplementedException();
}
你也可以很简单地做这样的事情
throw new Exception('Not implemented');
关于php - 在 PHP 中抛出 NotImplementedError?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8092886/
我正在使用以下 gem 作为编辑器。 gem "wysihat-engine", "~> 0.1.13" 当我运行“rails generate wysihat”时,它会生成所有图像文件,但无法生成迁
我的Scrapy代码无效。我正在尝试抓取论坛,但收到错误。 这是我的代码: import scrapy, time class ForumSpiderSpider(scrapy.Spider):
为什么 gevent 会抛出这个错误?在 ipython、ubuntu 13 中运行它 In [1]: from gevent import monkey In [2]: monkey.patch_a
如何将 instance 属性标记为未在基类中实现? (与讨论将 class 属性标记为未实现的 this 问题不同,但也许我没有正确理解基类...) 例如我想要类似的东西 class Base():
系统信息 python 3.8.7 操作系统 11.1(大苏尔) 通过 brew install python@3.8 安装的 Python 要在 Big Sur 和最有可能的旧版本上重现: impo
我正在阅读一篇关于布隆过滤器的文章,https://en.wikipedia.org/wiki/Bloom_filter ,其中一个表达式是为散列函数的最佳数量导出的。我想重现 m 的简化情况的计算=
我正在尝试使用 ActiveJob将诸如电子邮件调度之类的作业排队,但我得到一个 NotImplementedError (Use a queueing backend to enqueue jobs
我需要实现一个具有数百种方法的接口(interface)(ResultSet)。 现在,我将只实现这些方法的一个子集,抛出 NotImplementedError为其他人。 在 Java 中,我找到了
这是我的代码: package example object Lists { def max(xs: List[Int]): Int = { if(xs.isEmpty){
我正在使用 django 和 Google App Engine。我无法确定错误来自哪里,因为如果我在本地使用它,我的网站就会正常运行。在我将其部署到 GAE 上之后,它工作正常,但是当使用 goog
import torch import torch.nn as nn device = torch.device('cuda' if torch.cuda.is_available() else 'c
我的 scrapy 代码不工作,我不知道!我想抓取宜家网站,我首先设计了一个 CrawlSpider,它不够具体,无法检索网页的每个链接。所以我设计了一个带有 yield 请求方法的基本 Spider
是为了提醒你自己和你的团队正确实现类(class)吗?我没有完全使用这样的抽象类: class RectangularRoom(object): def __init__(self, widt
尝试在本地预编译 Assets 时出现以下问题 RAILS_ENV=production bundle exec rake assets:precompile rake aborted! Sprock
在我的 Rails 应用程序 (4.2.4) 中,我一直在尝试让异步邮件发送工作。 我安装了 delay_job 作为我的队列适配器,并在几个地方将它设置为适配器:config/application
这个问题在这里已经有了答案: Jupyter Notebook with Python 3.8 - NotImplementedError (4 个答案) 关闭 3 年前。 尝试在本地主机上构建 j
我在 azure 上上传时遇到问题 https://learn.microsoft.com/pl-pl/azure/machine-learning/how-to-access-data-intera
我想使用 pandas 中的 fillna 命令来估算数据帧。这是我的代码片段: import glob import pandas as pd files=glob.glob("IN.201*.cs
服务器JSON使用retrofit2和rxjava2进行数据解析。转到CompanyAdapter类时,数据获取并成功存储在List中,然后给出上述错误。 MainActivity.kt priva
我想使用 pandas 中的 fillna 命令来估算数据帧。这是我的代码片段: import glob import pandas as pd files=glob.glob("IN.201*.cs
我是一名优秀的程序员,十分优秀!