GithubHelp home page GithubHelp logo

Comments (12)

rob006 avatar rob006 commented on July 28, 2024 2

It is better to integrate documentation generation into tests - apidoc could detect much more bugs than just getters collision.

from yii-console.

rob006 avatar rob006 commented on July 28, 2024 2

Apidoc can detect getter collisions, so there is no point to create separate tool for that.

from yii-console.

cebe avatar cebe commented on July 28, 2024 1

I think we should avoid conflicting methods and properties so a rename in 2.1 should be made.
We could also fix the apidoc but it is still confusing for users so I'd prefer not introducing such cases in the first place. I'd also like to make the error checking part of the travis build so we spot these directly when making a change.

from yii-console.

samdark avatar samdark commented on July 28, 2024

Re-checked it. It is unlikely to cause any issues because both method and property are used directly.

from yii-console.

rob006 avatar rob006 commented on July 28, 2024

@samdark This creates glitches in documentation: http://www.yiiframework.com/doc-2.0/yii-console-controller.html#$help-detail

We could at least fix this in 2.1 by renaming getHelp() to getHelpInfo()

from yii-console.

rob006 avatar rob006 commented on July 28, 2024

There is more issues like that, so this probably will be easier to fix in apidoc extension...

Search conflicts with a defined getter in https://github.com/rob006/yii2-doc/blob/17aa8f7def035d9403db7f07fe454e7bcd0b183e/errors.txt

from yii-console.

samdark avatar samdark commented on July 28, 2024

@cebe what do you think?

from yii-console.

SamMousa avatar SamMousa commented on July 28, 2024

We could create a test for this framework wide:

  1. Iterate over all classes.
  2. Reflect over their properties and methods.
  3. Fail the test if we find a collision.

Not sure what suite that would belong in, but it makes sense to have these kinds of tests.

from yii-console.

SamMousa avatar SamMousa commented on July 28, 2024

Yes, I'm thinking more broadly than just documentation generation though.
Regardless of documentation, getter collision is an issue even if we could properly document it.

from yii-console.

SamMousa avatar SamMousa commented on July 28, 2024

What about tests like usage of super globals? (Which you would want to limit only certain files via some whitelist)

from yii-console.

samdark avatar samdark commented on July 28, 2024

Good idea as well.

from yii-console.

cebe avatar cebe commented on July 28, 2024

Apidoc can detect getter collisions, so there is no point to create separate tool for that.

it already does that: https://github.com/yiisoft/yii2-apidoc/blob/f66d08f2b8f6ed835f1fa92087c1594e1d3677f7/models/Context.php#L385 We just need to integrate that into CI.

from yii-console.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.