diff --git a/client/package.json b/client/package.json index 187a71a..8e6a5b7 100644 --- a/client/package.json +++ b/client/package.json @@ -9,7 +9,7 @@ "private": true, "scripts": { "build": "react-scripts build", - "start": "cd client && node ../node_modules/react-scripts/scripts/start.js" + "start": "node node_modules/react-scripts/scripts/start.js" }, "dependencies": { "axios": "^0.18.0", @@ -18,4 +18,4 @@ "react-scripts": "1.1.4" } } - \ No newline at end of file + diff --git a/client/src/App.js b/client/src/App.js index 9ec1f9e..a507fc2 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -7,74 +7,78 @@ class App extends Component { constructor(props) { super(props); this.state = { - currentOptionsState: ["test"], - pastOptions: [], - score: 0 + currentResponses: ["zert","zert","zert","zert"], + currentQuestion: "zefzeezze", + currentResponsesContent: ["zert","zert","zert","zert"], + currentResponsesChild: [0,1,2,3], + pastQuestion: null, + pastResponse: null, + score: 0, + } } - _handleClick(element) { - this.setState(prevState => ({ - pastOptions: [...prevState.pastOptions, element] - })) + _handleClick(event) { + } - fetchOptions(id) { - axios.get('http://localhost/questions/'+ id) - .then(((t) => { - this.setState(prevState => ({ - currentOptionsState: [...prevState.currentOptionsState, t.data.responses] - })) + fetchQuestion(id) { + axios.get('http://localhost:8000/questions/'+ id) + .then(((data) => { + this.setState({ + currentResponses : data.responses, + currentQuestion: data.text + }) })) } + fetchResponses() { + this.state.currentResponses.forEach((element) => { + axios.get(element) + .then(((t) => { + this.setState(prevState => ({ + currentResponsesContent: [...prevState.currentResponsesContent, t.text], + currentResponsesChild: [...prevState.currentResponsesChild, t.child] + })) + })) + }) + + } + componentWillMount(){ - this.fetchOptions() + this.fetchQuestion(0); + this.fetchResponses(); } - headerRendering() { - - let headerPast = []; - - for(let i = 0; i -

- {this.state.pastOptions[i]} -

-

- {this.state.pastOptions[i+1]} -

- - ) - } - return headerPast - } - - render() { - let currentOptions = this.state.currentOptionsState.map(((element, index) => ( -
-

- {element} -

-
+ let currentOptions = this.state.currentResponsesContent.map(((element, index) => ( +

{element}

))); + + let header = () => ( +
+

{this.state.pastQuestion}
+ → {this.state.pastResponse}

+
+ ) return (
+

Am I late ?

- {this.state.pastOptions ? this.headerRendering() : null} + {this.state.pastQuestion ? header : null}
+
-

{}

+

{this.state.currentQuestion}

Je fais quoi ?

- {this.state.currentOptionsState ? currentOptions : null} + {this.state.currentResponsesContent ? currentOptions : null}
+
); } } diff --git a/composer.json b/composer.json index 10053aa..a916f3c 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,8 @@ "symfony/lts": "^4@dev", "symfony/maker-bundle": "^1.4", "symfony/orm-pack": "^1.0", + "symfony/profiler-pack": "^1.0", + "symfony/serializer": "^4.0", "symfony/yaml": "^4.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 8ba734b..a270e39 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "6c5efcc52b8bd26da932d44a37546333", + "content-hash": "df1fb0339808419998d06c9ecb09ab6f", "packages": [ { "name": "api-platform/api-pack", @@ -44,16 +44,16 @@ }, { "name": "api-platform/core", - "version": "v2.2.5", + "version": "v2.2.6", "source": { "type": "git", "url": "https://github.com/api-platform/core.git", - "reference": "d21403eda880a9431da96f45bd77e8a7a7b400c4" + "reference": "9d712177fea904b84cf08f1570584ee03d0b95e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/api-platform/core/zipball/d21403eda880a9431da96f45bd77e8a7a7b400c4", - "reference": "d21403eda880a9431da96f45bd77e8a7a7b400c4", + "url": "https://api.github.com/repos/api-platform/core/zipball/9d712177fea904b84cf08f1570584ee03d0b95e1", + "reference": "9d712177fea904b84cf08f1570584ee03d0b95e1", "shasum": "" }, "require": { @@ -77,7 +77,7 @@ "behat/mink-browserkit-driver": "^1.3.1", "behat/mink-extension": "^2.2", "behat/symfony2-extension": "^2.1.1", - "behatch/contexts": "^3.0@dev", + "behatch/contexts": "^3.1", "doctrine/annotations": "^1.2", "doctrine/doctrine-bundle": "^1.6.3", "doctrine/orm": "^2.5.2", @@ -110,7 +110,7 @@ "symfony/twig-bundle": "^3.1 || ^4.0", "symfony/validator": "^3.3 || ^4.0", "symfony/yaml": "^3.3 || ^4.0", - "webonyx/graphql-php": "^0.10.2" + "webonyx/graphql-php": "^0.11.5" }, "suggest": { "friendsofsymfony/user-bundle": "To use the FOSUserBundle bridge.", @@ -157,7 +157,7 @@ "rest", "swagger" ], - "time": "2018-04-03T15:42:30+00:00" + "time": "2018-05-14T13:11:32+00:00" }, { "name": "doctrine/annotations", @@ -927,16 +927,16 @@ }, { "name": "doctrine/migrations", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "bb942dfc9364d97662325678ef6ba0e8fc6ff4df" + "reference": "3e7656c5adfd9b7d0d8757aa1e9e8daf43a6f200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/bb942dfc9364d97662325678ef6ba0e8fc6ff4df", - "reference": "bb942dfc9364d97662325678ef6ba0e8fc6ff4df", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/3e7656c5adfd9b7d0d8757aa1e9e8daf43a6f200", + "reference": "3e7656c5adfd9b7d0d8757aa1e9e8daf43a6f200", "shasum": "" }, "require": { @@ -996,7 +996,7 @@ "database", "migrations" ], - "time": "2018-05-05T22:46:31+00:00" + "time": "2018-05-09T21:04:56+00:00" }, { "name": "doctrine/orm", @@ -1290,33 +1290,34 @@ }, { "name": "ocramius/proxy-manager", - "version": "2.1.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/Ocramius/ProxyManager.git", - "reference": "e18ac876b2e4819c76349de8f78ccc8ef1554cd7" + "reference": "81d53b2878f1d1c40ad27270e64b51798485dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/e18ac876b2e4819c76349de8f78ccc8ef1554cd7", - "reference": "e18ac876b2e4819c76349de8f78ccc8ef1554cd7", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/81d53b2878f1d1c40ad27270e64b51798485dfc5", + "reference": "81d53b2878f1d1c40ad27270e64b51798485dfc5", "shasum": "" }, "require": { - "ocramius/package-versions": "^1.1.1", - "php": "^7.1.0", - "zendframework/zend-code": "^3.1.0" + "ocramius/package-versions": "^1.1.3", + "php": "^7.2.0", + "zendframework/zend-code": "^3.3.0" }, "require-dev": { - "couscous/couscous": "^1.5.2", + "couscous/couscous": "^1.6.1", "ext-phar": "*", - "humbug/humbug": "dev-master@DEV", - "nikic/php-parser": "^3.0.4", + "humbug/humbug": "1.0.0-RC.0@RC", + "nikic/php-parser": "^3.1.1", + "padraic/phpunit-accelerator": "dev-master@DEV", "phpbench/phpbench": "^0.12.2", - "phpstan/phpstan": "^0.6.4", - "phpunit/phpunit": "^5.6.4", - "phpunit/phpunit-mock-objects": "^3.4.1", - "squizlabs/php_codesniffer": "^2.7.0" + "phpstan/phpstan": "dev-master#856eb10a81c1d27c701a83f167dc870fd8f4236a as 0.9.999", + "phpstan/phpstan-phpunit": "dev-master#5629c0a1f4a9c417cb1077cf6693ad9753895761", + "phpunit/phpunit": "^6.4.3", + "squizlabs/php_codesniffer": "^2.9.1" }, "suggest": { "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", @@ -1355,7 +1356,7 @@ "proxy pattern", "service proxies" ], - "time": "2017-05-04T11:12:50+00:00" + "time": "2017-11-16T23:22:31+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1701,16 +1702,16 @@ }, { "name": "symfony/asset", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "db6063ab6e71c0d4910328a4d10eba197e1d6b40" + "reference": "73358508628c10832e87c3ff18db527d48387afc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/db6063ab6e71c0d4910328a4d10eba197e1d6b40", - "reference": "db6063ab6e71c0d4910328a4d10eba197e1d6b40", + "url": "https://api.github.com/repos/symfony/asset/zipball/73358508628c10832e87c3ff18db527d48387afc", + "reference": "73358508628c10832e87c3ff18db527d48387afc", "shasum": "" }, "require": { @@ -1726,7 +1727,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1753,20 +1754,20 @@ ], "description": "Symfony Asset Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/cache", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "ff96ef34437ccc2c0737677c1bf14904a2b9482d" + "reference": "4986efce97c002e58380e8c0474acbf72eda9339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/ff96ef34437ccc2c0737677c1bf14904a2b9482d", - "reference": "ff96ef34437ccc2c0737677c1bf14904a2b9482d", + "url": "https://api.github.com/repos/symfony/cache/zipball/4986efce97c002e58380e8c0474acbf72eda9339", + "reference": "4986efce97c002e58380e8c0474acbf72eda9339", "shasum": "" }, "require": { @@ -1791,7 +1792,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1822,25 +1823,26 @@ "caching", "psr6" ], - "time": "2018-04-30T01:05:59+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/config", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7c19370ab04e9ac05b74a504198e165f5ccf6dd8" + "reference": "5ceefc256caecc3e25147c4e5b933de71d0020c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7c19370ab04e9ac05b74a504198e165f5ccf6dd8", - "reference": "7c19370ab04e9ac05b74a504198e165f5ccf6dd8", + "url": "https://api.github.com/repos/symfony/config/zipball/5ceefc256caecc3e25147c4e5b933de71d0020c4", + "reference": "5ceefc256caecc3e25147c4e5b933de71d0020c4", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0" + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/finder": "<3.4" @@ -1857,7 +1859,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1884,20 +1886,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-03-19T22:35:49+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/console", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3e820bc2c520a87ca209ad8fa961c97f42e0b4ae" + "reference": "2d5d973bf9933d46802b01010bd25c800c87c242" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3e820bc2c520a87ca209ad8fa961c97f42e0b4ae", - "reference": "3e820bc2c520a87ca209ad8fa961c97f42e0b4ae", + "url": "https://api.github.com/repos/symfony/console/zipball/2d5d973bf9933d46802b01010bd25c800c87c242", + "reference": "2d5d973bf9933d46802b01010bd25c800c87c242", "shasum": "" }, "require": { @@ -1925,7 +1927,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1952,20 +1954,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:23:47+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/debug", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "e1d57cdb357e5b10f5fdacbb0b86689c0a435e6e" + "reference": "449f8b00b28ab6e6912c3e6b920406143b27193b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/e1d57cdb357e5b10f5fdacbb0b86689c0a435e6e", - "reference": "e1d57cdb357e5b10f5fdacbb0b86689c0a435e6e", + "url": "https://api.github.com/repos/symfony/debug/zipball/449f8b00b28ab6e6912c3e6b920406143b27193b", + "reference": "449f8b00b28ab6e6912c3e6b920406143b27193b", "shasum": "" }, "require": { @@ -1981,7 +1983,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2008,20 +2010,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-04-30T16:59:37+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "1f99622d8a63b160bfdd0ad7b2da56ee413cba64" + "reference": "f2a3f0dc640a28b8aedd51b47ad6e6c5cebb3c00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1f99622d8a63b160bfdd0ad7b2da56ee413cba64", - "reference": "1f99622d8a63b160bfdd0ad7b2da56ee413cba64", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f2a3f0dc640a28b8aedd51b47ad6e6c5cebb3c00", + "reference": "f2a3f0dc640a28b8aedd51b47ad6e6c5cebb3c00", "shasum": "" }, "require": { @@ -2029,7 +2031,7 @@ "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<3.4", + "symfony/config": "<4.1", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" @@ -2038,7 +2040,7 @@ "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.4|~4.0", + "symfony/config": "~4.1", "symfony/expression-language": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, @@ -2052,7 +2054,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2079,25 +2081,26 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:05:59+00:00" + "time": "2018-05-25T14:55:38+00:00" }, { "name": "symfony/doctrine-bridge", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "9ef7076f5b3f40c61ff2598fafe67ae778687c78" + "reference": "9d361867451d5397e46bb32056fa43921545676e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/9ef7076f5b3f40c61ff2598fafe67ae778687c78", - "reference": "9ef7076f5b3f40c61ff2598fafe67ae778687c78", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/9d361867451d5397e46bb32056fa43921545676e", + "reference": "9d361867451d5397e46bb32056fa43921545676e", "shasum": "" }, "require": { "doctrine/common": "~2.4", "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -2131,7 +2134,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2158,20 +2161,20 @@ ], "description": "Symfony Doctrine Bridge", "homepage": "https://symfony.com", - "time": "2018-04-26T16:12:06+00:00" + "time": "2018-05-16T14:41:07+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "63353a71073faf08f62caab4e6889b06a787f07b" + "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b", - "reference": "63353a71073faf08f62caab4e6889b06a787f07b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2391ed210a239868e7256eb6921b1bd83f3087b5", + "reference": "2391ed210a239868e7256eb6921b1bd83f3087b5", "shasum": "" }, "require": { @@ -2194,7 +2197,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2221,20 +2224,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:43+00:00" + "time": "2018-04-06T07:35:57+00:00" }, { "name": "symfony/expression-language", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "b826c255f22333eccd3365734d2c4e150c284843" + "reference": "2d0ffaa38ded0d31dd7a599a3b1f87200227a112" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/b826c255f22333eccd3365734d2c4e150c284843", - "reference": "b826c255f22333eccd3365734d2c4e150c284843", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/2d0ffaa38ded0d31dd7a599a3b1f87200227a112", + "reference": "2d0ffaa38ded0d31dd7a599a3b1f87200227a112", "shasum": "" }, "require": { @@ -2244,7 +2247,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2271,29 +2274,30 @@ ], "description": "Symfony ExpressionLanguage Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-01-03T07:38:11+00:00" }, { "name": "symfony/filesystem", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21" + "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21", - "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", + "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2320,20 +2324,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-02-22T10:50:29+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/finder", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49" + "reference": "087e2ee0d74464a4c6baac4e90417db7477dc238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", - "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", + "url": "https://api.github.com/repos/symfony/finder/zipball/087e2ee0d74464a4c6baac4e90417db7477dc238", + "reference": "087e2ee0d74464a4c6baac4e90417db7477dc238", "shasum": "" }, "require": { @@ -2342,7 +2346,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2369,7 +2373,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-04-04T05:10:37+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/flex", @@ -2419,16 +2423,16 @@ }, { "name": "symfony/framework-bundle", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "a9ad75416b86e0c472abb2c1e8799563d6ed6b56" + "reference": "e93974e78872d22cceebf401ce230363b192268e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/a9ad75416b86e0c472abb2c1e8799563d6ed6b56", - "reference": "a9ad75416b86e0c472abb2c1e8799563d6ed6b56", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/e93974e78872d22cceebf401ce230363b192268e", + "reference": "e93974e78872d22cceebf401ce230363b192268e", "shasum": "" }, "require": { @@ -2436,14 +2440,14 @@ "php": "^7.1.3", "symfony/cache": "~3.4|~4.0", "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "^3.4.3|^4.0.3", - "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/dependency-injection": "^4.1", + "symfony/event-dispatcher": "^4.1", "symfony/filesystem": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", - "symfony/http-foundation": "~3.4|~4.0", - "symfony/http-kernel": "~3.4|~4.0", + "symfony/http-foundation": "^4.1", + "symfony/http-kernel": "^4.1", "symfony/polyfill-mbstring": "~1.0", - "symfony/routing": "^3.4.5|^4.0.5" + "symfony/routing": "^4.1" }, "conflict": { "phpdocumentor/reflection-docblock": "<3.0", @@ -2451,13 +2455,13 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "symfony/asset": "<3.4", "symfony/console": "<3.4", - "symfony/form": "<3.4", + "symfony/form": "<4.1", "symfony/property-info": "<3.4", - "symfony/serializer": "<3.4", + "symfony/serializer": "<4.1", "symfony/stopwatch": "<3.4", "symfony/translation": "<3.4", - "symfony/validator": "<3.4", - "symfony/workflow": "<3.4" + "symfony/validator": "<4.1", + "symfony/workflow": "<4.1" }, "require-dev": { "doctrine/annotations": "~1.0", @@ -2470,22 +2474,23 @@ "symfony/css-selector": "~3.4|~4.0", "symfony/dom-crawler": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", - "symfony/form": "~3.4|~4.0", + "symfony/form": "^4.1", "symfony/lock": "~3.4|~4.0", + "symfony/messenger": "^4.1-beta2", "symfony/polyfill-intl-icu": "~1.0", "symfony/process": "~3.4|~4.0", "symfony/property-info": "~3.4|~4.0", "symfony/security": "~3.4|~4.0", "symfony/security-core": "~3.4|~4.0", "symfony/security-csrf": "~3.4|~4.0", - "symfony/serializer": "~3.4|~4.0", + "symfony/serializer": "^4.1", "symfony/stopwatch": "~3.4|~4.0", "symfony/templating": "~3.4|~4.0", "symfony/translation": "~3.4|~4.0", - "symfony/validator": "~3.4|~4.0", + "symfony/validator": "^4.1", "symfony/var-dumper": "~3.4|~4.0", "symfony/web-link": "~3.4|~4.0", - "symfony/workflow": "~3.4|~4.0", + "symfony/workflow": "^4.1", "symfony/yaml": "~3.4|~4.0", "twig/twig": "~1.34|~2.4" }, @@ -2502,7 +2507,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2529,20 +2534,20 @@ ], "description": "Symfony FrameworkBundle", "homepage": "https://symfony.com", - "time": "2018-04-30T16:59:37+00:00" + "time": "2018-05-30T09:26:42+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "014487772c22d893168e5d628a13e882009fea29" + "reference": "a916c88390fb861ee21f12a92b107d51bb68af99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/014487772c22d893168e5d628a13e882009fea29", - "reference": "014487772c22d893168e5d628a13e882009fea29", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a916c88390fb861ee21f12a92b107d51bb68af99", + "reference": "a916c88390fb861ee21f12a92b107d51bb68af99", "shasum": "" }, "require": { @@ -2550,12 +2555,13 @@ "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { + "predis/predis": "~1.0", "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2582,33 +2588,34 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:05:59+00:00" + "time": "2018-05-25T14:55:38+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "8333264b6de323ea27a08627d5396aa564fb9c25" + "reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8333264b6de323ea27a08627d5396aa564fb9c25", - "reference": "8333264b6de323ea27a08627d5396aa564fb9c25", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90", + "reference": "b5ab9d4cdbfd369083744b6b5dfbf454e31e5f90", "shasum": "" }, "require": { "php": "^7.1.3", "psr/log": "~1.0", "symfony/debug": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/http-foundation": "~3.4.4|~4.0.4" + "symfony/event-dispatcher": "~4.1", + "symfony/http-foundation": "~4.1", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4.5|<4.0.5,>=4", - "symfony/var-dumper": "<3.4", + "symfony/dependency-injection": "<4.1", + "symfony/var-dumper": "<4.1", "twig/twig": "<1.34|<2.4,>=2" }, "provide": { @@ -2620,7 +2627,7 @@ "symfony/config": "~3.4|~4.0", "symfony/console": "~3.4|~4.0", "symfony/css-selector": "~3.4|~4.0", - "symfony/dependency-injection": "^3.4.5|^4.0.5", + "symfony/dependency-injection": "^4.1", "symfony/dom-crawler": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", @@ -2629,7 +2636,7 @@ "symfony/stopwatch": "~3.4|~4.0", "symfony/templating": "~3.4|~4.0", "symfony/translation": "~3.4|~4.0", - "symfony/var-dumper": "~3.4|~4.0" + "symfony/var-dumper": "~4.1" }, "suggest": { "symfony/browser-kit": "", @@ -2641,7 +2648,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2668,29 +2675,30 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-04-30T19:45:57+00:00" + "time": "2018-05-30T12:52:34+00:00" }, { "name": "symfony/inflector", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", - "reference": "da634a9968162f7c5c94f8d6949a4ede86085304" + "reference": "a55513ebd8aa4843300e325c84d0954a9d1f4ed8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/inflector/zipball/da634a9968162f7c5c94f8d6949a4ede86085304", - "reference": "da634a9968162f7c5c94f8d6949a4ede86085304", + "url": "https://api.github.com/repos/symfony/inflector/zipball/a55513ebd8aa4843300e325c84d0954a9d1f4ed8", + "reference": "a55513ebd8aa4843300e325c84d0954a9d1f4ed8", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2725,7 +2733,7 @@ "symfony", "words" ], - "time": "2018-01-03T17:15:19+00:00" + "time": "2018-05-01T23:02:13+00:00" }, { "name": "symfony/lts", @@ -2822,16 +2830,16 @@ }, { "name": "symfony/maker-bundle", - "version": "v1.4.4", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "eeb9027bbd3472f2d76455cc478b04bbb0eab932" + "reference": "bb0485a3b2eecc561eff735109316677e18fb1d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/eeb9027bbd3472f2d76455cc478b04bbb0eab932", - "reference": "eeb9027bbd3472f2d76455cc478b04bbb0eab932", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/bb0485a3b2eecc561eff735109316677e18fb1d1", + "reference": "bb0485a3b2eecc561eff735109316677e18fb1d1", "shasum": "" }, "require": { @@ -2883,7 +2891,7 @@ "scaffold", "scaffolding" ], - "time": "2018-05-02T13:20:32+00:00" + "time": "2018-05-17T19:26:29+00:00" }, { "name": "symfony/orm-pack", @@ -2913,6 +2921,61 @@ "description": "A pack for the Doctrine ORM", "time": "2017-12-12T01:47:50+00:00" }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30T19:57:29+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.8.0", @@ -2973,17 +3036,100 @@ "time": "2018-04-26T10:06:28+00:00" }, { - "name": "symfony/property-access", - "version": "v4.0.9", + "name": "symfony/polyfill-php72", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/symfony/property-access.git", - "reference": "e0fef10eb7e11cae9421d8d89024dfeae0acffb7" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/e0fef10eb7e11cae9421d8d89024dfeae0acffb7", - "reference": "e0fef10eb7e11cae9421d8d89024dfeae0acffb7", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "symfony/profiler-pack", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/profiler-pack.git", + "reference": "fa2e2dad522a3bef322196abad28ffce6d0fdbc5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/profiler-pack/zipball/fa2e2dad522a3bef322196abad28ffce6d0fdbc5", + "reference": "fa2e2dad522a3bef322196abad28ffce6d0fdbc5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/stopwatch": "^3.3|^4.0", + "symfony/twig-bundle": "^3.3|^4.0", + "symfony/web-profiler-bundle": "^3.3|^4.0" + }, + "type": "symfony-pack", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A pack for the Symfony web profiler", + "time": "2017-12-12T01:48:24+00:00" + }, + { + "name": "symfony/property-access", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "f957d37eb476c9442a0c684b0cd0dd1fb38cb74a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/f957d37eb476c9442a0c684b0cd0dd1fb38cb74a", + "reference": "f957d37eb476c9442a0c684b0cd0dd1fb38cb74a", "shasum": "" }, "require": { @@ -2999,7 +3145,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3037,20 +3183,20 @@ "property path", "reflection" ], - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/property-info", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "8a10b0dc3d73037dad86a7df5b0f88f94428b25d" + "reference": "724cca5ae45760156029f14d2e293a281fab89e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/8a10b0dc3d73037dad86a7df5b0f88f94428b25d", - "reference": "8a10b0dc3d73037dad86a7df5b0f88f94428b25d", + "url": "https://api.github.com/repos/symfony/property-info/zipball/724cca5ae45760156029f14d2e293a281fab89e0", + "reference": "724cca5ae45760156029f14d2e293a281fab89e0", "shasum": "" }, "require": { @@ -3078,7 +3224,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3113,20 +3259,20 @@ "type", "validator" ], - "time": "2018-04-26T16:12:06+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/routing", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "1dfbfdf060bbc80da8dedc062050052e694cd027" + "reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/1dfbfdf060bbc80da8dedc062050052e694cd027", - "reference": "1dfbfdf060bbc80da8dedc062050052e694cd027", + "url": "https://api.github.com/repos/symfony/routing/zipball/180b51c66d10f09e562c9ebc395b39aacb2cf8a2", + "reference": "180b51c66d10f09e562c9ebc395b39aacb2cf8a2", "shasum": "" }, "require": { @@ -3158,7 +3304,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3191,20 +3337,20 @@ "uri", "url" ], - "time": "2018-04-20T06:20:23+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/security", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/security.git", - "reference": "3ba77b4b63fa51f048ebbf8291079a13e31eb6a6" + "reference": "2ba804b4af205c060094c28cece0b42a26a67537" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security/zipball/3ba77b4b63fa51f048ebbf8291079a13e31eb6a6", - "reference": "3ba77b4b63fa51f048ebbf8291079a13e31eb6a6", + "url": "https://api.github.com/repos/symfony/security/zipball/2ba804b4af205c060094c28cece0b42a26a67537", + "reference": "2ba804b4af205c060094c28cece0b42a26a67537", "shasum": "" }, "require": { @@ -3241,7 +3387,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3268,33 +3414,34 @@ ], "description": "Symfony Security Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:23:47+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/security-bundle", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "dfabecc1fd3e626e676edef97753a645b4de85a5" + "reference": "8ac1bc3575a40eb57e0ed84f00bcb5964986945b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/dfabecc1fd3e626e676edef97753a645b4de85a5", - "reference": "dfabecc1fd3e626e676edef97753a645b4de85a5", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/8ac1bc3575a40eb57e0ed84f00bcb5964986945b", + "reference": "8ac1bc3575a40eb57e0ed84f00bcb5964986945b", "shasum": "" }, "require": { "ext-xml": "*", "php": "^7.1.3", "symfony/dependency-injection": "^3.4.3|^4.0.3", - "symfony/http-kernel": "~3.4|~4.0", - "symfony/security": "~3.4|~4.0" + "symfony/http-kernel": "^4.1", + "symfony/security": "~4.1" }, "conflict": { "symfony/console": "<3.4", "symfony/event-dispatcher": "<3.4", - "symfony/framework-bundle": "<3.4", + "symfony/framework-bundle": "<=4.1-beta2", + "symfony/security": "4.1.0-beta1|4.1.0-beta2", "symfony/var-dumper": "<3.4" }, "require-dev": { @@ -3307,7 +3454,7 @@ "symfony/event-dispatcher": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", "symfony/form": "~3.4|~4.0", - "symfony/framework-bundle": "~3.4|~4.0", + "symfony/framework-bundle": "~4.1", "symfony/http-foundation": "~3.4|~4.0", "symfony/process": "~3.4|~4.0", "symfony/translation": "~3.4|~4.0", @@ -3321,7 +3468,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3348,24 +3495,25 @@ ], "description": "Symfony SecurityBundle", "homepage": "https://symfony.com", - "time": "2018-04-06T07:35:43+00:00" + "time": "2018-05-25T13:53:35+00:00" }, { "name": "symfony/serializer", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "d0e9269101ccd978af971fd4d7a892848672bfa1" + "reference": "db427d70438645789ffce6048d61b3992118a33a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/d0e9269101ccd978af971fd4d7a892848672bfa1", - "reference": "d0e9269101ccd978af971fd4d7a892848672bfa1", + "url": "https://api.github.com/repos/symfony/serializer/zipball/db427d70438645789ffce6048d61b3992118a33a", + "reference": "db427d70438645789ffce6048d61b3992118a33a", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "phpdocumentor/type-resolver": "<0.2.1", @@ -3384,6 +3532,7 @@ "symfony/http-foundation": "~3.4|~4.0", "symfony/property-access": "~3.4|~4.0", "symfony/property-info": "~3.4|~4.0", + "symfony/validator": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -3399,7 +3548,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3426,20 +3575,69 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2018-03-19T17:30:36+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { - "name": "symfony/translation", - "version": "v4.0.9", + "name": "symfony/stopwatch", + "version": "v4.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "ad3abf08eb3450491d8d76513100ef58194cd13e" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/ad3abf08eb3450491d8d76513100ef58194cd13e", - "reference": "ad3abf08eb3450491d8d76513100ef58194cd13e", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/07463bbbbbfe119045a24c4a516f92ebd2752784", + "reference": "07463bbbbbfe119045a24c4a516f92ebd2752784", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2018-02-19T16:51:42+00:00" + }, + { + "name": "symfony/translation", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/16328f5b217cebc8dd4adfe4aeeaa8c377581f5a", + "reference": "16328f5b217cebc8dd4adfe4aeeaa8c377581f5a", "shasum": "" }, "require": { @@ -3454,6 +3652,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/finder": "~2.8|~3.0|~4.0", "symfony/intl": "~3.4|~4.0", @@ -3467,7 +3666,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3494,20 +3693,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2018-04-30T01:23:47+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/twig-bridge", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "fc1258b7039d45f3e2230c74c086755832bc9c07" + "reference": "b2e4c10df6517d1fdbb053326387f8e1779ad76e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/fc1258b7039d45f3e2230c74c086755832bc9c07", - "reference": "fc1258b7039d45f3e2230c74c086755832bc9c07", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/b2e4c10df6517d1fdbb053326387f8e1779ad76e", + "reference": "b2e4c10df6517d1fdbb053326387f8e1779ad76e", "shasum": "" }, "require": { @@ -3516,7 +3715,7 @@ }, "conflict": { "symfony/console": "<3.4", - "symfony/form": "<3.4.9|<4.0.9,>=4.0" + "symfony/form": "<4.1" }, "require-dev": { "symfony/asset": "~3.4|~4.0", @@ -3524,7 +3723,7 @@ "symfony/dependency-injection": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", - "symfony/form": "^3.4.9|^4.0.9", + "symfony/form": "^4.1", "symfony/http-foundation": "~3.4|~4.0", "symfony/http-kernel": "~3.4|~4.0", "symfony/polyfill-intl-icu": "~1.0", @@ -3557,7 +3756,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3584,20 +3783,20 @@ ], "description": "Symfony Twig Bridge", "homepage": "https://symfony.com", - "time": "2018-04-30T16:59:37+00:00" + "time": "2018-05-16T14:33:22+00:00" }, { "name": "symfony/twig-bundle", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", - "reference": "f4f2ce9f9386bddff52bfb4110a28d2a4be7ea94" + "reference": "158bf522a8df74b0a322421bbde14a1647197007" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/f4f2ce9f9386bddff52bfb4110a28d2a4be7ea94", - "reference": "f4f2ce9f9386bddff52bfb4110a28d2a4be7ea94", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/158bf522a8df74b0a322421bbde14a1647197007", + "reference": "158bf522a8df74b0a322421bbde14a1647197007", "shasum": "" }, "require": { @@ -3605,6 +3804,7 @@ "symfony/config": "~3.4|~4.0", "symfony/http-foundation": "~3.4|~4.0", "symfony/http-kernel": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8", "symfony/twig-bridge": "^3.4.3|^4.0.3", "twig/twig": "~1.34|~2.4" }, @@ -3630,7 +3830,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3657,24 +3857,25 @@ ], "description": "Symfony TwigBundle", "homepage": "https://symfony.com", - "time": "2018-04-20T06:20:23+00:00" + "time": "2018-05-16T14:41:07+00:00" }, { "name": "symfony/validator", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "87c2d527687f158368b3e890933fbb77178f3415" + "reference": "f07bc14af6759710fb4639811a8240650d89786a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/87c2d527687f158368b3e890933fbb77178f3415", - "reference": "87c2d527687f158368b3e890933fbb77178f3415", + "url": "https://api.github.com/repos/symfony/validator/zipball/f07bc14af6759710fb4639811a8240650d89786a", + "reference": "f07bc14af6759710fb4639811a8240650d89786a", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/translation": "~3.4|~4.0" }, @@ -3682,6 +3883,7 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", "symfony/dependency-injection": "<3.4", "symfony/http-kernel": "<3.4", + "symfony/intl": "<4.1", "symfony/yaml": "<3.4" }, "require-dev": { @@ -3692,9 +3894,9 @@ "symfony/config": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/expression-language": "~3.4|~4.0", - "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-foundation": "~4.1", "symfony/http-kernel": "~3.4|~4.0", - "symfony/intl": "~3.4|~4.0", + "symfony/intl": "~4.1", "symfony/property-access": "~3.4|~4.0", "symfony/var-dumper": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" @@ -3714,7 +3916,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3741,24 +3943,166 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2018-04-20T10:04:09+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { - "name": "symfony/yaml", - "version": "v4.0.9", + "name": "symfony/var-dumper", + "version": "v4.1.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "275ad099e4cbe612a2acbca14a16dd1c5311324d" + "url": "https://github.com/symfony/var-dumper.git", + "reference": "bc88ad53e825ebacc7b190bbd360781fce381c64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/275ad099e4cbe612a2acbca14a16dd1c5311324d", - "reference": "275ad099e4cbe612a2acbca14a16dd1c5311324d", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/bc88ad53e825ebacc7b190bbd360781fce381c64", + "reference": "bc88ad53e825ebacc7b190bbd360781fce381c64", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/process": "~3.4|~4.0", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2018-04-29T07:56:09+00:00" + }, + { + "name": "symfony/web-profiler-bundle", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/web-profiler-bundle.git", + "reference": "8b3914ac388b2c560d4dc162c8136d136245718b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/8b3914ac388b2c560d4dc162c8136d136245718b", + "reference": "8b3914ac388b2c560d4dc162c8136d136245718b", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/http-kernel": "~4.1", + "symfony/routing": "~3.4|~4.0", + "symfony/twig-bridge": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0", + "twig/twig": "~1.34|~2.4" + }, + "conflict": { + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<3.4", + "symfony/var-dumper": "<3.4" + }, + "require-dev": { + "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\WebProfilerBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony WebProfilerBundle", + "homepage": "https://symfony.com", + "time": "2018-05-23T13:33:23+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/80e4bfa9685fc4a09acc4a857ec16974a9cd944e", + "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" @@ -3772,7 +4116,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -3799,7 +4143,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-04-08T08:49:08+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "twig/twig", @@ -4080,16 +4424,16 @@ "packages-dev": [ { "name": "symfony/dotenv", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "afb6923923e22874dac20bd042167ccb8df1d158" + "reference": "f98b6b65e04dd51f40d2cfc81c2c833ff3773b1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/afb6923923e22874dac20bd042167ccb8df1d158", - "reference": "afb6923923e22874dac20bd042167ccb8df1d158", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/f98b6b65e04dd51f40d2cfc81c2c833ff3773b1e", + "reference": "f98b6b65e04dd51f40d2cfc81c2c833ff3773b1e", "shasum": "" }, "require": { @@ -4101,7 +4445,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4133,20 +4477,20 @@ "env", "environment" ], - "time": "2018-01-03T17:15:19+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/process", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25" + "reference": "73445bd33b0d337c060eef9652b94df72b6b3434" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", - "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", + "url": "https://api.github.com/repos/symfony/process/zipball/73445bd33b0d337c060eef9652b94df72b6b3434", + "reference": "73445bd33b0d337c060eef9652b94df72b6b3434", "shasum": "" }, "require": { @@ -4155,7 +4499,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4182,20 +4526,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-04-03T05:24:00+00:00" + "time": "2018-05-30T07:26:09+00:00" }, { "name": "symfony/web-server-bundle", - "version": "v4.0.9", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/symfony/web-server-bundle.git", - "reference": "20ad52df8164d2eae029e6bb24356956c52380be" + "reference": "d8f9acbb98e8ce8c45aabe9b695615bed0e77fb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-server-bundle/zipball/20ad52df8164d2eae029e6bb24356956c52380be", - "reference": "20ad52df8164d2eae029e6bb24356956c52380be", + "url": "https://api.github.com/repos/symfony/web-server-bundle/zipball/d8f9acbb98e8ce8c45aabe9b695615bed0e77fb4", + "reference": "d8f9acbb98e8ce8c45aabe9b695615bed0e77fb4", "shasum": "" }, "require": { @@ -4204,6 +4548,7 @@ "symfony/console": "~3.4|~4.0", "symfony/dependency-injection": "~3.4|~4.0", "symfony/http-kernel": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8", "symfony/process": "^3.4.2|^4.0.2" }, "suggest": { @@ -4213,7 +4558,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4240,7 +4585,7 @@ ], "description": "Symfony WebServerBundle", "homepage": "https://symfony.com", - "time": "2018-01-03T17:15:19+00:00" + "time": "2018-05-07T07:14:12+00:00" } ], "aliases": [], diff --git a/config/bundles.php b/config/bundles.php index 6c66c7b..da80416 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -11,4 +11,5 @@ return [ Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], ]; diff --git a/config/packages/api_platform.yaml b/config/packages/api_platform.yaml index b35a904..5f54f35 100644 --- a/config/packages/api_platform.yaml +++ b/config/packages/api_platform.yaml @@ -162,8 +162,8 @@ api_platform: # The list of enabled formats. The first one will be the default. formats: - jsonld: - mime_types: ['application/ld+json'] + # jsonld: + # mime_types: ['application/ld+json'] json: mime_types: ['application/json'] @@ -178,7 +178,9 @@ api_platform: jsonproblem: mime_types: ['application/problem+json'] - jsonld: - mime_types: ['application/ld+json'] + # jsonld: + # mime_types: ['application/ld+json'] - # ... \ No newline at end of file + # ... +framework: + serializer: { enable_annotations: true } \ No newline at end of file diff --git a/config/packages/dev/web_profiler.yaml b/config/packages/dev/web_profiler.yaml new file mode 100644 index 0000000..e92166a --- /dev/null +++ b/config/packages/dev/web_profiler.yaml @@ -0,0 +1,6 @@ +web_profiler: + toolbar: true + intercept_redirects: false + +framework: + profiler: { only_exceptions: false } diff --git a/config/packages/test/web_profiler.yaml b/config/packages/test/web_profiler.yaml new file mode 100644 index 0000000..03752de --- /dev/null +++ b/config/packages/test/web_profiler.yaml @@ -0,0 +1,6 @@ +web_profiler: + toolbar: false + intercept_redirects: false + +framework: + profiler: { collect: false } diff --git a/config/routes/dev/web_profiler.yaml b/config/routes/dev/web_profiler.yaml new file mode 100644 index 0000000..c82beff --- /dev/null +++ b/config/routes/dev/web_profiler.yaml @@ -0,0 +1,7 @@ +web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + +web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler diff --git a/makefile b/makefile index 557e9c0..b75052e 100644 --- a/makefile +++ b/makefile @@ -5,7 +5,7 @@ install: npm install; api-start: - bin/console server:start *:3000; + bin/console server:start *:8000; api-stop: bin/console server:stop; diff --git a/src/Entity/Question.php b/src/Entity/Question.php index e6ffc4d..03bb2e9 100644 --- a/src/Entity/Question.php +++ b/src/Entity/Question.php @@ -2,18 +2,23 @@ namespace App\Entity; -use ApiPlatform\Core\Annotation\ApiResource; -use ApiPlatform\Core\Annotation\ApiSubresource; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; -use Doctrine\Common\Collections\ArrayCollection; +use ApiPlatform\Core\Annotation\ApiResource; +use Doctrine\ORM\Query; use Symfony\Component\Validator\Constraints as Assert; +use ApiPlatform\Core\Annotation\ApiSubresource; +use Symfony\Component\Serializer\Annotation\Groups; + +use Symfony\Component\Serializer\Serializer; +use Symfony\Component\Serializer\Encoder\XmlEncoder; +use Symfony\Component\Serializer\Encoder\JsonEncoder; +use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; /** - * Question - * * @ApiResource() - * @ORM\Table("question") + * @ORM\Table(name="question") * @ORM\Entity(repositoryClass="App\Repository\QuestionRepository") */ class Question @@ -26,49 +31,34 @@ class Question private $id; /** - * @var string - * - * @ORM\Column(type="string", length=255) + * @ORM\Column(type="string", length=255, nullable=true) */ private $text; - /** - * @var Collection - * - * @ORM\JoinColumn(nullable=true) - * @ORM\ManyToOne(targetEntity="Response") - * @ORM\JoinColumn(name="id", referencedColumnName="id") - * @ApiSubresource() - */ - private $response; - - /** - * @var Collection - * - * @ORM\OneToMany(targetEntity="Response", mappedBy="id") - * @ORM\JoinColumn(name="id", referencedColumnName="id") - * @ApiSubresource() - */ - private $responses; - - /** - * @ORM\Column(type="boolean") - */ - private $valided; - - /** - * @ORM\Column(type="boolean") - */ - private $gameover; - /** * @ORM\Column(type="datetime") */ private $date; - public function __construct() + /** + * @ORM\OneToMany(targetEntity="App\Entity\Response", mappedBy="question") + * @ORM\JoinTable(name="response") + * @ApiSubresource() + */ + private $responses; + + public function __construct(TestSerializer $testSerializer) { + $this->responses = new ArrayCollection(); $this->date = new \DateTime(); + $this->testSerializer = $testSerializer; + } + + public function __invoke(Question $question): Question + { + $this->testSerializer->test(); + + return $question; } public function getId() @@ -88,54 +78,6 @@ class Question return $this; } - public function getResponse() - { - return $this->response; - } - - public function setResponse($response): self - { - $this->response = $response; - - return $this; - } - - public function getResponses() - { - return $this->responses; - } - - public function setResponses($responses): self - { - $this->responses = $responses; - - return $this; - } - - public function getValided(): ?bool - { - return $this->valided; - } - - public function setValided(bool $valided): self - { - $this->valided = $valided; - - return $this; - } - - public function getGameover(): ?bool - { - return $this->gameover; - } - - public function setGameover(bool $gameover): self - { - $this->gameover = $gameover; - - return $this; - } - public function getDate(): ?\DateTimeInterface { return $this->date; @@ -147,4 +89,35 @@ class Question return $this; } + + /** + * @return Collection|Response[] + */ + public function getResponses(): Collection + { + return $this->responses; + } + + public function addResponse(Response $response): self + { + if (!$this->responses->contains($response)) { + $this->responses[] = $response; + $response->setQuestion($this); + } + + return $this; + } + + public function removeResponse(Response $response): self + { + if ($this->responses->contains($response)) { + $this->responses->removeElement($response); + // set the owning side to null (unless already changed) + if ($response->getQuestion() === $this) { + $response->setQuestion(null); + } + } + + return $this; + } } diff --git a/src/Entity/Response.php b/src/Entity/Response.php index b767e12..7c46d9e 100644 --- a/src/Entity/Response.php +++ b/src/Entity/Response.php @@ -9,8 +9,6 @@ use Symfony\Component\Validator\Constraints as Assert; use ApiPlatform\Core\Annotation\ApiSubresource; /** - * Response - * * @ApiResource() * @ORM\Table(name="response") * @ORM\Entity(repositoryClass="App\Repository\ResponseRepository") @@ -30,15 +28,14 @@ class Response private $text; /** - * @ORM\ManyToOne(targetEntity="Question", inversedBy="reponses", cascade={"persist"}) - * @ORM\JoinColumn(name="id", referencedColumnName="id", onDelete="SET NULL") - * @ApiSubresource() + * @ORM\ManyToOne(targetEntity="App\Entity\Question", inversedBy="responses") + * @ORM\JoinTable(name="question") */ private $question; /** - * @ORM\OneToMany(targetEntity="Question", mappedBy="response") - * @ORM\Column(type="json_array") + * @ORM\OneToOne(targetEntity="App\Entity\Question", cascade={"persist", "remove"}) + * @ORM\JoinTable(name="question") */ private $child; @@ -59,24 +56,24 @@ class Response return $this; } - public function getQuestion(): ?int + public function getQuestion(): ?Question { return $this->question; } - public function setQuestion(int $question): self + public function setQuestion(?Question $question): self { $this->question = $question; return $this; } - public function getChild() + public function getChild(): ?Question { return $this->child; } - public function setChild($child): self + public function setChild(?Question $child): self { $this->child = $child; diff --git a/src/Migrations/Version20180529075445.php b/src/Migrations/Version20180529075445.php new file mode 100644 index 0000000..c1e7968 --- /dev/null +++ b/src/Migrations/Version20180529075445.php @@ -0,0 +1,38 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE response ADD question_id INT DEFAULT NULL, ADD child_id INT DEFAULT NULL, DROP child'); + $this->addSql('ALTER TABLE response ADD CONSTRAINT FK_3E7B0BFB1E27F6BF FOREIGN KEY (question_id) REFERENCES question (id)'); + $this->addSql('ALTER TABLE response ADD CONSTRAINT FK_3E7B0BFBDD62C21B FOREIGN KEY (child_id) REFERENCES question (id)'); + $this->addSql('CREATE INDEX IDX_3E7B0BFB1E27F6BF ON response (question_id)'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_3E7B0BFBDD62C21B ON response (child_id)'); + $this->addSql('ALTER TABLE question DROP response, DROP responses, DROP valided, DROP gameover'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE question ADD response INT NOT NULL, ADD responses JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\', ADD valided TINYINT(1) NOT NULL, ADD gameover TINYINT(1) NOT NULL'); + $this->addSql('ALTER TABLE response DROP FOREIGN KEY FK_3E7B0BFB1E27F6BF'); + $this->addSql('ALTER TABLE response DROP FOREIGN KEY FK_3E7B0BFBDD62C21B'); + $this->addSql('DROP INDEX IDX_3E7B0BFB1E27F6BF ON response'); + $this->addSql('DROP INDEX UNIQ_3E7B0BFBDD62C21B ON response'); + $this->addSql('ALTER TABLE response ADD child JSON NOT NULL COMMENT \'(DC2Type:json_array)\', DROP question_id, DROP child_id'); + } +} diff --git a/src/Service/ResponseService.php b/src/Service/ResponseService.php new file mode 100644 index 0000000..cc7546e --- /dev/null +++ b/src/Service/ResponseService.php @@ -0,0 +1,40 @@ +response = $response; + } + + public function persistResponses(array $data, $question) + { + $entityManager = $this->getDoctrine()->getManager(); + + foreach ($data as $text) { + $entity = new Response(); + $entity->setText($text); + $entity->setQuestion($question); + + // tell Doctrine you want to (eventually) save the Product (no queries yet) + $entityManager->persist($entity); + + // actually executes the queries (i.e. the INSERT query) + $entityManager->flush(); + } + } +} \ No newline at end of file diff --git a/src/Service/TestSerializer.php b/src/Service/TestSerializer.php new file mode 100644 index 0000000..3666a29 --- /dev/null +++ b/src/Service/TestSerializer.php @@ -0,0 +1,23 @@ +denormalize($data); + } +} \ No newline at end of file diff --git a/symfony.lock b/symfony.lock index dcd9cd1..b053bee 100644 --- a/symfony.lock +++ b/symfony.lock @@ -194,12 +194,21 @@ "symfony/orm-pack": { "version": "v1.0.5" }, + "symfony/polyfill-ctype": { + "version": "v1.8.0" + }, "symfony/polyfill-mbstring": { "version": "v1.8.0" }, + "symfony/polyfill-php72": { + "version": "v1.8.0" + }, "symfony/process": { "version": "v4.0.9" }, + "symfony/profiler-pack": { + "version": "v1.0.3" + }, "symfony/property-access": { "version": "v4.0.9" }, @@ -230,6 +239,9 @@ "symfony/serializer": { "version": "v4.0.9" }, + "symfony/stopwatch": { + "version": "v4.0.11" + }, "symfony/translation": { "version": "3.3", "recipe": { @@ -254,6 +266,18 @@ "symfony/validator": { "version": "v4.0.9" }, + "symfony/var-dumper": { + "version": "v4.0.11" + }, + "symfony/web-profiler-bundle": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6" + } + }, "symfony/web-server-bundle": { "version": "3.3", "recipe": {