Coder Social home page Coder Social logo

Comments (4)

julien-boudry avatar julien-boudry commented on July 17, 2024

Hi @toddy15

Actually, I never need to use the corresponding attribute class (static or object). I must declare them with use keywords, but then, I use reflection based on the class name, to read the value of the attribute; so PHP never needs to load the corresponding class. It's used only for documentation generation.

PHP 8 allows it. If there is a PSR for attributes class, properties for documentation, probably I will use it instead. But there is not yet, so I have build a custom system.

from condorcet.

julien-boudry avatar julien-boudry commented on July 17, 2024

To be more precise : The use it only for using then alias. If I don't make the use, then I must do it each time :

#[CondorcetPHP\Condorcet\CondorcetDocAttributes\Description("Get the actual Ranking of this Vote.")] #[CondorcetPHP\Condorcet\CondorcetDocAttributes\FunctionReturn("Multidimenssionnal array populated by Candidate object.")] #[CondorcetPHP\Condorcet\CondorcetDocAttributes\Related("Vote::setRanking")] public function getRanking () : array { return $this->_ranking; }

from condorcet.

toddy15 avatar toddy15 commented on July 17, 2024

Yes, I see, it does not make sense to use that long form for the attributes. However, it seems to me that creating minimal classes for attributes is recommended by PHP, see https://www.php.net/manual/en/language.attributes.classes.php for details.

I've just created PR #39 with new classes, please take a look and decide if that works for you.

from condorcet.

julien-boudry avatar julien-boudry commented on July 17, 2024

#39 is merged

from condorcet.

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.