Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native "callback" type is parsed as "object" #233

Closed
renanbr opened this issue Jun 14, 2015 · 2 comments · Fixed by #358
Closed

native "callback" type is parsed as "object" #233

renanbr opened this issue Jun 14, 2015 · 2 comments · Fixed by #358
Labels

Comments

@renanbr
Copy link

renanbr commented Jun 14, 2015

similar to #232


./phpdox.xml

<?xml version="1.0" encoding="utf-8" ?>
<phpdox xmlns="http://xml.phpdox.net/config">
    <project name="Example" source="${basedir}/src" workdir="${basedir}/build">
        <collector backend="parser" />
    </project>
</phpdox>

./src/MyClass.php

<?php

class MyClass
{
    /**
     * @var callback
     */
    public $callMe;
}

./build/classes/MyClass.xml

<?xml version="1.0" encoding="UTF-8"?>
<class xmlns="http://xml.phpdox.net/src" full="MyClass" namespace="" name="MyClass" abstract="false" final="false" start="3" end="9">
  <file path="/tmp/callback/src" file="MyClass.php" realpath="/tmp/callback/src/MyClass.php" size="83" time="2015-06-14T11:39:25+00:00" unixtime="1434281965" sha1="f41254dde6cfd6b9910270ca796004f45a7645a0" relative="MyClass.php"/>
  <member name="callMe" visibility="public" static="false" line="8">
    <docblock>
      <description/>
      <var type="object">
        <type full="callback" namespace="" name="callback"/>
      </var>
    </docblock>
  </member>
</class>
@theseer
Copy link
Owner

theseer commented Aug 2, 2015

Actually, Callback is not a native type nor defined in any way within PHP.

There is a Callable type that can be used for type hinting and probably should be used in this case as well. I'll leave this bug open as the same problem exists.

theseer added a commit that referenced this issue Aug 2, 2015
MacFJA added a commit to MacFJA/phpdox that referenced this issue Apr 27, 2019
 - Refactoring of types handling
 - Fix issue with last char removed on expression (theseer#313)

Fix theseer#313, Fix theseer#233
theseer pushed a commit that referenced this issue May 10, 2019
 - Refactoring of types handling
 - Fix issue with last char removed on expression (#313)

Fix #313, Fix #233
@theseer
Copy link
Owner

theseer commented May 10, 2019

Scrutinizer found an (Issue)[https://scrutinizer-ci.com/g/theseer/phpdox/inspections/31a9a5b4-42c2-4fad-b4a8-22bb2aafc1f9/issues/files/src/docblock/elements/VarElement.php?status=new&orderField=path&order=asc&honorSelectedPaths=0] after merging.

@MacFJA Can you have a look at that?

@theseer theseer reopened this May 10, 2019
@theseer theseer closed this as completed May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants