Skip to content

Commit

Permalink
use FOS\Rest lib
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed Mar 2, 2012
1 parent 10d5243 commit 3fa2da6
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 430 deletions.
2 changes: 1 addition & 1 deletion Controller/ExceptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Symfony\Component\HttpFoundation\Request,
Symfony\Component\HttpFoundation\Response;

use FOS\RestBundle\Response\Codes,
use FOS\Rest\Util\Codes,
FOS\RestBundle\View\ViewHandler,
FOS\RestBundle\View\View,
FOS\RestBundle\Util\ExceptionWrapper;
Expand Down
2 changes: 2 additions & 0 deletions Decoder/ContainerDecoderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

use Symfony\Component\DependencyInjection\ContainerAware;

use FOS\Rest\Decoder\DecoderProviderInterface;

/**
* Provides encoders through the Symfony2 DIC
*
Expand Down
28 changes: 0 additions & 28 deletions Decoder/DecoderInterface.php

This file was deleted.

36 changes: 0 additions & 36 deletions Decoder/DecoderProviderInterface.php

This file was deleted.

28 changes: 0 additions & 28 deletions Decoder/JsonDecoder.php

This file was deleted.

97 changes: 0 additions & 97 deletions Decoder/XmlDecoder.php

This file was deleted.

2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition,
Symfony\Component\Config\Definition\ConfigurationInterface;

use FOS\RestBundle\Response\Codes;
use FOS\Rest\Util\Codes;

/**
* This class contains the configuration information for the bundle
Expand Down
6 changes: 3 additions & 3 deletions DependencyInjection/FOSRestExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Symfony\Component\DependencyInjection\ContainerBuilder,
Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

use FOS\RestBundle\Response\Codes;
use FOS\Rest\Util\Codes;

class FOSRestExtension extends Extension
{
Expand Down Expand Up @@ -63,7 +63,7 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter($this->getAlias().'.force_redirects', $config['view']['force_redirects']);

if (!is_numeric($config['view']['failed_validation'])) {
$config['view']['failed_validation'] = constant('\FOS\RestBundle\Response\Codes::'.$config['view']['failed_validation']);
$config['view']['failed_validation'] = constant('\FOS\Rest\Util\Codes::'.$config['view']['failed_validation']);
}
$container->setParameter($this->getAlias().'.failed_validation', $config['view']['failed_validation']);

Expand All @@ -76,7 +76,7 @@ public function load(array $configs, ContainerBuilder $container)

foreach ($config['exception']['codes'] as $exception => $code) {
if (!is_numeric($code)) {
$config['exception']['codes'][$exception] = constant("\FOS\RestBundle\Response\Codes::$code");
$config['exception']['codes'][$exception] = constant("\FOS\Rest\Util\Codes::$code");
}
$this->testExceptionExists($exception);
}
Expand Down
2 changes: 1 addition & 1 deletion EventListener/BodyListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace FOS\RestBundle\EventListener;

use FOS\RestBundle\Decoder\DecoderProviderInterface;
use FOS\Rest\Decoder\DecoderProviderInterface;

use Symfony\Component\HttpFoundation\ParameterBag,
Symfony\Component\HttpKernel\Event\GetResponseEvent;
Expand Down
4 changes: 2 additions & 2 deletions EventListener/FormatListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
Symfony\Component\HttpKernel\Exception\HttpException,
Symfony\Component\HttpKernel\HttpKernelInterface;

use FOS\RestBundle\Response\Codes,
FOS\RestBundle\Util\FormatNegotiatorInterface;
use FOS\Rest\Util\Codes,
FOS\Rest\Util\FormatNegotiatorInterface;

/**
* This listener handles Accept header format negotiations.
Expand Down
4 changes: 2 additions & 2 deletions Resources/config/body_listener.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

<services>

<service id="fos_rest.decoder.json" class="FOS\RestBundle\Decoder\JsonDecoder" />
<service id="fos_rest.decoder.json" class="FOS\Rest\Decoder\JsonDecoder" />

<service id="fos_rest.decoder.xml" class="FOS\RestBundle\Decoder\XmlDecoder" />
<service id="fos_rest.decoder.xml" class="FOS\Rest\Decoder\XmlDecoder" />

<service id="fos_rest.decoder_provider" class="FOS\RestBundle\Decoder\ContainerDecoderProvider">
<argument>%fos_rest.decoders%</argument>
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/util.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="fos_rest.format_negotiator.class">FOS\RestBundle\Util\FormatNegotiator</parameter>
<parameter key="fos_rest.format_negotiator.class">FOS\Rest\Util\FormatNegotiator</parameter>
</parameters>

<services>
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/2-the-view-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ formats if needed.

Finally the HTTP response status code for failed validation defaults to
``400``. Note when changing the default you can use name constants of
``FOS\RestBundle\Response\Codes`` class or an integer status code.
``FOS\Rest\Util\Codes`` class or an integer status code.

You can also set the default templating engine to something different than the
default of ``twig``:
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/4-exception-controller-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ twig:
To map Exception classes to HTTP response status codes an “exception map” may
be configured, where the keys match a fully qualified class name and the values
are either an integer HTTP response status code or a string matching a class
constant of the ``FOS\RestBundle\Response\Codes`` class:
constant of the ``FOS\Rest\Util\Codes`` class:
```yaml
# app/config/config.yml
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/examples/RssHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use FOS\RestBundle\View\View,
FOS\RestBundle\View\ViewHandler,
FOS\RestBundle\Response\Codes;
FOS\Rest\Util\Codes;

use Symfony\Bridge\Monolog\Logger,
Symfony\Component\HttpFoundation\Request,
Expand Down
61 changes: 0 additions & 61 deletions Response/Codes.php

This file was deleted.

Loading

0 comments on commit 3fa2da6

Please sign in to comment.