Download the PHP package opctim/bruno-lang without Composer
On this page you can find all versions of the php package opctim/bruno-lang. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download opctim/bruno-lang
More information about opctim/bruno-lang
Files in opctim/bruno-lang
Package bruno-lang
Short Description Framework-agnostic, bidirectional implementation of the Bruno (usebruno.com) .bru file language. Can be used to generate and parse from and to Bruno collections / request files.
License MIT
Informations about the package bruno-lang
opctim/bruno-lang
This package is a framework-agnostic, bidirectional implementation of the Bruno (.bru) file language from usebruno.com. It allows you to generate, parse, modify, and rebuild Bruno request collections programmatically or from existing .bru files. The primary use case is to create a collection in PHP and write it to disk, but it also supports reading and modifying existing collections seamlessly.
Features
- Parsing of bruno collections (just give it the path to the collection)
- Interface to programmatically create bruno collections
- Functionality to generate .bru files with the required metadata and write collections to disk
What do I need this for?
The main purpose of this library is to enable developers to create dev-tools for their frameworks which are capable of generating Bruno collections from their app routes :)
So feel free to help the community by creating a bundle for your favorite framework!
Platform requirements
- PHP >= 8.1
Installation
Install via Composer:
composer require opctim/bruno-lang
Usage
Programmatically creating a collection
Nesting requests in a collection
When creating collections, you might want to create folders.
Will result in this directory structure:
my_collection/
├── bruno.json
├── environments/
└── my/
└── nested/
└── request.bru
Parsing and rebuilding existing collections
Tests
composer install
vendor/bin/phpunit
Contributing
In case Bruno adds new Tags to their language, feel free to open a PR and add them under src/V1/Tag/Schema
.
You basically only have to create the class following the naming schema.
It needs to extend one of the following base types, depending on what is needed:
- Opctim\BrunoLang\V1\Tag\DictionaryBlockTag
- Opctim\BrunoLang\V1\Tag\ArrayBlockTag
- Opctim\BrunoLang\V1\Tag\TextBlockTag
Once you've done that, you'll need to specify the tag name inside the getTagName() method, run composer dump-autoload
and run the tests to ensure everything is working properly.
Block type examples are documented here: https://docs.usebruno.com/bru-lang/language
You can also find a (mostly) complete documentation of available tags there: https://docs.usebruno.com/bru-lang/tag-reference
All versions of bruno-lang with dependencies
symfony/finder Version ^5.4 || ^6.4 || ^7.2
symfony/filesystem Version ^5.4 || ^6.4 || ^7.2