Skip to content

Commit 43fd9a8

Browse files
authored
Merge pull request #16 from wobblecode/symfony4-support
Symfony4 support
2 parents c18e5b4 + 5162667 commit 43fd9a8

8 files changed

Lines changed: 1307 additions & 1366 deletions

File tree

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ cache:
77
- $HOME/.composer/cache
88

99
php:
10-
- 5.6
11-
- 7.0
10+
- 7.1
1211

1312
env:
1413
global:
@@ -17,4 +16,4 @@ env:
1716
install:
1817
- composer self-update
1918
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini; fi;
20-
- composer install --dev
19+
- composer install

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
# WobbleCodeRestBundle
33

4+
## NOTE: This branch is for Symfony 4
5+
46
A bundle that creates RESTful Apis in seconds, based on your current controllers
57
actions just using annotations. This is very helpful if you need access to a
68
basic RESTful API under the same domain or page.
@@ -21,7 +23,7 @@ These are the main features:
2123

2224
[![Latest Stable Version](https://poser.pugx.org/wobblecode/rest-bundle/v/stable.svg)](https://packagist.org/packages/wobblecode/rest-bundle)
2325
[![Total Downloads](https://poser.pugx.org/wobblecode/rest-bundle/downloads.svg)](https://packagist.org/packages/wobblecode/rest-bundle)
24-
[![Travis](https://travis-ci.org/wobblecode/WobbleCodeRestBundle.svg)](https://travis-ci.org/wobblecode/WobbleCodeRestBundle/builds)
26+
[![Travis](https://travis-ci.org/wobblecode/WobbleCodeRestBundle.svg?branch=feature%2Fsymfony4-support)](https://travis-ci.org/wobblecode/WobbleCodeRestBundle/builds)
2527
[![License](https://poser.pugx.org/wobblecode/rest-bundle/license.svg)](https://packagist.org/packages/wobblecode/rest-bundle)
2628
[![SensioLabsInsight](https://img.shields.io/sensiolabs/i/a7c1d790-2e24-49a8-830e-1770e3a9038c.svg)](https://insight.sensiolabs.com/projects/a7c1d790-2e24-49a8-830e-1770e3a9038c)
2729

Resources/config/services.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
services:
2+
jms_serializer.doctrine_proxy_subscriber:
3+
class: JMS\Serializer\EventDispatcher\Subscriber\DoctrineProxySubscriber
4+
public: true
5+
tags:
6+
- { name: jms_serializer.event_subscriber }
7+
arguments:
8+
- true
9+
- false
10+
jms_serializer.stopwatch_subscriber:
11+
class: JMS\SerializerBundle\Serializer\StopwatchEventSubscriber
12+
public: true
13+
arguments:
14+
- "?debug.stopwatch"
15+
jms_serializer.datetime_handler:
16+
class: JMS\Serializer\Handler\DateHandler
17+
public: true
18+
tags:
19+
- { name: jms_serializer.subscribing_handler }
20+
jms_serializer.array_collection_handler:
21+
class: JMS\Serializer\Handler\ArrayCollectionHandler
22+
public: true
23+
tags:
24+
- { name: jms_serializer.subscribing_handler }
25+
26+
27+
# <parameter key="jms_serializer.datetime_handler.class">JMS\Serializer\Handler\DateHandler</parameter>
28+
# <parameter key="jms_serializer.array_collection_handler.class">JMS\Serializer\Handler\ArrayCollectionHandler</parameter>
29+
# <parameter key="jms_serializer.php_collection_handler.class">JMS\Serializer\Handler\PhpCollectionHandler</parameter>
30+
# <parameter key="jms_serializer.form_error_handler.class">JMS\Serializer\Handler\FormErrorHandler</parameter>
31+
# <parameter key="jms_serializer.constraint_violation_handler.class">JMS\Serializer\Handler\ConstraintViolationHandler</parameter>
32+
# <parameter key="jms_serializer.doctrine_proxy_subscriber.class">JMS\Serializer\EventDispatcher\Subscriber\DoctrineProxySubscriber</parameter>
33+
# <parameter key="jms_serializer.stopwatch_subscriber.class">JMS\SerializerBundle\Serializer\StopwatchEventSubscriber</parameter>
34+
35+
36+
237
wobblecode.restbundle.mapper.validator_error:
338
class: WobbleCode\RestBundle\Mapper\ErrorMapper
439
wobblecode.restbundle.param_converter.jms_serializer:

Tests/Fixtures/TestKernel.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/*
34
* This file is part of the Symfony framework.
45
*
@@ -7,6 +8,8 @@
78
* This source file is subject to the MIT license that is bundled
89
* with this source code in the file LICENSE.
910
*/
11+
namespace Tests\Fixtures;
12+
1013
use Symfony\Component\Config\Loader\LoaderInterface;
1114
use Symfony\Component\HttpKernel\Kernel;
1215
use JMS\SerializerBundle\JMSSerializerBundle;
@@ -19,11 +22,11 @@ class TestKernel extends Kernel
1922
public function registerBundles()
2023
{
2124
return [
22-
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
23-
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
24-
new Symfony\Bundle\TwigBundle\TwigBundle(),
25-
new JMS\SerializerBundle\JMSSerializerBundle(),
26-
new Tests\Fixtures\FooBundle\FooBundle()
25+
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
26+
new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
27+
new \Symfony\Bundle\TwigBundle\TwigBundle(),
28+
new \JMS\SerializerBundle\JMSSerializerBundle(),
29+
new FooBundle\FooBundle()
2730
];
2831
}
2932
public function registerContainerConfiguration(LoaderInterface $loader)

Tests/Fixtures/config/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ parameters:
1919

2020
services:
2121
test.rest.multiple:
22+
public: true
2223
class: Tests\Fixtures\FooBundle\Controller\RestController

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=5.4",
16-
"symfony/framework-bundle": "~2.3|~3.0",
17-
"symfony/dependency-injection": "~2.3|~3.0",
18-
"willdurand/negotiation": "2.0.2",
19-
"doctrine/common": "~2.2",
20-
"jms/serializer-bundle": "~1.1.0|^2.0|dev-master"
15+
"php": "~7.1",
16+
"symfony/framework-bundle": "~3.0|~4.0",
17+
"symfony/dependency-injection": "~3.0|~4.0",
18+
"doctrine/common": "~2.2"
2119
},
2220
"require-dev": {
23-
"symfony/yaml": "3.1.2",
21+
"symfony/yaml": "~3.1",
2422
"symfony/browser-kit": "*",
2523
"sensio/framework-extra-bundle": "*",
24+
"symfony/security-csrf": "*",
25+
"symfony/templating": "*",
2626
"symfony/class-loader": "*",
2727
"symfony/finder": "*",
2828
"symfony/css-selector": "*",

0 commit comments

Comments
 (0)