Coder Social home page Coder Social logo

spiral / attributes Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 4.0 7.51 MB

PHP Attributes Reader. Subtree split of the Spiral Attributes component (see spiral/framework)

Home Page: https://spiral.dev

License: MIT License

PHP 100.00%
annotations attributes metadata php reader

attributes's Introduction


Github cover spiral application


Documentation · Discord · Twitter

Spiral Framework is a High-Performance Long-Living Full-Stack framework and group of over sixty PSR-compatible components. The Framework execution model based on a hybrid runtime where some services (GRPC, Queue, WebSockets, etc.) handled by RoadRunner application server and the PHP code of your application stays in memory permanently (anti-memory leak tools included).

Features

  • Battle-tested since 2013
  • Lightning fast full-stack PHP framework
  • PSR-{3,4,7,11,12,14,15,16,17} compliant
  • Powerful application server and resident memory application kernel
  • Native support of queue (AMQP, SQS, Beanstalk, Kafka) and background PHP workers
  • Queue supervision
  • GRPC server and client via RoadRunner bridge
  • Pub/Sub, event broadcasting
  • HTTPS, HTTP/2+Push, FastCGI
  • PCI DSS compliant
  • Encrypted cookies, signed sessions, CSRF-guard
  • MySQL, MariaDB, SQLite, PostgreSQL, SQLServer support, auto-migrations
  • The ORM you will use for the next 25 years
  • The Temporalio is the simple, scalable open source way to write and run reliable workflows
  • Intuitive scaffolding and prototyping (it literally writes code for you)
  • Helpful class discovery via static analysis
  • Authentication, RBAC security, validation, and encryption
  • Dynamic template engine to create your own HTML tags (or just use Twig)
  • MVC, HMVC, CQRS, Queue-oriented, RPC-oriented, CLI apps... any apps

Bridges

App Type Current Status
spiral/roadrunner-bridge Latest Stable Version
spiral/cycle-bridge Latest Stable Version
spiral/temporal-bridge Latest Stable Version
spiral/data-grid-bridge Latest Stable Version
spiral/sapi-bridge Latest Stable Version
spiral/nyholm-bridge Latest Stable Version

Note: You can find more community packages in spiral-packages organization.

License:

MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.

attributes's People

Contributors

alexndr-novikov avatar anlamas avatar butschster avatar co-in avatar jdrieghe avatar johnny-silverhand avatar jwdeitch avatar lex111 avatar matthewhallcom avatar msmakouz avatar ncou avatar r3volut1oner avatar rauanmayemir avatar root-aza avatar roxblnfk avatar rustatian avatar samsonasik avatar serafimarts avatar spekulatius avatar spiralbot avatar stylecibot avatar tuneyourserver avatar vladgorenkin avatar vvval avatar wolfy-j avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

attributes's Issues

Ignore `@mixin` annotation

If i use a vendor class (or trait) with @mixin annotation then spiral/attributes throws an exception with text:

 [Spiral\Attributes\Exception\SemanticAttributeException]                                                                                                                                 
 [Semantical Error] The annotation "@mixin" in class CliTube\Bridge\Spiral\Command\PaginationTrait was never imported. Did you maybe forget to add a "use" statement for this annotation?

Trying to extend final class

We are facing the issue that this class

final class NamedArgumentConstructor extends DoctrineNamedArgumentConstructor

is trying to extend already final class in doctrine/annotations which causes errors in environment with temporal php sdk + doctrine

Get rid of unnecessary pollyfills

About the Attribute problem:

  • spiral/attributes has an Attribute polyfill
    namespace {
    use JetBrains\PhpStorm\ExpectedValues;
    if (!\class_exists(Attribute::class, false)) {
    #[Attribute(Attribute::TARGET_CLASS)]
    final class Attribute
    {
    /**
    * Marks that attribute declaration is allowed only in classes.
    *
    * @var Attribute::TARGET_*
    */
    public const TARGET_CLASS = 0b00000001;
    /**
    * Marks that attribute declaration is allowed only in functions.
    *
    * @var Attribute::TARGET_*
    */
    public const TARGET_FUNCTION = 0b00000010;
    /**
    * Marks that attribute declaration is allowed only in class methods.
    *
    * @var Attribute::TARGET_*
    */
    public const TARGET_METHOD = 0b00000100;
    /**
    * Marks that attribute declaration is allowed only in class properties.
    *
    * @var Attribute::TARGET_*
    */
    public const TARGET_PROPERTY = 0b00001000;
    /**
    * Marks that attribute declaration is allowed only in class constants.
    *
    * @var Attribute::TARGET_*
    */
    public const TARGET_CLASS_CONSTANT = 0b00010000;
    /**
    * Marks that attribute declaration is allowed only in function or method parameters.
    *
    * @var Attribute::TARGET_*
    */
    public const TARGET_PARAMETER = 0b00010000;
    /**
    * Marks that attribute declaration is allowed anywhere.
    *
    * @var int-mask-of<Attribute::TARGET_*>
    */
    public const TARGET_ALL = self::TARGET_CLASS
    | self::TARGET_FUNCTION
    | self::TARGET_METHOD
    | self::TARGET_PROPERTY
    | self::TARGET_PARAMETER
    ;
    /**
    * Notes that an attribute declaration in the same place is allowed multiple times.
    */
    public const IS_REPEATABLE = 0b00100000;
    /**
    * @var int-mask-of<Attribute::TARGET_*>
    */
    public $flags;
    }
    }
    }
  • It shouldn't need this polyfill because this package is PHP 8+ anyway - it could be deleted and stop confusing PHPStan
  • But if they wanted to keep this polyfill, they should fix it. The problem with this polyfill is that it's missing a constructor which is what's confusing PHPStan. This is how it should look: https://github.com/phpstan/phpstan-src/blob/2b1b8eb9d9d6a8f43afa3f8a6f3ac15f3454fce3/stubs/runtime/Attribute.php#L52-L59

phpstan/phpstan#9566 (comment)

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.