草庐IT

Declaration

全部标签

php - 接口(interface)实现: declaration must be compatible

我有界面:interfaceAbstractMapper{publicfunctionobjectToArray(ActiveRecordBase$object);}和类:classActiveRecordBase{...}classProductextendsActiveRecordBase{...}========但是我不能这样做:interfaceExactMapperimplementsAbstractMapper{publicfunctionobjectToArray(Product$object);}或者这个:interfaceExactMapperextendsAbstr

error-handling - PHP 5.3 : "Declaration of ... should be compatible with that of ..." error

升级到PHP5.3后,我的应用程序被淹没了"Declarationof...shouldbecompatiblewiththatof..."样式错误。我了解这些错误的性质,但我希望禁用它们。error_reportingsettinginphp.ini是"E_ALL&~(E_NOTICE|E_DEPRECATED)",但此错误继续出现。我以为它包含在E_STRICT中,但我错了吗? 最佳答案 这是一个E_STRICT错误。将您的php.ini设置更改为E_ALL&~(E_NOTICE|E_DEPRECATED|E_STRICT)..

php - 将 PHP JSON 传递给 Javascript : echo json_encode vs echo json declaration

我正在尝试创建一个通用常量文件以在php和javascript之间共享,使用JSON来存储常量。但我想知道为什么使用json_encode()将JSON从PHP传递到javascript而不是回显json声明。假设我有PHPJSON谷歌搜索,似乎传回javascript的典型方式是使用然后我相信我必须使用类似$.getScript()的东西来读取php文件以获取$json_obj然后使用parseJSON()使其可用于javascript。但为什么不改为这样你所要做的就是直接加载脚本,你就可以直接使用json了。使用json_encode()然后简单地将声明回显到javascript是

android - 错误 : declaration conflicts with target of using declaration already in scope

我是android构建系统的新手,在MACOS中构建时出现以下错误。请帮助我成功构建。Infileincludedfromexternal/libcxx/src/any.cpp:10:Infileincludedfromexternal/libcxx/include/experimental/any:84:external/libcxx/include/cstdlib:167:44:error:declarationconflictswithtargetofusingdeclarationalreadyinscopeinline_LIBCPP_INLINE_VISIBILITYlong

android - 错误 :(2) Error parsing XML: XML or text declaration not at start of entity android studio

当我试图运行它时,我刚从另一个程序员那里拿走了这个应用程序,它给了我一个错误说:Error:(2)ErrorparsingXML:XMLortextdeclarationnotatstartofentityError:Executionfailedfortask':app:processDebugResources'.com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'C:\Users\ahmad\AppData\Local\A

android - Eclipse 中是否有 "open declaration in layout"的键盘快捷键?

我讨厌当我尝试打开布局声明时Eclipse将我重定向到R文件,这与什么都没有一样。是否有键盘快捷键可以将我带到布局文件。我知道如果您使用CTRL单击它,它会在弹出窗口中为您提供此选项,但我讨厌使用鼠标。我在键绑定(bind)部分找不到这个。只有简单的“开放声明”,我已经更改了它,因为默认情况下它是一个可怕的F3,但这通常会将您带到R文件 最佳答案 好吧,这里有一个鼠标快捷键-只需按住CTRL并将鼠标悬停在您想要查看的ID上。您将获得两种选择,一种用于R.java,另一种用于打开声明。选择第二个编辑:抱歉,完全错过了您不喜欢使用鼠标的

android 为整个项目禁用 lint "unused declaration"

在一个android库项目中,我有许多未使用的声明,因为它们大多是从项目外部调用的。我通过使用lintAnalyze->InspectCode我不想用@SurpressWarning("unused")在每个文件上。如果我尝试在gradle文件中使用相同的ID禁用它android{lintOptions{disable'unused'}}linter仍然出现“未使用的声明”错误我也尝试过在项目根目录下创建lint.xml文件但是还是不行。有人知道正确的lintID吗? 最佳答案 您可以使用Analyze->InspectCode,然

android - 为什么 AndroidStudio 显示警告 "Namespace declaration is never used"?

这是我的布局:取自androidofficialtraining在第二行,AndroidStudio显示了这个警告:Namespacedeclarationisneverused为什么会这样?谢谢。 最佳答案 这是因为您没有在xml中实际声明的tools命名空间。查看android命名空间,您有3个元素具有该命名空间,但没有用于tools的元素。命名空间tools(http://schemas.android.com/tools)用于GUI设计器,不用于在Android设备上运行应用程序,因此您可以安全地删除它。

android - intellij 在 android xml 文件中说 "cannot find declaration to go to"

这个问题在这里已经有了答案:IntelliJcannotfindanydeclarations(35个答案)关闭2年前。当我在themes_holo.xml(Android系统文件)中找到声明时,Intellij告诉我:cannotfinddeclarationtogoto这里是提到的代码:@null@style/DialogWindowTitle.Holo.Light...@style/PreferencePanel.Dialog

c++ - 带有容器和默认分配器的模板模板参数 : can I make my declaration more compact?

我在看这个有趣的话题:https://stackoverflow.com/a/16596463/2436175我的具体案例涉及使用来自opencv的cv::Point_和cv::Rect_的标准容器声明模板函数。我想针对以下模板:我将使用的标准容器类型完成cv::Point_和cv::Rect_定义的基本数据类型我最终做出了以下声明:templateclassContainer_t>voidCreateRects(constContainer_t,std::allocator>>&points,constTvalue,Container_t,std::allocator>>&rects