PhpDocumentor strange error: "Only variables should be passed by reference ..." - phpdoc

I'm using PhpDocumentor (1.4.4) & NetBeans (7.1). When I generate the php documentation I get an error/warning on the top of the documentation (and in documentation in certain places too):
"Strict Standards: Only variables should be passed by reference in ..."
Does anybody know why is this problem?
Formerly (not on this computer) I didn't get this message.

The root cause here is that phpDocumentor itself if PHP4 code. I'm guessing you are executing it on PHP5, and are thus seeing runtime notices based on your error reporting level in php.ini.
This is nothing to worry about with regard to using phpDocumentor, nor is it something to worry about in your source code that you are documenting.

PHP Documentation states:
The following things can be passed by reference:
- Variables, i.e. foo($a)
- New statements, i.e. foo(new foobar())
- References returned from functions
No other expressions should be passed by reference, as the result is undefined.
This has been the case since PHP 4.0.4. Most likely your source code is out-dated and needs changes.

At last the solution:
I used smarty themes (HTML:Smarty:*) and there was no errors.
Solved.

Related

Dependency declaration error in ANTLR 4.10.1

It seems there is a conflict of version for the antlr-runtime lib pulled by ANTLR 4.10.1: 3.5.2 versus 3.5.3.
Here is the gradle analyze result:
Antlr team can you confirm please?
The issue has been raised on project's github:
https://github.com/antlr/antlr4/issues/3733
I stumbled across this issue attempting to use ANTLR4 in a PHP environment.
While the issue still exists afaik (I'm on PHP7.4.3 and upgrading to PHP8 is not an option for me so it may work fine on later versions of PHP).
My workaround went as follows:
generated the php code using antlr as instructed here: https://github.com/antlr/antlr-php-runtime
discovered errors where the runtime version does not match the generated code
went to github and found the following codechanges: https://github.com/antlr/antlr-php-runtime/pull/23/files
made these changes by hand in the runtime files in vendor/antlr/antlr4-php-runtime/src/
This got my code communicating the same ATN type between classes (the first of the differences between the runtime version and my generated classes). But walking my grammar gave me another error - probably another difference between runtime and generated versions.
The code for this one was in the antlr/antlr4 repo instead of the antlr-php-runtime repo:
I found issue "PHP target runtime crashes with "Undefined offset: 0 in ATNDeserializer.php on line 731" #3509
(https://github.com/antlr/antlr4/issues/3509)
In the posts, the last commenter (kaby76) includes a zipfile called "Generated.zip" that contains the generated source code as it is supposed to look like.
I downloaded and extracted the files here. My error was occurring in ATNDeserializer.php and I found that the sourcecode from Kaby's zipfile did not include the ATN fixes I described above but it did contain the addition of IsFeatureSupported.
Since my grammar does not produce the indicated ADDED_UNICODE_SMP, I just commented that portion out in the deserialize function:
...
// First, deserialize sets with 16-bit arguments <= U+FFFF.
$this->readSets($sets, function () {
return $this->readInt();
});
// Next, if the ATN was serialized with the Unicode SMP feature,
// deserialize sets with 32-bit arguments <= U+10FFFF.
/*
if ($this->isFeatureSupported(self::ADDED_UNICODE_SMP, $this->uuid)) {
$this->readSets($sets, function () {
return $this->readInt32();
});
}
*/
$this->readEdges($atn, $sets);
...
Although this got me working, it is a workaround and not recommended as a long-term solution.

phpDocumentor 2 web interface error "Strict standards: declaration of xxx should be compatible..."

I'm attempting to use the phpDocumentor web interface to generate documentation for a CodeIgniter project. When I attempt to parse the directory, I get a long list of "Strict standards" errors that all look like this
"Strict standards: Declaration of parserTag::getString() should be compatible with parserStringWithInlineTags::getString($trim = true) in D:\wamp\www\phpdoc\phpDocumentor\DocBlockTags.inc on line 185"
"Strict standards: Declaration of phpDocumentorTParser::packageTagHandler() should be compatible with Parser::packageTagHandler($word) in D:\wamp\www\phpdoc\phpDocumentor\phpDocumentorTParser.inc on line 2945"
"Strict standards: Declaration of phpDocumentor_TutorialHighlightParser::setupStates() should be compatible with Parser::setupStates() in D:\wamp\www\phpdoc\phpDocumentor\TutorialHighlightParser.inc on line 527"
Can anyone tell me what would cause this, or whether it's related to the phpdoc installation or something else?
phpDocumentor 1.x is php4 code, and so running it on newer versions (especially 5.3+) triggers many such notices and warnings. You can lower your error reporting threshold to hide them, but a better option for newer PHP code is to try phpDocumentor 2.x, which is in beta right now.
As for these notices having a negative effect on the docs you generate using 1.x, your docs should be fine. Those particular notices are not failures of any kind.

ASP.Net Library name conflict between Ektron app_code and library

I've got an Ektron 8.2 site, and I was trying to integrate Quartz.NET into it, in order to run some scheduling. Quartz.NET requires a library Common.Logging. This library introduces a conflict and breaks the Ektron code in App_Code/VBCode.
E.g. the following code from Utilities.vb
Case Is = Common.EkEnumeration.FolderType.Community
imageURL &= "images/ui/icons/folderCommunity.png"
Case Common.EkEnumeration.FolderType.Catalog
imageURL &= "images/ui/icons/folderGreen.png"
now gives a compile time error-
App_Code\VBCode\Utilities.vb(703,0): error BC30456: 'EkEnumeration' is not a member of 'Common'.
It appears that Common.Logging is conflicting with Ektron.Cms.Common (the Ektron files have a Imports Ektron.Cms statement). Is it possible to specify the priority on libraries? Or namespace an imported library?
Update
The Utilities.vb code is written by Ektron. I'd like to either make no changes to this code, or minimal changes, as any changes would need to be re-done upon Ektron upgrades. This is really a clash between 2 libraries - Ektron and Quartz.Net. Can I resolve this clash without changing the code of either library? Is there a configuration setting for aliasing libraries?
A simple solution is to use the full namespace, Ektron.Cms.Common.EkEnumeration, rather than relying on the include to sort things out automatically.
I.e.
Case Is = Ektron.Cms.Common.EkEnumeration...
Not elegant, but should get you working again.
Another alternative is to use a namespace alias:
using EkCommon = Ektron.Cms.Common;
So your code would instead look like:
EkCommon.EkEnumeration.FolderType.Community

vb6 user-defined type not defined error on full compile

I have some vb6 code I have not compiled in a long time. The last compile is in production. Now I get an error "User-defined type is not defined" when I do a full compile. I'm sure there is a reference missing. But there is no code that is hi-lighted. And I cannot seem to find what reference might be lost.
Any clues as to what I can do to find the missing reference would be very helpful.
Thanks!
Dave
I've had that happen before it drove me crazy!! But then I found this:
 
http://support.microsoft.com/kb/190197
 
Occurs when compiling with binary compatibility on. The above solution suggests turning off binary compatibility and re-compiling - then missing reference will then be highlighted.
Other steps you can try:
Rather than turning off BC for everything look for ones that have
been recently changed
search C: drive and dev folder and delete any
*.oca files
also look in the vbp file for any oca references
You need to ensure that you have the appropriate items checked in the References dialog. This is outside the code and they are listed in the VBP file (text file).
EDIT Corrected reference storage. Thanks MarkJ
Make sure all of your object types are spelled right. A simple error like spelling Variant Varient can cause this error as well.
Are you still using the same machine in which the original compile was made and / or with the same OS
?
If the answer is no, then there is a chance that VB6 or its like linked to a reference which is no longer available in Win7 or later, this may also include the compiler if you are using a modern version of studio.
Since the code is also in VB6, if you are using any outside commercial controls, and again if not on the same machine, you would loose those links as well if you did not port over the library.

VB6 type mismatch error

I am getting the following type mismatch error on the following
IF obj.propery THEN
...
END IF
the code I am using is on visual source safe and when other developers run the same project the code runs with no error. The property is actually a string which is where the problem could be. When I debug and test the property i.e.
?obj.propery = True
no errors are thrown which is a bit strange. If I place the cursor over the property it says "True". I have done a bit of searching on the matter and have found that this may have something to do with OPTION STRICT, however I have the same version of the code as the other developers and OPTION STRICT is not OFF, it hasn't been altered in the code at all. Are there any other settings that could affect this execution of code at run time?
It strikes me that there could be an entirely different reason for your Type Mismatch error, especially as you are accessing an object property. I've experienced this error when I have, for some reason, been pointing at a different DLL to that registered. You will find with VB that it registers a DLL "on the fly" when you build it, so you may end up accessing the code somewhere that you did not expect. This may not be the problem in your case, but it is worth exploring.
This was nothing to do with VB6, it was to do with XP Mode and using my user account from another domain as opposed to XPMUser. When I use XPMUser the application runs this is very odd and I am not sure why this is. If anyone has the reason I would love to hear.
So you are sure this is not the case of a boolean being Vrai?
I'd be inclined to be more explicit in your IF condition
IF isempty(obj.property) = false AND isnull(obj.property) = false
BUT
it would be prudent to check that obj isn't null first, before you start accessing its properties....

Resources