diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml new file mode 100644 index 0000000..7f49f25 --- /dev/null +++ b/.github/workflows/static_analysis.yml @@ -0,0 +1,26 @@ +name: Static Analysis + +on: push + +jobs: + static_analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Validate composer.json and composer.lock + run: composer validate + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest --no-scripts + - name: phpqa + uses: docker://zdenekdrahos/phpqa:v1.23.3 + with: + args: phpqa diff --git a/.gitignore b/.gitignore index 00f5a5e..ee5aea0 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ /build/ /vendor/ /composer.phar + +.php_cs.cache \ No newline at end of file diff --git a/.phpcs.dist b/.phpcs.dist new file mode 100644 index 0000000..9da7c37 --- /dev/null +++ b/.phpcs.dist @@ -0,0 +1,25 @@ + + Dariusz RumiƄski +This source file is subject to the MIT license that is bundled +with this source code in the file LICENSE. +EOF; + +$finder = PhpCsFixer\Finder::create() + ->exclude('./app') + ->in(__DIR__) + ->append([__DIR__.'/php-cs-fixer']) +; + +$config = PhpCsFixer\Config::create() + ->setRiskyAllowed(false) + ->setRules([ + '@PSR2' => true, + ]) + ->setFinder($finder) +; + +return $config; \ No newline at end of file diff --git a/.phpqa.yml b/.phpqa.yml new file mode 100644 index 0000000..3462455 --- /dev/null +++ b/.phpqa.yml @@ -0,0 +1,54 @@ +phpqa: + # default CLI options - https://github.com/EdgedesignCZ/phpqa#analyze + # can be overriden by CLI: phpqa --tools phpcs:1 + analyzedDirs: ./ + buildDir: build/ + ignoredDirs: build,vendor,app,bin, web + ignoredFiles: "" + report: false + execution: parallel + output: cli + tools: phpmetrics:0,phploc:0,phpcs:0,php-cs-fixer:0,phpmd:0,pdepend:0,phpcpd:0,security-checker:0,parallel-lint:0 + # array definition and allowed errors count is supported too + # tools: [phploc, phpcs:0] + verbose: false + + # Other config + # Php file extensions to parse. + extensions: + - php + +phpcs: + # alternatively you can use an array to define multiple standards (https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage#specifying-a-coding-standard) + standard: PSR2 + # number of allowed errors is compared with warnings+errors, or just errors from checkstyle.xml + ignoreWarnings: false + # https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting + reports: + cli: + - full + file: + # checkstyle is always included and overriden + checkstyle: checkstyle.xml + # you can include custom reports (https://github.com/wikidi/codesniffer/blob/master/reports/wikidi/Summary.php#L39) + # ./vendor/owner/package/src/MySummaryReport.php: phpcs-summary.html + +php-cs-fixer: + config: .phpcs.dist + +phpmd: + +pdepend: + # coverageReport: build/coverage-clover.xml + +phpcpd: + minLines: 5 + minTokens: 70 + +phpmetrics: + # v1 + config: null + # v2 + git: false + # junit: build/log-junit.xml + # composer: composer.json \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4c6084f --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +.PHONY: qa +qa: vendor + docker run --rm -it -v ${PWD}:/app:rw -w /app zdenekdrahos/phpqa:v1.23.3 phpqa + +vendor: composer.json composer.lock + docker run --rm -it -v ${PWD}:/app:rw -w /app composer:latest validate + docker run --rm -it -v ${PWD}:/app:rw -w /app composer:latest install + docker run --rm -it -v ${PWD}:/app:rw -w /app composer:latest normalize diff --git a/composer.lock b/composer.lock index 5f68a81..fa34c35 100644 --- a/composer.lock +++ b/composer.lock @@ -1,11 +1,77 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "fcdec8dd2d54dff803526edb77db98a5", "packages": [ + { + "name": "composer/ca-bundle", + "version": "1.2.7", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-04-08T08:27:21+00:00" + }, { "name": "doctrine/annotations", "version": "v1.2.7", @@ -72,7 +138,7 @@ "docblock", "parser" ], - "time": "2015-08-31 12:32:49" + "time": "2015-08-31T12:32:49+00:00" }, { "name": "doctrine/cache", @@ -142,7 +208,7 @@ "cache", "caching" ], - "time": "2015-12-19 05:03:47" + "time": "2015-12-19T05:03:47+00:00" }, { "name": "doctrine/collections", @@ -208,7 +274,7 @@ "collections", "iterator" ], - "time": "2015-04-14 22:21:58" + "time": "2015-04-14T22:21:58+00:00" }, { "name": "doctrine/common", @@ -281,24 +347,24 @@ "persistence", "spl" ], - "time": "2015-12-25 13:10:16" + "time": "2015-12-25T13:10:16+00:00" }, { "name": "doctrine/dbal", - "version": "v2.5.5", + "version": "v2.5.13", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9" + "reference": "729340d8d1eec8f01bff708e12e449a3415af873" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9", - "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/729340d8d1eec8f01bff708e12e449a3415af873", + "reference": "729340d8d1eec8f01bff708e12e449a3415af873", "shasum": "" }, "require": { - "doctrine/common": ">=2.4,<2.7-dev", + "doctrine/common": ">=2.4,<2.8-dev", "php": ">=5.3.2" }, "require-dev": { @@ -352,7 +418,7 @@ "persistence", "queryobject" ], - "time": "2016-09-09 19:13:33" + "time": "2017-07-22T20:44:48+00:00" }, { "name": "doctrine/doctrine-bundle", @@ -433,43 +499,43 @@ "orm", "persistence" ], - "time": "2016-08-10 15:35:22" + "time": "2016-08-10T15:35:22+00:00" }, { "name": "doctrine/doctrine-cache-bundle", - "version": "1.3.0", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineCacheBundle.git", - "reference": "18c600a9b82f6454d2e81ca4957cdd56a1cf3504" + "reference": "5514c90d9fb595e1095e6d66ebb98ce9ef049927" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineCacheBundle/zipball/18c600a9b82f6454d2e81ca4957cdd56a1cf3504", - "reference": "18c600a9b82f6454d2e81ca4957cdd56a1cf3504", + "url": "https://api.github.com/repos/doctrine/DoctrineCacheBundle/zipball/5514c90d9fb595e1095e6d66ebb98ce9ef049927", + "reference": "5514c90d9fb595e1095e6d66ebb98ce9ef049927", "shasum": "" }, "require": { "doctrine/cache": "^1.4.2", "doctrine/inflector": "~1.0", "php": ">=5.3.2", - "symfony/doctrine-bridge": "~2.2|~3.0" + "symfony/doctrine-bridge": "~2.7|~3.3|~4.0" }, "require-dev": { "instaclick/coding-standard": "~1.1", "instaclick/object-calisthenics-sniffs": "dev-master", "instaclick/symfony2-coding-standard": "dev-remaster", - "phpunit/phpunit": "~4", + "phpunit/phpunit": "~4.8.36|~5.6|~6.5|~7.0", "predis/predis": "~0.8", - "satooshi/php-coveralls": "~0.6.1", + "satooshi/php-coveralls": "^1.0", "squizlabs/php_codesniffer": "~1.5", - "symfony/console": "~2.2|~3.0", - "symfony/finder": "~2.2|~3.0", - "symfony/framework-bundle": "~2.2|~3.0", - "symfony/phpunit-bridge": "~2.7|~3.0", - "symfony/security-acl": "~2.3|~3.0", - "symfony/validator": "~2.2|~3.0", - "symfony/yaml": "~2.2|~3.0" + "symfony/console": "~2.7|~3.3|~4.0", + "symfony/finder": "~2.7|~3.3|~4.0", + "symfony/framework-bundle": "~2.7|~3.3|~4.0", + "symfony/phpunit-bridge": "~2.7|~3.3|~4.0", + "symfony/security-acl": "~2.7|~3.3", + "symfony/validator": "~2.7|~3.3|~4.0", + "symfony/yaml": "~2.7|~3.3|~4.0" }, "suggest": { "symfony/security-acl": "For using this bundle to cache ACLs" @@ -477,13 +543,16 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Bundle\\DoctrineCacheBundle\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -516,12 +585,12 @@ } ], "description": "Symfony Bundle for Doctrine Cache", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org", "keywords": [ "cache", "caching" ], - "time": "2016-01-26 17:28:51" + "time": "2018-11-09T06:25:35+00:00" }, { "name": "doctrine/inflector", @@ -588,25 +657,28 @@ "singularize", "string" ], - "time": "2015-11-06 14:35:42" + "time": "2015-11-06T14:35:42+00:00" }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -614,8 +686,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -636,25 +708,28 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09 13:34:57" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "doctrine/orm", "version": "v2.4.8", "source": { "type": "git", - "url": "https://github.com/doctrine/doctrine2.git", + "url": "https://github.com/doctrine/orm.git", "reference": "5aedac1e5c5caaeac14798822c70325dc242d467" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/5aedac1e5c5caaeac14798822c70325dc242d467", + "url": "https://api.github.com/repos/doctrine/orm/zipball/5aedac1e5c5caaeac14798822c70325dc242d467", "reference": "5aedac1e5c5caaeac14798822c70325dc242d467", "shasum": "" }, @@ -715,30 +790,30 @@ "database", "orm" ], - "time": "2015-08-31 13:19:01" + "time": "2015-08-31T13:19:01+00:00" }, { "name": "incenteev/composer-parameter-handler", - "version": "v2.1.2", + "version": "v2.1.4", "source": { "type": "git", "url": "https://github.com/Incenteev/ParameterHandler.git", - "reference": "d7ce7f06136109e81d1cb9d57066c4d4a99cf1cc" + "reference": "084befb11ec21faeadcddefb88b66132775ff59b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/d7ce7f06136109e81d1cb9d57066c4d4a99cf1cc", - "reference": "d7ce7f06136109e81d1cb9d57066c4d4a99cf1cc", + "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/084befb11ec21faeadcddefb88b66132775ff59b", + "reference": "084befb11ec21faeadcddefb88b66132775ff59b", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/yaml": "~2.3|~3.0" + "symfony/yaml": "^2.3 || ^3.0 || ^4.0 || ^5.0" }, "require-dev": { - "composer/composer": "1.0.*@dev", - "phpspec/prophecy-phpunit": "~1.0", - "symfony/filesystem": "~2.2" + "composer/composer": "^1.0@dev", + "symfony/filesystem": "^2.3 || ^3 || ^4 || ^5", + "symfony/phpunit-bridge": "^4.0 || ^5.0" }, "type": "library", "extra": { @@ -766,7 +841,7 @@ "keywords": [ "parameters management" ], - "time": "2015-11-10 17:04:01" + "time": "2020-03-17T21:10:00+00:00" }, { "name": "ircmaxell/password-compat", @@ -808,7 +883,7 @@ "hashing", "password" ], - "time": "2014-11-20 16:49:30" + "time": "2014-11-20T16:49:30+00:00" }, { "name": "jdorn/sql-formatter", @@ -858,20 +933,20 @@ "highlight", "sql" ], - "time": "2014-01-12 16:20:24" + "time": "2014-01-12T16:20:24+00:00" }, { "name": "monolog/monolog", - "version": "1.21.0", + "version": "1.25.4", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952" + "reference": "3022efff205e2448b560c833c6fbbf91c3139168" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f42fbdfd53e306bda545845e4dbfd3e72edb4952", - "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/3022efff205e2448b560c833c6fbbf91c3139168", + "reference": "3022efff205e2448b560c833c6fbbf91c3139168", "shasum": "" }, "require": { @@ -882,17 +957,16 @@ "psr/log-implementation": "1.0.0" }, "require-dev": { - "aws/aws-sdk-php": "^2.4.9", + "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "graylog2/gelf-php": "~1.0", - "jakub-onderka/php-parallel-lint": "0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpunit/phpunit": "~4.5", - "phpunit/phpunit-mock-objects": "2.3.0", "ruflin/elastica": ">=0.90 <3.0", "sentry/sentry": "^0.13", - "swiftmailer/swiftmailer": "~5.3" + "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", @@ -936,33 +1010,44 @@ "logging", "psr-3" ], - "time": "2016-07-29 03:23:52" + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2020-05-22T07:31:27+00:00" }, { "name": "nelmio/cors-bundle", - "version": "1.4.1", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/nelmio/NelmioCorsBundle.git", - "reference": "fa14a81737c605bf4766054cdcb72a16a433d537" + "reference": "10a24c10f242440211ed31075e74f81661c690d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/fa14a81737c605bf4766054cdcb72a16a433d537", - "reference": "fa14a81737c605bf4766054cdcb72a16a433d537", + "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/10a24c10f242440211ed31075e74f81661c690d9", + "reference": "10a24c10f242440211ed31075e74f81661c690d9", "shasum": "" }, "require": { - "symfony/framework-bundle": "^2.2 || ^3.0" + "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0" }, "require-dev": { - "matthiasnoback/symfony-dependency-injection-test": "^0.7.6", - "mockery/mockery": "0.9.*" + "matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0", + "mockery/mockery": "^0.9 || ^1.0", + "symfony/phpunit-bridge": "^2.7 || ^3.0 || ^4.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -993,20 +1078,20 @@ "cors", "crossdomain" ], - "time": "2015-12-09 17:26:34" + "time": "2019-06-17T08:53:14+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.3", + "version": "v2.0.18", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "c0125896dbb151380ab47e96c621741e79623beb" + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/c0125896dbb151380ab47e96c621741e79623beb", - "reference": "c0125896dbb151380ab47e96c621741e79623beb", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", "shasum": "" }, "require": { @@ -1038,23 +1123,24 @@ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", + "polyfill", "pseudorandom", "random" ], - "time": "2016-10-17 15:23:22" + "time": "2019-01-03T20:59:08+00:00" }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -1063,7 +1149,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1088,20 +1174,20 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "sensio/distribution-bundle", - "version": "v5.0.13", + "version": "v5.0.22", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", - "reference": "7bc47dcfdbde6d567e1a834577d1c04ddb970281" + "reference": "209b11f8cee5bf71986dd703e45e27d3ed7a6d15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/7bc47dcfdbde6d567e1a834577d1c04ddb970281", - "reference": "7bc47dcfdbde6d567e1a834577d1c04ddb970281", + "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/209b11f8cee5bf71986dd703e45e27d3ed7a6d15", + "reference": "209b11f8cee5bf71986dd703e45e27d3ed7a6d15", "shasum": "" }, "require": { @@ -1140,36 +1226,44 @@ "configuration", "distribution" ], - "time": "2016-10-08 18:50:33" + "time": "2018-06-07T06:22:12+00:00" }, { "name": "sensio/framework-extra-bundle", - "version": "v3.0.16", + "version": "v3.0.29", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", - "reference": "507a15f56fa7699f6cc8c2c7de4080b19ce22546" + "reference": "bb907234df776b68922eb4b25bfa061683597b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/507a15f56fa7699f6cc8c2c7de4080b19ce22546", - "reference": "507a15f56fa7699f6cc8c2c7de4080b19ce22546", + "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/bb907234df776b68922eb4b25bfa061683597b6a", + "reference": "bb907234df776b68922eb4b25bfa061683597b6a", "shasum": "" }, "require": { "doctrine/common": "~2.2", "symfony/dependency-injection": "~2.3|~3.0", - "symfony/framework-bundle": "~2.3|~3.0" + "symfony/framework-bundle": "~2.3|~3.0|~4.0" }, "require-dev": { - "symfony/browser-kit": "~2.3|~3.0", - "symfony/dom-crawler": "~2.3|~3.0", - "symfony/expression-language": "~2.4|~3.0", - "symfony/finder": "~2.3|~3.0", - "symfony/phpunit-bridge": "~2.7|~3.0", - "symfony/security-bundle": "~2.4|~3.0", - "symfony/twig-bundle": "~2.3|~3.0", - "twig/twig": "~1.11|~2.0" + "doctrine/doctrine-bundle": "~1.5", + "doctrine/orm": "~2.4,>=2.4.5", + "symfony/asset": "~2.7|~3.0|~4.0", + "symfony/browser-kit": "~2.3|~3.0|~4.0", + "symfony/dom-crawler": "~2.3|~3.0|~4.0", + "symfony/expression-language": "~2.4|~3.0|~4.0", + "symfony/finder": "~2.3|~3.0|~4.0", + "symfony/phpunit-bridge": "~3.2|~4.0", + "symfony/psr-http-message-bridge": "^0.3|^1.0", + "symfony/security-bundle": "~2.4|~3.0|~4.0", + "symfony/templating": "~2.3|~3.0|~4.0", + "symfony/translation": "~2.3|~3.0|~4.0", + "symfony/twig-bundle": "~2.3|~3.0|~4.0", + "symfony/yaml": "~2.3|~3.0|~4.0", + "twig/twig": "~1.12|~2.0", + "zendframework/zend-diactoros": "^1.3" }, "suggest": { "symfony/expression-language": "", @@ -1202,24 +1296,25 @@ "annotations", "controllers" ], - "time": "2016-03-25 17:08:27" + "time": "2017-12-14T19:03:23+00:00" }, { "name": "sensiolabs/security-checker", - "version": "v4.0.0", + "version": "v4.1.8", "source": { "type": "git", "url": "https://github.com/sensiolabs/security-checker.git", - "reference": "116027b57b568ed61b7b1c80eeb4f6ee9e8c599c" + "reference": "dc270d5fec418cc6ac983671dba5d80ffaffb142" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/116027b57b568ed61b7b1c80eeb4f6ee9e8c599c", - "reference": "116027b57b568ed61b7b1c80eeb4f6ee9e8c599c", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/dc270d5fec418cc6ac983671dba5d80ffaffb142", + "reference": "dc270d5fec418cc6ac983671dba5d80ffaffb142", "shasum": "" }, "require": { - "symfony/console": "~2.7|~3.0" + "composer/ca-bundle": "^1.0", + "symfony/console": "~2.7|~3.0|~4.0" }, "bin": [ "security-checker" @@ -1227,7 +1322,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -1246,27 +1341,28 @@ } ], "description": "A security checker for your composer.lock", - "time": "2016-09-23 18:09:57" + "time": "2018-02-28T22:10:01+00:00" }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.3", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153" + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", - "reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/181b89f18a90f8925ef805f950d47a7190e9b950", + "reference": "181b89f18a90f8925ef805f950d47a7190e9b950", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1" + "mockery/mockery": "~0.9.1", + "symfony/phpunit-bridge": "~3.2" }, "type": "library", "extra": { @@ -1293,26 +1389,26 @@ } ], "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.org", + "homepage": "https://swiftmailer.symfony.com", "keywords": [ "email", "mail", "mailer" ], - "time": "2016-07-08 11:51:25" + "time": "2018-07-31T09:26:32+00:00" }, { "name": "symfony/monolog-bundle", - "version": "2.11.1", + "version": "v2.12.1", "source": { "type": "git", "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00" + "reference": "b0146bdca7ba2a65f3bbe7010423c7393b29ec3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00", - "reference": "e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/b0146bdca7ba2a65f3bbe7010423c7393b29ec3f", + "reference": "b0146bdca7ba2a65f3bbe7010423c7393b29ec3f", "shasum": "" }, "require": { @@ -1359,20 +1455,20 @@ "log", "logging" ], - "time": "2016-04-13 16:21:01" + "time": "2017-01-02T19:04:26+00:00" }, { "name": "symfony/polyfill-apcu", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-apcu.git", - "reference": "6d58bceaeea2c2d3eb62503839b18646e161cd6b" + "reference": "a96dc28442814ae56199f57b72a937b5a822150c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/6d58bceaeea2c2d3eb62503839b18646e161cd6b", - "reference": "6d58bceaeea2c2d3eb62503839b18646e161cd6b", + "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/a96dc28442814ae56199f57b72a937b5a822150c", + "reference": "a96dc28442814ae56199f57b72a937b5a822150c", "shasum": "" }, "require": { @@ -1381,10 +1477,17 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Apcu\\": "" + }, "files": [ "bootstrap.php" ] @@ -1412,25 +1515,115 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-17T19:13:43+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.17.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f" + "reference": "7b5e03aeb88cc8b4b2b136e34b0fc0830e86cd4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/0f8dc2c45f69f8672379e9210bca4a115cd5146f", - "reference": "0f8dc2c45f69f8672379e9210bca4a115cd5146f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/7b5e03aeb88cc8b4b2b136e34b0fc0830e86cd4d", + "reference": "7b5e03aeb88cc8b4b2b136e34b0fc0830e86cd4d", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/intl": "~2.3|~3.0" + "symfony/intl": "~2.3|~3.0|~4.0|~5.0" }, "suggest": { "ext-intl": "For best performance" @@ -1438,7 +1631,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1470,20 +1667,34 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "reference": "7110338d81ce1cbc3e273136e4574663627037a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", + "reference": "7110338d81ce1cbc3e273136e4574663627037a7", "shasum": "" }, "require": { @@ -1495,7 +1706,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1529,20 +1744,34 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-php54", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1" + "reference": "10f691c142ba9d3ece32b309a417f04d50132d9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1", - "reference": "34d761992f6f2cc6092cc0e5e93f38b53ba5e4f1", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/10f691c142ba9d3ece32b309a417f04d50132d9d", + "reference": "10f691c142ba9d3ece32b309a417f04d50132d9d", "shasum": "" }, "require": { @@ -1551,7 +1780,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1587,20 +1820,34 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-php55", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d" + "reference": "776d0881b2c6e1d1c0d0d2330b1c87faafdef217" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", - "reference": "bf2ff9ad6be1a4772cb873e4eea94d70daa95c6d", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/776d0881b2c6e1d1c0d0d2330b1c87faafdef217", + "reference": "776d0881b2c6e1d1c0d0d2330b1c87faafdef217", "shasum": "" }, "require": { @@ -1610,7 +1857,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1643,20 +1894,34 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-php56", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a" + "reference": "a25861bb3c79b0ec2da9ede51de2ea573818b943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/3edf57a8fbf9a927533344cef65ad7e1cf31030a", - "reference": "3edf57a8fbf9a927533344cef65ad7e1cf31030a", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/a25861bb3c79b0ec2da9ede51de2ea573818b943", + "reference": "a25861bb3c79b0ec2da9ede51de2ea573818b943", "shasum": "" }, "require": { @@ -1666,7 +1931,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1699,30 +1968,48 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85" + "reference": "471b096aede7025bace8eb356b9ac801aaba7e2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/a42f4b6b05ed458910f8af4c4e1121b0101b2d85", - "reference": "a42f4b6b05ed458910f8af4c4e1121b0101b2d85", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/471b096aede7025bace8eb356b9ac801aaba7e2d", + "reference": "471b096aede7025bace8eb356b9ac801aaba7e2d", "shasum": "" }, "require": { - "paragonie/random_compat": "~1.0|~2.0", + "paragonie/random_compat": "~1.0|~2.0|~9.99", "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1758,20 +2045,34 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-util", - "version": "v1.2.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-util.git", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99" + "reference": "6dd644eda43cd2f3daa883d728d8ab4120a05af6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/ef830ce3d218e622b221d6bfad42c751d974bf99", - "reference": "ef830ce3d218e622b221d6bfad42c751d974bf99", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/6dd644eda43cd2f3daa883d728d8ab4120a05af6", + "reference": "6dd644eda43cd2f3daa883d728d8ab4120a05af6", "shasum": "" }, "require": { @@ -1780,7 +2081,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1810,7 +2115,21 @@ "polyfill", "shim" ], - "time": "2016-05-18 14:26:46" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/security-acl", @@ -1871,32 +2190,34 @@ ], "description": "Symfony Security Component - ACL (Access Control List)", "homepage": "https://symfony.com", - "time": "2015-12-28 09:39:09" + "time": "2015-12-28T09:39:09+00:00" }, { "name": "symfony/swiftmailer-bundle", - "version": "v2.3.11", + "version": "v2.6.7", "source": { "type": "git", "url": "https://github.com/symfony/swiftmailer-bundle.git", - "reference": "5e1a90f28213231ceee19c953bbebc5b5b95c690" + "reference": "c4808f5169efc05567be983909d00f00521c53ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/5e1a90f28213231ceee19c953bbebc5b5b95c690", - "reference": "5e1a90f28213231ceee19c953bbebc5b5b95c690", + "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/c4808f5169efc05567be983909d00f00521c53ec", + "reference": "c4808f5169efc05567be983909d00f00521c53ec", "shasum": "" }, "require": { "php": ">=5.3.2", - "swiftmailer/swiftmailer": ">=4.2.0,~5.0", - "symfony/config": "~2.3|~3.0", - "symfony/dependency-injection": "~2.3|~3.0", - "symfony/http-kernel": "~2.3|~3.0", - "symfony/yaml": "~2.3|~3.0" + "swiftmailer/swiftmailer": "~4.2|~5.0", + "symfony/config": "~2.7|~3.0", + "symfony/dependency-injection": "~2.7|~3.0", + "symfony/http-kernel": "~2.7|~3.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" + "symfony/console": "~2.7|~3.0", + "symfony/framework-bundle": "~2.7|~3.0", + "symfony/phpunit-bridge": "~3.3@dev", + "symfony/yaml": "~2.7|~3.0" }, "suggest": { "psr/log": "Allows logging" @@ -1904,7 +2225,7 @@ "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -1928,27 +2249,29 @@ ], "description": "Symfony SwiftmailerBundle", "homepage": "http://symfony.com", - "time": "2016-01-15 16:41:20" + "time": "2017-10-19T01:06:41+00:00" }, { "name": "symfony/symfony", - "version": "v2.8.13", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "d04e2eb13ae63068fc8862530b403756e3702896" + "reference": "88f3ef62d6ab870128352c8686c7889562698faf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/d04e2eb13ae63068fc8862530b403756e3702896", - "reference": "d04e2eb13ae63068fc8862530b403756e3702896", + "url": "https://api.github.com/repos/symfony/symfony/zipball/88f3ef62d6ab870128352c8686c7889562698faf", + "reference": "88f3ef62d6ab870128352c8686c7889562698faf", "shasum": "" }, "require": { "doctrine/common": "~2.4", + "ext-xml": "*", "php": ">=5.3.9", "psr/log": "~1.0", "symfony/polyfill-apcu": "~1.1", + "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php54": "~1.0", @@ -1957,10 +2280,11 @@ "symfony/polyfill-php70": "~1.0", "symfony/polyfill-util": "~1.0", "symfony/security-acl": "~2.7|~3.0.0", - "twig/twig": "~1.27|~2.0" + "twig/twig": "~1.34|~2.4" }, "conflict": { - "phpdocumentor/reflection": "<1.0.7" + "phpdocumentor/reflection": "<1.0.7", + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "replace": { "symfony/asset": "self.version", @@ -2011,6 +2335,7 @@ "symfony/yaml": "self.version" }, "require-dev": { + "doctrine/annotations": "~1.0", "doctrine/data-fixtures": "1.0.*", "doctrine/dbal": "~2.4", "doctrine/doctrine-bundle": "~1.2", @@ -2019,7 +2344,8 @@ "monolog/monolog": "~1.11", "ocramius/proxy-manager": "~0.4|~1.0|~2.0", "phpdocumentor/reflection": "^1.0.7", - "symfony/phpunit-bridge": "~3.2" + "sensio/framework-extra-bundle": "^3.0.2", + "symfony/phpunit-bridge": "~3.4|~4.0" }, "type": "library", "extra": { @@ -2063,38 +2389,43 @@ "keywords": [ "framework" ], - "time": "2016-10-27 02:18:45" + "time": "2019-11-13T08:36:42+00:00" }, { "name": "twig/twig", - "version": "v1.27.0", + "version": "v1.36.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3c6c0033fd3b5679c6e1cb60f4f9766c2b424d97" + "reference": "730c9c4471b5152d23061feb02b03382264c8a15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3c6c0033fd3b5679c6e1cb60f4f9766c2b424d97", - "reference": "3c6c0033fd3b5679c6e1cb60f4f9766c2b424d97", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/730c9c4471b5152d23061feb02b03382264c8a15", + "reference": "730c9c4471b5152d23061feb02b03382264c8a15", "shasum": "" }, "require": { - "php": ">=5.2.7" + "php": ">=5.3.3", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~2.7" + "psr/container": "^1.0", + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.4.19|^4.1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.27-dev" + "dev-master": "1.36-dev" } }, "autoload": { "psr-0": { "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2115,16 +2446,16 @@ }, { "name": "Twig Team", - "homepage": "http://twig.sensiolabs.org/contributors", + "homepage": "https://twig.symfony.com/contributors", "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "http://twig.sensiolabs.org", + "homepage": "https://twig.symfony.com", "keywords": [ "templating" ], - "time": "2016-10-25 19:17:17" + "time": "2018-12-16T10:34:11+00:00" } ], "packages-dev": [ @@ -2183,32 +2514,32 @@ "keywords": [ "database" ], - "time": "2015-03-30 12:14:13" + "time": "2015-03-30T12:14:13+00:00" }, { "name": "doctrine/doctrine-fixtures-bundle", - "version": "2.3.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/DoctrineFixturesBundle.git", - "reference": "0f1a2f91b349e10f5c343f75ab71d23aace5b029" + "reference": "74b8cc70a4a25b774628ee59f4cdf3623a146273" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/0f1a2f91b349e10f5c343f75ab71d23aace5b029", - "reference": "0f1a2f91b349e10f5c343f75ab71d23aace5b029", + "url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/74b8cc70a4a25b774628ee59f4cdf3623a146273", + "reference": "74b8cc70a4a25b774628ee59f4cdf3623a146273", "shasum": "" }, "require": { "doctrine/data-fixtures": "~1.0", "doctrine/doctrine-bundle": "~1.0", "php": ">=5.3.2", - "symfony/doctrine-bridge": "~2.3|~3.0" + "symfony/doctrine-bridge": "~2.7|~3.0|~4.0" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.4.x-dev" } }, "autoload": { @@ -2240,7 +2571,7 @@ "Fixture", "persistence" ], - "time": "2015-11-04 21:23:23" + "time": "2017-10-30T19:26:42+00:00" }, { "name": "doctrine/instantiator", @@ -2294,20 +2625,20 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", "shasum": "" }, "require": { @@ -2343,42 +2674,42 @@ "email": "mike.vanriel@naenius.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.2", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb", - "reference": "6c52c2722f8460122f96f86346600e1077ce22cb", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0|^2.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.0", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -2406,7 +2737,7 @@ "spy", "stub" ], - "time": "2016-11-21 14:58:47" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2468,20 +2799,20 @@ "testing", "xunit" ], - "time": "2015-10-06 15:47:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -2515,7 +2846,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -2556,29 +2887,34 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -2600,20 +2936,20 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.9", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b", - "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { @@ -2649,20 +2985,20 @@ "keywords": [ "tokenizer" ], - "time": "2016-11-15 14:06:22" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.29", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f19d481b468b76a7fb55eb2b772ed487e484891e" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f19d481b468b76a7fb55eb2b772ed487e484891e", - "reference": "f19d481b468b76a7fb55eb2b772ed487e484891e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -2721,7 +3057,7 @@ "testing", "xunit" ], - "time": "2016-11-20 10:35:28" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2777,20 +3113,21 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "abandoned": true, + "time": "2015-10-02T06:51:40+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.2", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f", - "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { @@ -2841,27 +3178,27 @@ "compare", "equality" ], - "time": "2016-11-19 09:18:40" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -2893,7 +3230,7 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", @@ -2943,7 +3280,7 @@ "environment", "hhvm" ], - "time": "2016-08-18 05:49:44" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", @@ -3010,7 +3347,7 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/global-state", @@ -3061,20 +3398,20 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -3114,7 +3451,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", @@ -3149,37 +3486,39 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "sensio/generator-bundle", - "version": "v3.0.11", + "version": "v3.1.7", "source": { "type": "git", "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git", - "reference": "b9be7f1b3b2e8bcfc1debefc901b71da923a5e5c" + "reference": "28cbaa244bd0816fd8908b93f90380bcd7b67a65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/b9be7f1b3b2e8bcfc1debefc901b71da923a5e5c", - "reference": "b9be7f1b3b2e8bcfc1debefc901b71da923a5e5c", + "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/28cbaa244bd0816fd8908b93f90380bcd7b67a65", + "reference": "28cbaa244bd0816fd8908b93f90380bcd7b67a65", "shasum": "" }, "require": { "symfony/console": "~2.7|~3.0", "symfony/framework-bundle": "~2.7|~3.0", "symfony/process": "~2.7|~3.0", - "symfony/yaml": "~2.7|~3.0" + "symfony/yaml": "~2.7|~3.0", + "twig/twig": "^1.28.2|^2.0" }, "require-dev": { "doctrine/orm": "~2.4", "symfony/doctrine-bridge": "~2.7|~3.0", - "twig/twig": "~1.18" + "symfony/filesystem": "~2.7|~3.0", + "symfony/phpunit-bridge": "^3.3" }, "type": "symfony-bundle", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -3201,25 +3540,29 @@ } ], "description": "This bundle generates code for you", - "time": "2016-10-10 14:17:42" + "abandoned": "symfony/maker-bundle", + "time": "2017-12-07T15:36:41+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v2.8.13", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "fc69aad7dba2ab3eed5cf90c8e3ede4fb961effd" + "reference": "4aa44ecbfb5e2c50797d17756da11c93a8a6974f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/fc69aad7dba2ab3eed5cf90c8e3ede4fb961effd", - "reference": "fc69aad7dba2ab3eed5cf90c8e3ede4fb961effd", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/4aa44ecbfb5e2c50797d17756da11c93a8a6974f", + "reference": "4aa44ecbfb5e2c50797d17756da11c93a8a6974f", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "conflict": { + "phpunit/phpunit": ">=6.0" + }, "suggest": { "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, @@ -3256,7 +3599,7 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2016-08-19 06:48:01" + "time": "2019-04-16T10:01:26+00:00" } ], "aliases": [], @@ -3270,5 +3613,6 @@ "platform-dev": [], "platform-overrides": { "php": "5.3.9" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/src/Rukien/BulletJournalBundle/Controller/DefaultController.php b/src/Rukien/BulletJournalBundle/Controller/DefaultController.php index f3ae021..4703181 100644 --- a/src/Rukien/BulletJournalBundle/Controller/DefaultController.php +++ b/src/Rukien/BulletJournalBundle/Controller/DefaultController.php @@ -30,22 +30,23 @@ public function indexAction() */ public function showTaskAction($task_id = 0) { - $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); - if($task_id > 0) { - $task = $repo->findOneBy(['task_id' => $task_id]); - if($task) { - return new JsonResponse($task); - } - else return new Response('This task does not exists', Response::HTTP_NOT_FOUND); - } - else { - $tasks = $repo->findAll(); + $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); + if ($task_id > 0) { + $task = $repo->findOneBy(['task_id' => $task_id]); + if ($task) { + return new JsonResponse($task); + } + + return new Response('This task does not exists', Response::HTTP_NOT_FOUND); + } else { + $tasks = $repo->findAll(); + + if (!empty($tasks)) { + return new JsonResponse($tasks); + } - if(!empty($tasks)) { - return new JsonResponse($tasks); + return new Response('No Tasks found', Response::HTTP_BAD_REQUEST); } - else return new Response('No Tasks found', Response::HTTP_BAD_REQUEST); - } } /** @@ -59,22 +60,23 @@ public function showTaskAction($task_id = 0) */ public function createTaskAction() { - $data = $this->get("request")->getContent(); - if(!empty($data)) - { - $data = json_decode($data, true); - $task = new Task($data); - - $em = $this->getDoctrine()->getManager(); - $em->persist($task); - $em->flush(); - return new JsonResponse($task); - } - else return new Response('Task could not be saved : missing fields', Response::HTTP_BAD_REQUEST); + $data = $this->get("request")->getContent(); + if (!empty($data)) { + $data = json_decode($data, true); + $task = new Task($data); + + $em = $this->getDoctrine()->getManager(); + $em->persist($task); + $em->flush(); + + return new JsonResponse($task); + } + + return new Response('Task could not be saved : missing fields', Response::HTTP_BAD_REQUEST); } /** - * Updates the values of a given task. + * Updates the values of a given task. * It only update entity attributes that were present in the query. * This action also returns the updated entity as a JSON object if needed by the frontend. * @@ -83,45 +85,47 @@ public function createTaskAction() */ public function updateTaskAction($task_id = 0) { - $data = $this->get('request')->getContent(); - if(!empty($data)) - { - $data = json_decode($data, true); - $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); - $task = $repo->findOneBy(['task_id' => $task_id]); - if($task) - { - /* - @TODO find a way to improve this part. It is quite cumbersome right now : - When an attribute is found as a key of the following array, it calls the - corresponding setter on the entity. - */ - $fields = [ - 'title' => 'setTitle', - 'due_date' => 'setDueDate', - 'done' => 'setDone', - 'priority' => 'setPriority', - 'summary' => 'setSummary', - ]; - foreach($data as $key => $value) - { - if(array_key_exists($key, $fields)) { - $action = $fields[$key]; - $task->$action($value); - } - } - // Manage the assignee if it has been set - if($data['assignee'] != null) - { - $assignee = $this->getDoctrine()->getManager()->getReference('RukienBulletJournalBundle:User', $data['assignee']['user_id']); - $task->setAssignee($assignee); - } - - $this->getDoctrine()->getManager()->flush(); - return new JsonResponse($task); - } else return new Response('No task found', Response::HTTP_BAD_REQUEST); - } else return new Response('Nothing to update !', Response::HTTP_BAD_REQUEST); + $data = $this->get('request')->getContent(); + if (!empty($data)) { + $data = json_decode($data, true); + $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); + $task = $repo->findOneBy(['task_id' => $task_id]); + if ($task) { + /* + @TODO find a way to improve this part. It is quite cumbersome right now : + When an attribute is found as a key of the following array, it calls the + corresponding setter on the entity. + */ + $fields = [ + 'title' => 'setTitle', + 'due_date' => 'setDueDate', + 'done' => 'setDone', + 'priority' => 'setPriority', + 'summary' => 'setSummary', + ]; + + foreach ($data as $key => $value) { + if (array_key_exists($key, $fields)) { + $action = $fields[$key]; + $task->$action($value); + } + } + + // Manage the assignee if it has been set + if ($data['assignee'] != null) { + $assignee = $this->getDoctrine()->getManager()->getReference('RukienBulletJournalBundle:User', $data['assignee']['user_id']); + $task->setAssignee($assignee); + } + + $this->getDoctrine()->getManager()->flush(); + return new JsonResponse($task); + } + + return new Response('No task found', Response::HTTP_BAD_REQUEST); + } + + return new Response('Nothing to update !', Response::HTTP_BAD_REQUEST); } /** @@ -130,28 +134,30 @@ public function updateTaskAction($task_id = 0) * @Route("/tasks/{task_id}", name="delete_task", requirements={"task_id":"\d+"}) * @Method({"DELETE"}) */ - public function deleteTaskAction($task_id) + public function deleteTaskAction($task_id) { - // It could be more efficient by using a custom entity repository and - // create a custom query deleting by ID. To improve later. - $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); - $task = $repo->findOneBy(['task_id' => $task_id]); - if($task) - { - $em = $this->getDoctrine()->getManager(); - $em->remove($task); - $em->flush(); - return new Response('Task deleted', Response::HTTP_OK); - } - else return new Response('Task does not exists', Response::HTTP_NOT_FOUND); + // It could be more efficient by using a custom entity repository and + // create a custom query deleting by ID. To improve later. + $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); + $task = $repo->findOneBy(['task_id' => $task_id]); + if ($task) { + $em = $this->getDoctrine()->getManager(); + $em->remove($task); + $em->flush(); + + return new Response('Task deleted', Response::HTTP_OK); + } + + return new Response('Task does not exists', Response::HTTP_NOT_FOUND); } /** * @Route("/tasks/not-assigned") */ - public function tasksNotAssignedAction() + public function tasksNotAssignedAction() { - $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); - return new JsonResponse($repo->getNotAssignedTasks()); + $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:Task'); + + return new JsonResponse($repo->getNotAssignedTasks()); } } diff --git a/src/Rukien/BulletJournalBundle/Controller/UserController.php b/src/Rukien/BulletJournalBundle/Controller/UserController.php index 5da1d49..2d3adf7 100644 --- a/src/Rukien/BulletJournalBundle/Controller/UserController.php +++ b/src/Rukien/BulletJournalBundle/Controller/UserController.php @@ -19,10 +19,12 @@ class UserController extends Controller */ public function indexAction($user_id = 0) { - $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:User'); - $users = $repo->getUsersSummary($user_id); - if(count($users) == 1 && $user_id > 0) - $users = $users[0]; - return new JsonResponse($users); + $repo = $this->getDoctrine()->getRepository('RukienBulletJournalBundle:User'); + $users = $repo->getUsersSummary($user_id); + if (count($users) == 1 && $user_id > 0) { + $users = $users[0]; + } + + return new JsonResponse($users); } } diff --git a/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadTaskData.php b/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadTaskData.php index a7539db..7817a3c 100644 --- a/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadTaskData.php +++ b/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadTaskData.php @@ -10,61 +10,61 @@ class LoadTaskData extends AbstractFixture implements OrderedFixtureInterface { - public function load(ObjectManager $manager) - { - $task1 = new Task([ - 'title' => 'Fix some bugs', - 'summary' => 'We need to remove the following bug from our app', - 'due_date' => '2016-12-26', - 'done' => false, - 'priority' => Task::PRIORITY_MAX, - ]); - $task1->setAssignee($this->getReference('lovelace-user')); + public function load(ObjectManager $manager) + { + $task1 = new Task([ + 'title' => 'Fix some bugs', + 'summary' => 'We need to remove the following bug from our app', + 'due_date' => '2016-12-26', + 'done' => false, + 'priority' => Task::PRIORITY_MAX, + ]); + $task1->setAssignee($this->getReference('lovelace-user')); - $task2 = new Task([ - 'title' => 'Finish Megaman 2', - 'summary' => 'We need to remove the following bug from our app', - 'done' => false, - 'priority' => Task::PRIORITY_MIN, - ]); + $task2 = new Task([ + 'title' => 'Finish Megaman 2', + 'summary' => 'We need to remove the following bug from our app', + 'done' => false, + 'priority' => Task::PRIORITY_MIN, + ]); - $task3 = new Task([ - 'title' => 'Improve task assignation', - 'summary' => 'Manage a drag and drop system from the dashboard screen, where user can drag an unassigned task from the left list to the user list', - 'due_date' => '2016-12-01', - 'done' => false, - 'priority' => Task::PRIORITY_MIN, - ]); - $task3->setAssignee($this->getReference('lovelace-user')); + $task3 = new Task([ + 'title' => 'Improve task assignation', + 'summary' => 'Manage a drag and drop system from the dashboard screen, where user can drag an unassigned task from the left list to the user list', + 'due_date' => '2016-12-01', + 'done' => false, + 'priority' => Task::PRIORITY_MIN, + ]); + $task3->setAssignee($this->getReference('lovelace-user')); - $task4 = new Task([ - 'title' => 'Write fixtures', - 'summary' => 'We need some fixtures.', - 'due_date' => '2016-11-21', - 'done' => true, - 'priority' => Task::PRIORITY_MED, - ]); - $task4->setAssignee($this->getReference('barrett-user')); + $task4 = new Task([ + 'title' => 'Write fixtures', + 'summary' => 'We need some fixtures.', + 'due_date' => '2016-11-21', + 'done' => true, + 'priority' => Task::PRIORITY_MED, + ]); + $task4->setAssignee($this->getReference('barrett-user')); - $task5 = new Task([ - 'title' => 'Better REST management', - 'summary' => 'We use ngResource to manage the communications with the API. See how we can improve routes, and be more specific about the API standards (go for a versionned API, for example : http:///api/1.0/tasks)', - 'due_date' => '2016-11-15', - 'done' => false, - 'priority' => Task::PRIORITY_MAX, - ]); - $task5->setAssignee($this->getReference('lovelace-user')); + $task5 = new Task([ + 'title' => 'Better REST management', + 'summary' => 'We use ngResource to manage the communications with the API. See how we can improve routes, and be more specific about the API standards (go for a versionned API, for example : http:///api/1.0/tasks)', + 'due_date' => '2016-11-15', + 'done' => false, + 'priority' => Task::PRIORITY_MAX, + ]); + $task5->setAssignee($this->getReference('lovelace-user')); - $manager->persist($task1); - $manager->persist($task2); - $manager->persist($task3); - $manager->persist($task4); - $manager->persist($task5); - $manager->flush(); - } + $manager->persist($task1); + $manager->persist($task2); + $manager->persist($task3); + $manager->persist($task4); + $manager->persist($task5); + $manager->flush(); + } - public function getOrder() - { - return 2; - } + public function getOrder() + { + return 2; + } } diff --git a/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadUserData.php b/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadUserData.php index 286189d..e290d3e 100644 --- a/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadUserData.php +++ b/src/Rukien/BulletJournalBundle/DataFixtures/ORM/LoadUserData.php @@ -10,36 +10,35 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface { - public function load(ObjectManager $manager) - { - $user1 = new User([]); - $user1->setUsername('Bill Murray'); - $user1->setEmail('bill.murray@foobar.com'); - $user1->setType(1); - - $user2 = new User([]); - $user2->setUsername('Syd Barrett'); - $user2->setEmail('sbarrett@foobar.com'); - $user2->setType(2); - - $user3 = new User([]); - $user3->setUsername('Ada Lovelace'); - $user3->setEmail('alovelace@foobar.com'); - $user3->setType(1); - - $manager->persist($user1); - $manager->persist($user2); - $manager->persist($user3); - - $manager->flush(); - - $this->addReference('murray-user', $user1); - $this->addReference('barrett-user', $user2); - $this->addReference('lovelace-user', $user3); - } - - public function getOrder() - { - - } + public function load(ObjectManager $manager) + { + $user1 = new User([]); + $user1->setUsername('Bill Murray'); + $user1->setEmail('bill.murray@foobar.com'); + $user1->setType(1); + + $user2 = new User([]); + $user2->setUsername('Syd Barrett'); + $user2->setEmail('sbarrett@foobar.com'); + $user2->setType(2); + + $user3 = new User([]); + $user3->setUsername('Ada Lovelace'); + $user3->setEmail('alovelace@foobar.com'); + $user3->setType(1); + + $manager->persist($user1); + $manager->persist($user2); + $manager->persist($user3); + + $manager->flush(); + + $this->addReference('murray-user', $user1); + $this->addReference('barrett-user', $user2); + $this->addReference('lovelace-user', $user3); + } + + public function getOrder() + { + } } diff --git a/src/Rukien/BulletJournalBundle/Entity/Task.php b/src/Rukien/BulletJournalBundle/Entity/Task.php index 2d1d0bd..b462201 100644 --- a/src/Rukien/BulletJournalBundle/Entity/Task.php +++ b/src/Rukien/BulletJournalBundle/Entity/Task.php @@ -12,86 +12,90 @@ */ class Task implements JsonSerializable { + const PRIORITY_MIN = 3; + const PRIORITY_MED = 2; + const PRIORITY_MAX = 1; - const PRIORITY_MIN = 3; - const PRIORITY_MED = 2; - const PRIORITY_MAX = 1; - - /** - * @ORM\Column(type="integer") - * @ORM\Id - * @ORM\GeneratedValue(strategy="AUTO") - */ - protected $task_id; - - /** - * @ORM\Column(type="string", length=45) - * @var task title, 45 chars long - */ - protected $title; - - /** - * @ORM\Column(type="boolean") - * @var task done/not done - */ - protected $done; - - /** - * @ORM\Column(type="smallint") - * @var task priority : can be from PRIORITY_LOW to PRIORITY_MAX - */ - protected $priority; - - /** - * @ORM\Column(type="datetime", nullable=true) - */ - protected $due_date; - - /** - * @ORM\ManyToOne(targetEntity="User", inversedBy="tasks") - * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id") - */ - protected $assignee; - - /** - * @ORM\Column(type="text") - */ - protected $summary; - - /** - * @ORM\Column(type="datetime") - */ - protected $created_at; - - /** - * @ORM\Column(type="datetime", nullable=true) - */ - protected $updated_at; - - public function __construct(array $values) - { - if( isset($values['title']) ) - $this->setTitle( $values['title'] ); - if( isset($values['summary']) ) - $this->setSummary( $values['summary'] ); - $this->setDone( isset($values['done']) ? $values['done'] : false ); - $this->setPriority( isset($values['priority']) ? $values['priority'] : self::PRIORITY_MED ); - if(isset($values['due_date']) && $values['due_date'] != '' ) - $this->setDueDate( $values['due_date'] ); - } - - /** - * @ORM\PrePersist - */ - public function onPrePersist() - { - $this->created_at = new \DateTime(); - } + /** + * @ORM\Column(type="integer") + * @ORM\Id + * @ORM\GeneratedValue(strategy="AUTO") + */ + protected $task_id; + + /** + * @ORM\Column(type="string", length=45) + * @var task title, 45 chars long + */ + protected $title; + + /** + * @ORM\Column(type="boolean") + * @var task done/not done + */ + protected $done; + + /** + * @ORM\Column(type="smallint") + * @var task priority : can be from PRIORITY_LOW to PRIORITY_MAX + */ + protected $priority; + + /** + * @ORM\Column(type="datetime", nullable=true) + */ + protected $due_date; + + /** + * @ORM\ManyToOne(targetEntity="User", inversedBy="tasks") + * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id") + */ + protected $assignee; + + /** + * @ORM\Column(type="text") + */ + protected $summary; + + /** + * @ORM\Column(type="datetime") + */ + protected $created_at; + + /** + * @ORM\Column(type="datetime", nullable=true) + */ + protected $updated_at; + + public function __construct(array $values) + { + if (isset($values['title'])) { + $this->setTitle($values['title']); + } + + if (isset($values['summary'])) { + $this->setSummary($values['summary']); + } + + $this->setDone(isset($values['done']) ? $values['done'] : false); + $this->setPriority(isset($values['priority']) ? $values['priority'] : self::PRIORITY_MED); + if (isset($values['due_date']) && $values['due_date'] != '') { + $this->setDueDate($values['due_date']); + } + } + + /** + * @ORM\PrePersist + */ + public function onPrePersist() + { + $this->created_at = new \DateTime(); + } /** * Get task_id * - * @return integer + * @return int */ public function getTaskId() { @@ -114,7 +118,7 @@ public function setTitle($title) /** * Get title * - * @return string + * @return string */ public function getTitle() { @@ -137,7 +141,7 @@ public function setDone($done) /** * Get done * - * @return boolean + * @return boolean */ public function getDone() { @@ -147,7 +151,8 @@ public function getDone() /** * Set priority * - * @param integer $priority + * @param int $priority + * * @return Task */ public function setPriority($priority) @@ -160,7 +165,7 @@ public function setPriority($priority) /** * Get priority * - * @return integer + * @return int */ public function getPriority() { @@ -183,7 +188,7 @@ public function setDueDate($dueDate) /** * Get due_date * - * @return \DateTime + * @return \DateTime */ public function getDueDate() { @@ -206,7 +211,7 @@ public function setCreatedAt($createdAt) /** * Get created_at * - * @return \DateTime + * @return \DateTime */ public function getCreatedAt() { @@ -229,7 +234,7 @@ public function setUpdatedAt($updatedAt) /** * Get updated_at * - * @return \DateTime + * @return \DateTime */ public function getUpdatedAt() { @@ -238,33 +243,34 @@ public function getUpdatedAt() /** * jsonSerialize implementation for Task Entity + * * @return array */ - public function jsonSerialize() { - - // This would be a workaround for the warning in the User Entity (@See User:jsonSerialize()) - $assignee = $this->getAssignee(); - $assigned_user = null; - if($assignee) - { - $assigned_user = [ - 'username' => $assignee->getUsername(), - 'email' => $assignee->getEmail(), - 'type' => $assignee->getType(), - 'user_id' => $assignee->getUserId(), + public function jsonSerialize() + { + // This would be a workaround for the warning in the User Entity (@See User:jsonSerialize()) + $assignee = $this->getAssignee(); + $assigned_user = null; + if ($assignee) { + $assigned_user = [ + 'username' => $assignee->getUsername(), + 'email' => $assignee->getEmail(), + 'type' => $assignee->getType(), + 'user_id' => $assignee->getUserId(), + ]; + } + + return [ + 'task_id' => $this->getTaskId(), + 'title' => $this->getTitle(), + 'priority' => $this->getPriority(), + 'done' => $this->getDone(), + 'summary' => $this->getSummary(), + 'created_at' => !empty($this->getCreatedAt()) ? $this->getCreatedAt()->format('Y-m-d') : '', + 'updated_at' => !empty($this->getUpdatedAt()) ? $this->getUpdatedAt()->format('Y-m-d') : '', + 'due_date' => !empty($this->getDueDate()) ? $this->getDueDate()->format('Y-m-d') : '', + 'assignee' => $assigned_user ]; - } - return [ - 'task_id' => $this->getTaskId(), - 'title' => $this->getTitle(), - 'priority' => $this->getPriority(), - 'done' => $this->getDone(), - 'summary' => $this->getSummary(), - 'created_at' => !empty($this->getCreatedAt()) ? $this->getCreatedAt()->format('Y-m-d') : '', - 'updated_at' => !empty($this->getUpdatedAt()) ? $this->getUpdatedAt()->format('Y-m-d') : '', - 'due_date' => !empty($this->getDueDate()) ? $this->getDueDate()->format('Y-m-d') : '', - 'assignee' => $assigned_user - ]; } /** @@ -283,7 +289,7 @@ public function setSummary($summary) /** * Get summary * - * @return string + * @return string */ public function getSummary() { @@ -306,7 +312,7 @@ public function setAssignee(\Rukien\BulletJournalBundle\Entity\User $assignee = /** * Get assignee * - * @return \Rukien\BulletJournalBundle\Entity\User + * @return \Rukien\BulletJournalBundle\Entity\User */ public function getAssignee() { diff --git a/src/Rukien/BulletJournalBundle/Entity/Task.php~ b/src/Rukien/BulletJournalBundle/Entity/Task.php~ deleted file mode 100644 index 41efc68..0000000 --- a/src/Rukien/BulletJournalBundle/Entity/Task.php~ +++ /dev/null @@ -1,311 +0,0 @@ -setTitle( $values['title'] ); - if( isset($values['summary']) ) - $this->setSummary( $values['summary'] ); - $this->setDone( isset($values['done']) ? $values['done'] : false ); - $this->setPriority( isset($values['priority']) ? $values['priority'] : self::PRIORITY_MED ); - if(isset($values['due_date']) && $values['due_date'] != '' ) - $this->setDueDate( $values['due_date'] ); - } - - /** - * @ORM\PrePersist - */ - public function onPrePersist() - { - $this->created_at = new \DateTime(); - } - - /** - * Get task_id - * - * @return integer - */ - public function getTaskId() - { - return $this->task_id; - } - - /** - * Set title - * - * @param string $title - * @return Task - */ - public function setTitle($title) - { - $this->title = $title; - - return $this; - } - - /** - * Get title - * - * @return string - */ - public function getTitle() - { - return $this->title; - } - - /** - * Set done - * - * @param boolean $done - * @return Task - */ - public function setDone($done) - { - $this->done = $done; - - return $this; - } - - /** - * Get done - * - * @return boolean - */ - public function getDone() - { - return $this->done; - } - - /** - * Set priority - * - * @param integer $priority - * @return Task - */ - public function setPriority($priority) - { - $this->priority = $priority; - - return $this; - } - - /** - * Get priority - * - * @return integer - */ - public function getPriority() - { - return $this->priority; - } - - /** - * Set due_date - * - * @param \DateTime $dueDate - * @return Task - */ - public function setDueDate($dueDate) - { - $this->due_date = new \DateTime($dueDate); - - return $this; - } - - /** - * Get due_date - * - * @return \DateTime - */ - public function getDueDate() - { - return $this->due_date; - } - - /** - * Set created_at - * - * @param \DateTime $createdAt - * @return Task - */ - public function setCreatedAt($createdAt) - { - $this->created_at = new \DateTime($createdAt); - - return $this; - } - - /** - * Get created_at - * - * @return \DateTime - */ - public function getCreatedAt() - { - return $this->created_at; - } - - /** - * Set updated_at - * - * @param \DateTime $updatedAt - * @return Task - */ - public function setUpdatedAt($updatedAt) - { - $this->updated_at = new \DateTime($updatedAt); - - return $this; - } - - /** - * Get updated_at - * - * @return \DateTime - */ - public function getUpdatedAt() - { - return $this->updated_at; - } - - /** - * jsonSerialize implementation for Task Entity - * @return array - */ - public function jsonSerialize() { - return [ - 'task_id' => $this->getTaskId(), - 'title' => $this->getTitle(), - 'priority' => $this->getPriority(), - 'done' => $this->getDone(), - 'summary' => $this->getSummary(), - 'created_at' => !empty($this->getCreatedAt()) ? $this->getCreatedAt()->format('Y-m-d') : '', - 'updated_at' => !empty($this->getUpdatedAt()) ? $this->getUpdatedAt()->format('Y-m-d') : '', - 'due_date' => !empty($this->getDueDate()) ? $this->getDueDate()->format('Y-m-d') : '', - ]; - } - - /** - * Set summary - * - * @param string $summary - * @return Task - */ - public function setSummary($summary) - { - $this->summary = $summary; - - return $this; - } - - /** - * Get summary - * - * @return string - */ - public function getSummary() - { - return $this->summary; - } - - /** - * Add assignees - * - * @param \Rukien\BulletJournalBundle\Entity\User $assignees - * @return Task - */ - public function addAssignee(\Rukien\BulletJournalBundle\Entity\User $assignees) - { - $this->assignees[] = $assignees; - - return $this; - } - - /** - * Remove assignees - * - * @param \Rukien\BulletJournalBundle\Entity\User $assignees - */ - public function removeAssignee(\Rukien\BulletJournalBundle\Entity\User $assignees) - { - $this->assignees->removeElement($assignees); - } - - /** - * Get assignees - * - * @return \Doctrine\Common\Collections\Collection - */ - public function getAssignees() - { - return $this->assignees; - } -} diff --git a/src/Rukien/BulletJournalBundle/Entity/TaskRepository.php b/src/Rukien/BulletJournalBundle/Entity/TaskRepository.php index 53b9311..c3720e5 100644 --- a/src/Rukien/BulletJournalBundle/Entity/TaskRepository.php +++ b/src/Rukien/BulletJournalBundle/Entity/TaskRepository.php @@ -5,17 +5,21 @@ use Doctrine\ORM\EntityRepository; /** - * TaskRepository + * TaskRepository. * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class TaskRepository extends EntityRepository { - public function getNotAssignedTasks() - { - $dql = 'SELECT t FROM RukienBulletJournalBundle:Task t LEFT JOIN t.assignee u WHERE u IS NULL'; - return $this->getEntityManager() - ->createQuery($dql)->getResult(); - } + /** + * Retrieve all tasks that are not affected. + */ + public function getNotAssignedTasks() + { + $dql = 'SELECT t FROM RukienBulletJournalBundle:Task t LEFT JOIN t.assignee u WHERE u IS NULL'; + + return $this->getEntityManager() + ->createQuery($dql)->getResult(); + } } diff --git a/src/Rukien/BulletJournalBundle/Entity/User.php b/src/Rukien/BulletJournalBundle/Entity/User.php index 6422730..0c4cd30 100644 --- a/src/Rukien/BulletJournalBundle/Entity/User.php +++ b/src/Rukien/BulletJournalBundle/Entity/User.php @@ -11,65 +11,65 @@ */ class User implements JsonSerializable { - const TYPE_REPORTER = 'reporter'; - const TYPE_DEVELOPER = 'developer'; - const TYPE_TESTER = 'tester'; - const TYPE_BOSS = 'boss'; - - /** - * @ORM\Column(type="integer") - * @ORM\Id - * @ORM\GeneratedValue(strategy="AUTO") - */ - protected $user_id; - - /** - * @ORM\Column(type="string", length=45) - * @var username, 45 chars long - */ - protected $username; - - /** - * @ORM\Column(type="string", length=100) - * @var user email - */ - protected $email; - - /** - * @ORM\Column(type="string") - * @var user type : reporter, developer... - */ - protected $type; - - /** - * @ORM\OneToMany(targetEntity="Task", mappedBy="assignee") - */ - protected $tasks; + const TYPE_REPORTER = 'reporter'; + const TYPE_DEVELOPER = 'developer'; + const TYPE_TESTER = 'tester'; + const TYPE_BOSS = 'boss'; + + /** + * @ORM\Column(type="integer") + * @ORM\Id + * @ORM\GeneratedValue(strategy="AUTO") + */ + protected $user_id; + + /** + * @ORM\Column(type="string", length=45) + * @var username, 45 chars long + */ + protected $username; - public function __construct(array $values) - { + /** + * @ORM\Column(type="string", length=100) + * @var user email + */ + protected $email; - } + /** + * @ORM\Column(type="string") + * @var user type : reporter, developer... + */ + protected $type; + + /** + * @ORM\OneToMany(targetEntity="Task", mappedBy="assignee") + */ + protected $tasks; + + public function __construct(array $values) + { + } - /** - * jsonSerialize implementation for Task Entity - * @return array - */ - public function jsonSerialize() { - return [ - 'user_id' => $this->getUserId(), - 'username' => $this->getUsername(), - 'email' => $this->getEmail(), - 'type' => $this->getType(), - // /!\ WARNING : take care of it : if tasks know the associated entity, it could throw an infinite loop - 'tasks' => array_map(function($task){ return $task->jsonSerialize(); }, $this->getTasks()->toArray()), - ]; - } - - /** - * Get user_id - * - * @return integer + /** + * jsonSerialize implementation for Task Entity + * @return array + */ + public function jsonSerialize() + { + return [ + 'user_id' => $this->getUserId(), + 'username' => $this->getUsername(), + 'email' => $this->getEmail(), + 'type' => $this->getType(), + // /!\ WARNING : take care of it : if tasks know the associated entity, it could throw an infinite loop + 'tasks' => array_map(function ($task) { + return $task->jsonSerialize(); + }, $this->getTasks()->toArray()), + ]; + } + + /** + * @return int */ public function getUserId() { @@ -77,9 +77,8 @@ public function getUserId() } /** - * Set username - * * @param string $username + * * @return User */ public function setUsername($username) @@ -90,9 +89,7 @@ public function setUsername($username) } /** - * Get username - * - * @return string + * @return string */ public function getUsername() { @@ -100,9 +97,8 @@ public function getUsername() } /** - * Set email - * * @param string $email + * * @return User */ public function setEmail($email) @@ -113,9 +109,7 @@ public function setEmail($email) } /** - * Get email - * - * @return string + * @return string */ public function getEmail() { @@ -123,9 +117,8 @@ public function getEmail() } /** - * Set type - * * @param string $type + * * @return User */ public function setType($type) @@ -136,9 +129,7 @@ public function setType($type) } /** - * Get type - * - * @return string + * @return string */ public function getType() { @@ -146,9 +137,8 @@ public function getType() } /** - * Add tasks - * * @param \Rukien\BulletJournalBundle\Entity\Task $tasks + * * @return User */ public function addTask(\Rukien\BulletJournalBundle\Entity\Task $tasks) @@ -159,8 +149,6 @@ public function addTask(\Rukien\BulletJournalBundle\Entity\Task $tasks) } /** - * Remove tasks - * * @param \Rukien\BulletJournalBundle\Entity\Task $tasks */ public function removeTask(\Rukien\BulletJournalBundle\Entity\Task $tasks) @@ -169,9 +157,7 @@ public function removeTask(\Rukien\BulletJournalBundle\Entity\Task $tasks) } /** - * Get tasks - * - * @return \Doctrine\Common\Collections\Collection + * @return \Doctrine\Common\Collections\Collection */ public function getTasks() { diff --git a/src/Rukien/BulletJournalBundle/Entity/UserRepository.php b/src/Rukien/BulletJournalBundle/Entity/UserRepository.php index f26743c..6cb1180 100644 --- a/src/Rukien/BulletJournalBundle/Entity/UserRepository.php +++ b/src/Rukien/BulletJournalBundle/Entity/UserRepository.php @@ -12,22 +12,28 @@ */ class UserRepository extends EntityRepository { - public function getUsersSummary($id = 0) - { - // @TODO there must be a way to improve the query to only get the nth user tasks - // where the due date is the nearest using only one query - $dql = 'SELECT - partial u.{user_id, username, email}, - partial t.{task_id, title, summary, due_date, created_at, updated_at, done, priority} - FROM RukienBulletJournalBundle:User u LEFT JOIN u.tasks t'; - if($id != 0) - $dql .= ' WHERE u.user_id = :user_id'; - $query =$this->getEntityManager() - ->createQuery($dql); + /** + * Retrieve users summary + */ + public function getUsersSummary($id = 0) + { + // @TODO there must be a way to improve the query to only get the nth user tasks + // where the due date is the nearest using only one query + $dql = 'SELECT + partial u.{user_id, username, email}, + partial t.{task_id, title, summary, due_date, created_at, updated_at, done, priority} + FROM RukienBulletJournalBundle:User u LEFT JOIN u.tasks t'; + if ($id != 0) { + $dql .= ' WHERE u.user_id = :user_id'; + } - if($id != 0) - $query->setParameter('user_id', $id); + $query = $this->getEntityManager() + ->createQuery($dql); - return $query->getResult(); - } + if ($id != 0) { + $query->setParameter('user_id', $id); + } + + return $query->getResult(); + } } diff --git a/src/Rukien/BulletJournalBundle/Tests/Controller/DefaultControllerTest.php b/src/Rukien/BulletJournalBundle/Tests/Controller/DefaultControllerTest.php index 2cb609d..48ca2b2 100644 --- a/src/Rukien/BulletJournalBundle/Tests/Controller/DefaultControllerTest.php +++ b/src/Rukien/BulletJournalBundle/Tests/Controller/DefaultControllerTest.php @@ -8,25 +8,24 @@ */ class DefaultControllerTest extends WebTestCase { - /** - * Verifies the API is up and running - */ - public function testIndex() - { - $client = static::createClient(); - $crawler = $client->request('GET', '/'); - $this->assertEquals(200, $client->getResponse()->getStatusCode()); - } + /** + * Verifies the API is up and running + */ + public function testIndex() + { + $client = static::createClient(); + $crawler = $client->request('GET', '/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + } - /** - * Verifies the number of loaded tasks is correct - */ - public function testTaskList() - { - $client = static::createClient(); - $crawler = $client->request('GET', '/tasks'); - $tasks = json_decode($client->getResponse()->getContent(), true); - $this->assertEquals(count($tasks), 5); - } + /** + * Verifies the number of loaded tasks is correct + */ + public function testTaskList() + { + $client = static::createClient(); + $crawler = $client->request('GET', '/tasks'); + $tasks = json_decode($client->getResponse()->getContent(), true); + $this->assertEquals(count($tasks), 5); + } } -