File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11# ComposerParser
22
3- A parser that can parse the composer.json file of installed PHP packages.
3+ A parser that can parse the composer.json file of all installed PHP packages.
44
55<p align =" left " >
66 <a href="https://github.com/xdevor/composer-parser/actions"><img src="https://github.com/xdevor/composer-parser/actions/workflows/tests.yml/badge.svg" alt="Test Status"></a>
@@ -17,14 +17,16 @@ composer require xdevor/composer-parser
1717
1818## Usage
1919
20- 1 . parse composer.json file of installed PHP packages
20+ 1 . parse composer.json file of all installed PHP packages
2121``` php
2222...
2323use Xdevor\ComposerParser\Parser;
2424...
2525(new Parser())->parse('the/package', 'name'); // return name of the package
26- (new Parser())->parse('the/package', 'not_exist_key'); // return null
2726(new Parser())->parse('the/package', 'authors.0.name'); // return the first author name
27+ (new Parser())->parse('the/package', 'not_exist_key'); // return null if key not exist
28+ (new Parser())->parse('the/package', 'not_exist_key', 'default'); // return 'default' if key not exist
29+ (new Parser(__DIR__ . '/customize/path/installed.json'))->parse('the/package', 'name'); // parse customize path
2830```
2931
3032## Contributing
You can’t perform that action at this time.
0 commit comments