Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, FrankenPHP, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu

Introducing PropertyInfo: a PHP component to find types and doc of properties

Posted on February 16, 2015 by Kévin Dunglas

PHP Beer Mug

PHP doesn’t support explicit type definition. This is annoying, especially when doing meta programming. Various libraries including but not limited to Doctrine ORM and the Symfony Validator provide their own type managing system. Another common way to describe type(s) of a property is integrated documentation aka PHPDoc.

The PHP Property Info library extracts various information including the type and documentation from PHP class properties from metadata of popular sources including:

  • Setter method with type hint
  • PHPDoc’s DocBlock
  • Doctrine ORM mapping (annotation, XML, YML or custom format)

Thanks to the visitor pattern, adding support for other metadata source is easy, and Pull Requests are welcome!

As usual, this library is freely available (MIT license) on my GitHub page.

As you maybe know, I’m working on a new way to build hypermedia REST API with Symfony (an experimental release is already available: DunglasJsonLdApiBundle). This bundle will leverage PHP Property Info and the Symfony Serializer Component that will be shipped in Symfony 2.7 to allow powerful deserialization.

Related posts:

  1. Making the Symfony PropertyAccess Component 84% faster in 2.8… and counting
  2. PHP Schema: generate a fully functional PHP / Doctrine / Symfony data model from Schema.org vocabulary in minutes
  3. Introducing API Platform (beta): the next generation PHP web framework
  4. Casting PHP types to string

1 thought on “Introducing PropertyInfo: a PHP component to find types and doc of properties”

  1. Pingback: 1p – PropertyInfo: a PHP component to find types and doc of properties – Exploding Ads

Leave a ReplyCancel reply

Social

  • Bluesky
  • GitHub
  • LinkedIn
  • Mastodon
  • X
  • YouTube

Links

  • API Platform
  • FrankenPHP
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks

Subscribe to this blog

Top Posts & Pages

  • FrankenPHP’s New Features: Thread Autoscaling, Mostly Static Binaries, deb and RPM Packages, Caddy 2.10…
  • Symfony's New Native Docker Support (Symfony World)
  • FrankenPHP: The Modern Php App Server, written in Go
  • Preventing CORS Preflight Requests Using Content Negotiation
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Develop Faster With FrankenPHP
  • PHP and Symfony Apps As Standalone Binaries
  • FrankenPHP 1.3: Massive Performance Improvements, Watcher Mode, Dedicated Prometheus Metrics, and More
  • Generate a Symfony password hash from the command line
  • Goroutines, threads, and thread IDs

Tags

Apache API API Platform Buzz Caddy Docker Doctrine FrankenPHP Go Google GraphQL HTTP/2 Hydra hypermedia Hébergement Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Messagerie Instantanée MySQL performance PHP Punk Rock Python React REST Rock'n'Roll Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu Web 2.0 webperf XHTML XML

Archives

Categories

  • DevOps (85)
    • Ubuntu (68)
  • Go (19)
  • JavaScript (46)
  • Mercure (7)
  • Opinions (91)
  • PHP (172)
    • API Platform (77)
    • FrankenPHP (11)
    • Laravel (1)
    • Symfony (97)
    • Wordpress (6)
  • Python (14)
  • Security (15)
  • SEO (25)
  • Talks (46)
© 2025 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme