A New Modern, Fully RFC 5545-Compliant iCalendar Parser and Writer for PHP
I’m excited to share that my new open-source library, php-icalendar-core, is now available on GitHub:
https://github.com/craigk5n/php-icalendar-core
This is a clean, modern, zero-dependency PHP 8.2+ library for parsing and writing iCalendar (.ics) data according to RFC 5545, with strong support for recurrence rules (RRULE), timezones, and even forward-compatible rich-text descriptions via STYLED-DESCRIPTION (RFC 9073).
Table of Contents
- Why Another iCalendar Library?
- Built with AI Assistance
- Excellent Documentation on DeepWiki
- Thorough Testing & Top-Tier Code Quality
Why Another iCalendar Library?
Existing PHP iCalendar solutions are often outdated, tightly coupled to frameworks, or lack strict RFC compliance and modern PHP features. I wanted something that is:
- Truly standards-compliant
- Memory-efficient (uses generators and streaming where possible)
- Developer-friendly with clear strict/lenient parsing modes
- Extensible for custom properties and components
The result is a library that feels native to modern PHP — using readonly properties, enums, DateTimeImmutable, and strong typing throughout.
Built with AI Assistance
This project was a great experiment in agentic development. I leaned heavily on AI coding tools to accelerate the work:
- Claude Code (Anthropic) handled high-level planning, including turning my initial PRD into a detailed task breakdown and tackling the most complex parts like the recurrence engine and content-line folding logic.
- OpenCode was perfect for simpler, repetitive coding tasks and quick iterations.
- Google Gemini filled in the mid-level work, especially around test generation and documentation refinements.
All AI-generated code was carefully reviewed, tested, and refined by me, but the speed and quality boost from these tools was remarkable.
Excellent Documentation on DeepWiki
One of the best parts of the project has been the documentation. I’ve published comprehensive, auto-generated docs on DeepWiki — a fantastic platform that creates beautiful, searchable wikis for codebases complete with architecture diagrams, class references, and explanations.
You can explore the full php-icalendar-core documentation there (just search for the repo on deepwiki.com or follow the link from the GitHub README). It’s one of the cleanest ways I’ve seen to document a library automatically while keeping it up-to-date.
Thorough Testing & Top-Tier Code Quality
Quality was non-negotiable. The library includes:
- Extensive PHPUnit test suites covering RFC 5545 examples, edge cases, roundtrip (parse → write → parse) fidelity, malformed input handling, and performance tests.
- Full conformance testing against the official iCalendar specification.
- Psalm at level 9 — the highest/most strict level. Achieving Psalm level 9 means the codebase has excellent type coverage, minimal runtime surprises, and follows very high static analysis standards. This gives me (and future contributors) strong confidence in the library’s reliability.
The combination of comprehensive tests and strict static analysis makes php-icalendar-core one of the most robust iCalendar implementations available in PHP today.