2017 © Pedro Peláez
 

symfony-bundle request-resolver-bundle

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

image

codingculture/request-resolver-bundle

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  • Monday, May 28, 2018
  • by nielsvermaut
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 17 % Grown

The README.md

Request Resolver Bundle

Build Status Codacy Badge Latest Stable Version Total Downloads, (*1)

This Symfony bundle tries to make request assertion a little bit easier., (*2)

This bundle is still a work in progress., (*3)

PHP7.1+ only., (*4)

Usage

<?php

...

class SomeController extends Controller
{
    public function someAction()
    {
        $request = $this->get('codingculture.requestresolver.resolver')->resolve(new SomeRequest());

        $request->getId();
    }
}
<?php

...

final class SomeRequest implements ResolvableRequestInterface
{
    private $options = [];

    public function getId(): string
    {
        return $this->options['id'];
    }

    public function defineOptions(OptionsResolver $resolver): OptionsResolver
    {
        $resolver->setRequired('id')
    }

    public function setOptions(array $options)
    {
        $this->options = $options;
    }

    public function getContentType(): string
    {
        return RequestResolver::CONTENT_TYPE_ALLOW_ALL;
    }
}

If a user sent a bad request, an InvalidArgumentException (or an extension of it) will be thrown on resolve method., (*5)

Todo

  • [ ] Write better docs

The Versions

28/05 2018

dev-master

9999999-dev

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

07/02 2018

1.0.2

1.0.2.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

07/02 2018

1.0.1

1.0.1.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

25/01 2018

1.0.0

1.0.0.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

24/01 2018

0.4

0.4.0.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

24/01 2018

0.3

0.3.0.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

24/01 2018

0.2

0.2.0.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request

24/01 2018

0.1

0.1.0.0

Joins the power of symfony OptionsResolver and Requests to create a clean API for your requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Niels Vermaut

symfony4 bundle request