farmpublic/daplos-parser-bundle

A Symfony bundle to parse Daplos flat files.

0.1.0 2024-09-27 13:51 UTC

This package is auto-updated.

Last update: 2025-03-27 15:49:28 UTC


README

Static code analysis Testing emoji-log

A Symfony bundle to parse Daplos flat files.

Requirements

  • PHP 8.3+
  • Symfony 7.1+
  • Composer

Installation

composer require farmpublic/daplos-parser-bundle

Usage

To use our bundle, you need to import FarmPublic\DaplosParserBundle\DaplosParserInterface in your controller/service/etc.

  • In a controller:
use FarmPublic\DaplosParserBundle\DaplosParserInterface;

class MyController
{
    public function myAction(DaplosParserInterface $daplosParser)
    {
        $daplosParser->parse('/path/to/file.dap');
    }
}
  • In a service:
use FarmPublic\DaplosParserBundle\DaplosParserInterface;

class MyService
{
    public function __construct(
        private DaplosParserInterface $daplosParser
    ) {
    }

    public function myAction()
    {
        $daplosParser->parse('/path/to/file.dap');
    }
}
  • In a command:
use FarmPublic\DaplosParserBundle\DaplosParserInterface;

class MyCommand extends Command
{
    public function __construct(
        private DaplosParserInterface $daplosParser
    ) {
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $daplosParser->parse('/path/to/file.dap');
    }
}

Testing

To run the phpunit, phpstan and php-cs-fixer tests, run:

composer test:all

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Yoan Bernabeu - Initial work - GitHub

See also the list of contributors who participated in this project.