bridgetphp / bridget
Bree - A modern PHP superset with strong typing and OOP enhancements
Requires
- php: ^8.4
- ext-readline: *
Requires (Dev)
- siguici/php-devtools: ^1.1
Replaces
- psr/container: ^2.0
This package is auto-updated.
Last update: 2025-09-01 23:50:15 UTC
README
Bree is a modern PHP framework designed to enhance development with strong typing, advanced object-oriented features, and a powerful templating system inspired by Blade. π‘β¨
β‘ Quick Start
π¦ Install Bree
Install Bree via Composer with:
composer global require bree/bree:dev-main
π Try Bree
Create a hello.bg
file:
Hello, $name!
Run it with:
bree run hello --name=Bree
This displays: Hello, Bree! π
β What is Bree?
Bree is a cutting-edge PHP framework that introduces:
β Strong typing for better code reliability π β Advanced OOP features for maintainable applications ποΈ β A powerful templating system for seamless UI rendering π¨ β Full PHP compatibility ensuring easy adoption π
π₯ Why Choose Bree?
- π Enhances PHP without breaking compatibility β Upgrade your projects without major rewrites.
- βοΈ No need for PHPDoc & annotations β Types are enforced at both transpilation and runtime.
- β‘ Inspired by TypeScript β Offers both static and dynamic typing for flexibility.
- π Blade-like templating β Clean and structured HTML rendering.
π Features
- π‘οΈ Strong Typing β Enforces types at compile-time and runtime.
- ποΈ Advanced OOP β Expands PHPβs object-oriented capabilities.
- π Dynamic & Static Typing β Inspired by TypeScript.
- π₯οΈ Integrated Templating Engine β A Blade-like system for clean HTML rendering.
- π§© Seamless PHP Integration β 100% compatible with existing PHP code.
π Requirements
πΉ PHP 8.4 or higher (8.4.3+ recommended)
πΉ Composer
πΉ Git
πΉ Node.js (Optional)
π Installation
Install Bree from Packagist using Composer:
composer global require bree/bree:dev-main
π οΈ Usage
Bree transpiles .bg
files into .php
, introducing enhanced features while maintaining PHP compatibility.
π§ Example Command
bree source.bree
This converts source.bg
into an optimized PHP file.
π Example Code
<?php // Strongly-typed function in Bree function greet<T extends string>(T $name): T { return "Hello, $name!"; } echo greet("World");
π Transpiled PHP Code
<?php function greet(string $name): string { return "Hello, $name!"; } echo greet("World"); ?>
Bree ensures type safety at transpilation, making PHP development more robust. π‘οΈ
π€ Contributing
We welcome contributions! π Whether it's bug fixes, new features, or documentation improvements, feel free to contribute.
π How to Contribute
- π΄ Fork the repository.
- π± Create a new branch.
- π οΈ Implement your changes and add tests.
- π€ Submit a pull request.
Please follow our coding style and contribution guidelines. π
π License
Bree is licensed under the MIT License. See the LICENSE.md file for details.
π¬ Support & Community
For questions, issues, or feedback:
- π Open an issue
- π¬ Join our discussions