PHP中是否有一种方法可以覆盖扩展该接口的接口中的一个接口声明的方法?
这个例子:
我可能做错了什么,但这就是我所拥有的:
interface iVendor{
public function __construct($vendors_no = null);
public function getName();
public function getVendors_no();
public function getZip();
public function getCountryCode();
public function setName($name);
public function setVendors_no($vendors_no);
public function setZip($zip);
public function setCountryCode($countryCode);
}
interface iShipper extends iVendor{
public function __construct($vendors_no = null, $shipment = null);
public function getTransitTime($shipment = null);
public function getTransitCost($shipment = null);
public function getCurrentShipment();
public function setCurrentShipment($shipment);
public function getStatus($shipment = null);
}
Run Code Online (Sandbox Code Playgroud)
通常在PHP中,当你扩展某些东西时,你可以覆盖其中包含的任何方法(对吗?).但是,当一个界面延伸到另一个界面时,它不会让你.除非我正在考虑这个错误...当我实现iShipper接口时,我不必使Shipper对象扩展Vendor对象(实现iVendor接口).我只想说:
class FedEx implements iShipper{}
Run Code Online (Sandbox Code Playgroud)
并使FedEx实现iVendor和iShipper的所有方法.但是,我需要__constructiVendor和iShipper中的功能是独一无二的.我知道我可以取出它$shipment = null …
我试图在IE9中获取文件信息,并且由于某种原因我无法获取文件信息.
我的代码出了什么问题?我试图将其分解为最简单的例子.这适用于Chrome,但不是IE:
<input name="file" type="file" onpropertychange="alert(this.files);" onchange="alert(this.files);" />
Run Code Online (Sandbox Code Playgroud) 在下面的JS(es6)代码中,带有冒号的花括号里面的变量是怎么回事?
const { foo: bar } = ...
Run Code Online (Sandbox Code Playgroud)
通常,当您看到它时,它会从右到左进行变量赋值,就像在对象中一样.在对象中,它会将变量分配给bar对象键foo,但这似乎不是这里发生的事情.这是做什么的?
如何在 Slack Block Kit 中的 Slack Markdown 块中建立链接?
我已经尝试过我习惯使用的降价方法:
This is a [link](https://www.stackoverflow.com)
Run Code Online (Sandbox Code Playgroud)
但这是行不通的。