From 917569cae18b78ba73d9729dc114487400ad6e2e Mon Sep 17 00:00:00 2001 From: Takashi Kanemoto Date: Wed, 15 Apr 2020 17:59:50 +0900 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20knplabs/doctrine?= =?UTF-8?q?-behaviors=E3=81=AETimestampable=E3=82=92=E4=BD=BF=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 2 + composer.lock | 857 +++++++++++++++++++++++++++++++++- config/bundles.php | 2 + config/packages/security.yaml | 23 + src/Entity/Article.php | 47 +- symfony.lock | 48 ++ 6 files changed, 929 insertions(+), 50 deletions(-) create mode 100644 config/packages/security.yaml diff --git a/composer.json b/composer.json index 304ed22..9c65338 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "php": "^7.2.5", "ext-ctype": "*", "ext-iconv": "*", + "knplabs/doctrine-behaviors": "^2.0", "symfony/asset": "5.0.*", "symfony/console": "5.0.*", "symfony/dotenv": "5.0.*", @@ -12,6 +13,7 @@ "symfony/form": "5.0.*", "symfony/framework-bundle": "5.0.*", "symfony/orm-pack": "^1.0", + "symfony/security-bundle": "5.0.*", "symfony/security-csrf": "5.0.*", "symfony/twig-pack": "^1.0", "symfony/validator": "5.0.*", diff --git a/composer.lock b/composer.lock index 8b62cfc..271ee40 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,53 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1fdcafefe9a0038e1d9988b96313f4e2", + "content-hash": "e58395770762e057ac2228e97e3dfc40", "packages": [ + { + "name": "brick/math", + "version": "0.8.14", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "6f7a46b5c3d487b277f38fbd17df57d348cace8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/6f7a46b5c3d487b277f38fbd17df57d348cace8a", + "reference": "6f7a46b5c3d487b277f38fbd17df57d348cace8a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "2.*", + "phpunit/phpunit": "7.*", + "vimeo/psalm": "3.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "time": "2020-02-17T13:57:43+00:00" + }, { "name": "doctrine/annotations", "version": "1.10.1", @@ -1200,6 +1245,225 @@ ], "time": "2014-01-12T16:20:24+00:00" }, + { + "name": "knplabs/doctrine-behaviors", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/DoctrineBehaviors.git", + "reference": "92bd39bab67bdc8698c0db02679484a31029bba3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/DoctrineBehaviors/zipball/92bd39bab67bdc8698c0db02679484a31029bba3", + "reference": "92bd39bab67bdc8698c0db02679484a31029bba3", + "shasum": "" + }, + "require": { + "doctrine/common": "^2.7", + "doctrine/dbal": "^2.9", + "doctrine/orm": "^2.7", + "doctrine/persistence": "^1.3.4", + "nette/utils": "^3.0", + "php": "^7.2", + "ramsey/uuid": "^3.9|^4.0", + "symfony/cache": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/framework-bundle": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/security-core": "^4.4|^5.0", + "symfony/string": "^5.0", + "symplify/package-builder": "^7.2" + }, + "require-dev": { + "doctrine/annotations": "^1.8", + "doctrine/doctrine-bundle": "^2.0", + "ext-pdo_mysql": "*", + "ext-pdo_pgsql": "*", + "ext-pdo_sqlite": "*", + "jakub-onderka/php-parallel-lint": "^1.0", + "phpstan/phpstan": "^0.12.14", + "phpstan/phpstan-doctrine": "^0.12.4", + "phpstan/phpstan-phpunit": "^0.12.2", + "phpunit/phpunit": "^8.5", + "psr/log": "^1.1", + "rector/rector": "^0.7.6", + "symplify/changelog-linker": "^7.2", + "symplify/easy-coding-standard": "^7.2", + "symplify/phpstan-extensions": "^7.2" + }, + "type": "symfony-bundle", + "autoload": { + "psr-4": { + "Knp\\DoctrineBehaviors\\": "src", + "Knp\\DoctrineBehaviors\\PHPStan\\": "utils/phpstan-behaviors/src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Knplabs", + "homepage": "http://knplabs.com" + } + ], + "description": "Doctrine Behavior Traits", + "homepage": "http://knplabs.com", + "keywords": [ + "Blameable", + "behaviors", + "doctrine", + "softdeletable", + "timestampable", + "translatable", + "tree", + "uuid" + ], + "time": "2020-04-01T09:20:12+00:00" + }, + { + "name": "nette/finder", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/nette/finder.git", + "reference": "4ad2c298eb8c687dd0e74ae84206a4186eeaed50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/finder/zipball/4ad2c298eb8c687dd0e74ae84206a4186eeaed50", + "reference": "4ad2c298eb8c687dd0e74ae84206a4186eeaed50", + "shasum": "" + }, + "require": { + "nette/utils": "^2.4 || ^3.0", + "php": ">=7.1" + }, + "conflict": { + "nette/nette": "<2.2" + }, + "require-dev": { + "nette/tester": "^2.0", + "phpstan/phpstan": "^0.12", + "tracy/tracy": "^2.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0", + "GPL-3.0" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "๐Ÿ” Nette Finder: find files and directories with an intuitive API.", + "homepage": "https://nette.org", + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2020-01-03T20:35:40+00:00" + }, + { + "name": "nette/utils", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "2c17d16d8887579ae1c0898ff94a3668997fd3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/2c17d16d8887579ae1c0898ff94a3668997fd3eb", + "reference": "2c17d16d8887579ae1c0898ff94a3668997fd3eb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "nette/tester": "~2.0", + "phpstan/phpstan": "^0.12", + "tracy/tracy": "^2.3" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize() and toAscii()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", + "ext-xml": "to use Strings::length() etc. when mbstring is not available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "๐Ÿ›  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "time": "2020-02-09T14:10:55+00:00" + }, { "name": "ocramius/package-versions", "version": "1.5.1", @@ -1509,6 +1773,148 @@ ], "time": "2020-03-23T09:12:05+00:00" }, + { + "name": "ramsey/collection", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "925ad8cf55ba7a3fc92e332c58fd0478ace3e1ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/925ad8cf55ba7a3fc92e332c58fd0478ace3e1ca", + "reference": "925ad8cf55ba7a3fc92e332c58fd0478ace3e1ca", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "fzaninotto/faker": "^1.5", + "jakub-onderka/php-parallel-lint": "^1", + "jangregor/phpstan-prophecy": "^0.6", + "mockery/mockery": "^1.3", + "phpstan/extension-installer": "^1", + "phpstan/phpdoc-parser": "0.4.1", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5", + "slevomat/coding-standard": "^6.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP 7.2+ library for representing and manipulating collections.", + "homepage": "https://github.com/ramsey/collection", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "time": "2020-01-05T00:22:59+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "ba8fff1d3abb8bb4d35a135ed22a31c6ef3ede3d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/ba8fff1d3abb8bb4d35a135ed22a31c6ef3ede3d", + "reference": "ba8fff1d3abb8bb4d35a135ed22a31c6ef3ede3d", + "shasum": "" + }, + "require": { + "brick/math": "^0.8", + "ext-json": "*", + "php": "^7.2 || ^8", + "ramsey/collection": "^1.0", + "symfony/polyfill-ctype": "^1.8" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "codeception/aspect-mock": "^3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2", + "doctrine/annotations": "^1.8", + "goaop/framework": "^2", + "mockery/mockery": "^1.3", + "moontoast/math": "^1.1", + "paragonie/random-lib": "^2", + "php-mock/php-mock-mockery": "^1.3", + "php-mock/php-mock-phpunit": "^2.5", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/extension-installer": "^1.0", + "phpstan/phpdoc-parser": "0.4.3", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-mockery": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^8.5", + "psy/psysh": "^0.10.0", + "slevomat/coding-standard": "^6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "3.9.4" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-ctype": "Enables faster processing of character classification using ctype functions.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Uuid\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "homepage": "https://github.com/ramsey/uuid", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "time": "2020-03-29T20:13:32+00:00" + }, { "name": "symfony/asset", "version": "v5.0.7", @@ -3040,6 +3446,66 @@ "description": "A pack for the Doctrine ORM", "time": "2020-02-10T18:03:48+00:00" }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b6786f69dd7b062390582f20520ab4918283217e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b6786f69dd7b062390582f20520ab4918283217e", + "reference": "b6786f69dd7b062390582f20520ab4918283217e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "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 for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-03-09T19:04:49+00:00" + }, { "name": "symfony/polyfill-intl-icu", "version": "v1.15.0", @@ -3161,24 +3627,24 @@ "time": "2020-03-09T19:04:49+00:00" }, { - "name": "symfony/polyfill-mbstring", + "name": "symfony/polyfill-intl-normalizer", "version": "v1.15.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "e62715f03f90dd8d2f3eb5daa21b4d19d71aebde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/e62715f03f90dd8d2f3eb5daa21b4d19d71aebde", + "reference": "e62715f03f90dd8d2f3eb5daa21b4d19d71aebde", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-intl": "For best performance" }, "type": "library", "extra": { @@ -3188,7 +3654,70 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "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 for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "time": "2020-02-27T09:26:54+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" @@ -3420,6 +3949,89 @@ ], "time": "2020-03-30T11:42:42+00:00" }, + { + "name": "symfony/security-bundle", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/security-bundle.git", + "reference": "1f42f8213cfbffce09c0a1834f34a4b1d444c4c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/1f42f8213cfbffce09c0a1834f34a4b1d444c4c1", + "reference": "1f42f8213cfbffce09c0a1834f34a4b1d444c4c1", + "shasum": "" + }, + "require": { + "ext-xml": "*", + "php": "^7.2.5", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/http-kernel": "^5.0", + "symfony/security-core": "^4.4|^5.0", + "symfony/security-csrf": "^4.4|^5.0", + "symfony/security-guard": "^4.4|^5.0", + "symfony/security-http": "^4.4.5|^5.0.5" + }, + "conflict": { + "symfony/browser-kit": "<4.4", + "symfony/console": "<4.4", + "symfony/framework-bundle": "<4.4", + "symfony/ldap": "<4.4", + "symfony/twig-bundle": "<4.4" + }, + "require-dev": { + "doctrine/doctrine-bundle": "^2.0", + "symfony/asset": "^4.4|^5.0", + "symfony/browser-kit": "^4.4|^5.0", + "symfony/console": "^4.4|^5.0", + "symfony/css-selector": "^4.4|^5.0", + "symfony/dom-crawler": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/form": "^4.4|^5.0", + "symfony/framework-bundle": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/serializer": "^4.4|^5.0", + "symfony/translation": "^4.4|^5.0", + "symfony/twig-bridge": "^4.4|^5.0", + "symfony/twig-bundle": "^4.4|^5.0", + "symfony/validator": "^4.4|^5.0", + "symfony/yaml": "^4.4|^5.0", + "twig/twig": "^2.10|^3.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\SecurityBundle\\": "" + }, + "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 SecurityBundle", + "homepage": "https://symfony.com", + "time": "2020-03-30T11:42:42+00:00" + }, { "name": "symfony/security-core", "version": "v5.0.7", @@ -3552,6 +4164,125 @@ "homepage": "https://symfony.com", "time": "2020-03-27T16:56:45+00:00" }, + { + "name": "symfony/security-guard", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/security-guard.git", + "reference": "ebdb461f5ca98027c21899049fa4b01a58256b67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security-guard/zipball/ebdb461f5ca98027c21899049fa4b01a58256b67", + "reference": "ebdb461f5ca98027c21899049fa4b01a58256b67", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/security-core": "^5.0", + "symfony/security-http": "^4.4.1|^5.0.1" + }, + "require-dev": { + "psr/log": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Security\\Guard\\": "" + }, + "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 Security Component - Guard", + "homepage": "https://symfony.com", + "time": "2020-03-27T16:56:45+00:00" + }, + { + "name": "symfony/security-http", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/security-http.git", + "reference": "af7315dafa9e402969f1cc433a8f719a4b9bcd98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security-http/zipball/af7315dafa9e402969f1cc433a8f719a4b9bcd98", + "reference": "af7315dafa9e402969f1cc433a8f719a4b9bcd98", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/http-foundation": "^4.4.7|^5.0.7", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.0", + "symfony/security-core": "^4.4.7|^5.0.7" + }, + "conflict": { + "symfony/security-csrf": "<4.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/routing": "^4.4|^5.0", + "symfony/security-csrf": "^4.4|^5.0" + }, + "suggest": { + "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", + "symfony/security-csrf": "For using tokens to protect authentication/logout attempts" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Security\\Http\\": "" + }, + "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 Security Component - HTTP Integration", + "homepage": "https://symfony.com", + "time": "2020-03-30T14:14:32+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.0.1", @@ -3660,6 +4391,70 @@ "homepage": "https://symfony.com", "time": "2020-03-27T16:56:45+00:00" }, + { + "name": "symfony/string", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "48a2f4b3597514e6c885c0ddb22d3bbdb60517d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/48a2f4b3597514e6c885c0ddb22d3bbdb60517d0", + "reference": "48a2f4b3597514e6c885c0ddb22d3bbdb60517d0", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^1.1|^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "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 String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "time": "2020-03-16T13:02:39+00:00" + }, { "name": "symfony/translation-contracts", "version": "v2.0.1", @@ -4261,6 +5056,52 @@ "homepage": "https://symfony.com", "time": "2020-03-30T11:42:42+00:00" }, + { + "name": "symplify/package-builder", + "version": "v7.2.12", + "source": { + "type": "git", + "url": "https://github.com/symplify/package-builder.git", + "reference": "9eacafc4bfc0f5b1ce785ff5662bc3309786c6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symplify/package-builder/zipball/9eacafc4bfc0f5b1ce785ff5662bc3309786c6dd", + "reference": "9eacafc4bfc0f5b1ce785ff5662bc3309786c6dd", + "shasum": "" + }, + "require": { + "nette/finder": "^2.5", + "nette/utils": "^3.0", + "php": "^7.2", + "symfony/config": "^4.4|^5.0", + "symfony/console": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/yaml": "^4.4|^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symplify\\PackageBuilder\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Dependency Injection, Console and Kernel toolkit for Symplify packages.", + "time": "2020-04-07T13:55:45+00:00" + }, { "name": "twig/extra-bundle", "version": "v3.0.3", diff --git a/config/bundles.php b/config/bundles.php index f702c9a..a319311 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -8,4 +8,6 @@ Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Knp\DoctrineBehaviors\DoctrineBehaviorsBundle::class => ['all' => true], + Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], ]; diff --git a/config/packages/security.yaml b/config/packages/security.yaml new file mode 100644 index 0000000..811681e --- /dev/null +++ b/config/packages/security.yaml @@ -0,0 +1,23 @@ +security: + # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers + providers: + users_in_memory: { memory: null } + firewalls: + dev: + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + main: + anonymous: lazy + provider: users_in_memory + + # activate different ways to authenticate + # https://symfony.com/doc/current/security.html#firewalls-authentication + + # https://symfony.com/doc/current/security/impersonating_user.html + # switch_user: true + + # Easy way to control access for large sections of your site + # Note: Only the *first* access control that matches will be used + access_control: + # - { path: ^/admin, roles: ROLE_ADMIN } + # - { path: ^/profile, roles: ROLE_USER } diff --git a/src/Entity/Article.php b/src/Entity/Article.php index 50996b2..8ab43d7 100644 --- a/src/Entity/Article.php +++ b/src/Entity/Article.php @@ -2,16 +2,18 @@ namespace App\Entity; -use DateTimeInterface as DateTimeInterfaceAlias; use Doctrine\ORM\Mapping as ORM; +use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface; +use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity(repositoryClass="App\Repository\ArticleRepository") - * @ORM\HasLifecycleCallbacks() */ -class Article +class Article implements TimestampableInterface { + use TimestampableTrait; + /** * @ORM\Id() * @ORM\GeneratedValue() @@ -32,16 +34,6 @@ class Article */ private $body; - /** - * @ORM\Column(type="datetime") - */ - private $createdAt; - - /** - * @ORM\Column(type="datetime") - */ - private $updatedAt; - public function getId(): ?int { return $this->id; @@ -70,33 +62,4 @@ public function setBody(string $body): self return $this; } - - public function getCreatedAt(): ?DateTimeInterfaceAlias - { - return $this->createdAt; - } - - public function setCreatedAt(DateTimeInterfaceAlias $createdAt): self - { - $this->createdAt = $createdAt; - - return $this; - } - - public function setUpdatedAt(DateTimeInterfaceAlias $updatedAt): self - { - $this->updatedAt = $updatedAt; - - return $this; - } - - /** - * @ORM\PrePersist() - */ - public function prePersist() - { - $now = new \DateTime(); - $this->setCreatedAt($now); - $this->setUpdatedAt($now); - } } diff --git a/symfony.lock b/symfony.lock index 92d3d45..0093ee3 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,7 @@ { + "brick/math": { + "version": "0.8.14" + }, "doctrine/annotations": { "version": "1.0", "recipe": { @@ -78,6 +81,15 @@ "jdorn/sql-formatter": { "version": "v1.2.17" }, + "knplabs/doctrine-behaviors": { + "version": "v2.0.3" + }, + "nette/finder": { + "version": "v2.5.2" + }, + "nette/utils": { + "version": "v3.1.1" + }, "nikic/php-parser": { "version": "v4.4.0" }, @@ -102,6 +114,12 @@ "psr/log": { "version": "1.1.3" }, + "ramsey/collection": { + "version": "1.0.1" + }, + "ramsey/uuid": { + "version": "4.0.1" + }, "symfony/asset": { "version": "v5.0.7" }, @@ -216,12 +234,18 @@ "symfony/orm-pack": { "version": "v1.0.8" }, + "symfony/polyfill-intl-grapheme": { + "version": "v1.15.0" + }, "symfony/polyfill-intl-icu": { "version": "v1.15.0" }, "symfony/polyfill-intl-idn": { "version": "v1.15.0" }, + "symfony/polyfill-intl-normalizer": { + "version": "v1.15.0" + }, "symfony/polyfill-mbstring": { "version": "v1.15.0" }, @@ -245,18 +269,39 @@ "config/routes.yaml" ] }, + "symfony/security-bundle": { + "version": "4.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "4.4", + "ref": "7b4408dc203049666fe23fabed23cbadc6d8440f" + }, + "files": [ + "config/packages/security.yaml" + ] + }, "symfony/security-core": { "version": "v5.0.7" }, "symfony/security-csrf": { "version": "v5.0.7" }, + "symfony/security-guard": { + "version": "v5.0.7" + }, + "symfony/security-http": { + "version": "v5.0.7" + }, "symfony/service-contracts": { "version": "v2.0.1" }, "symfony/stopwatch": { "version": "v5.0.7" }, + "symfony/string": { + "version": "v5.0.7" + }, "symfony/translation-contracts": { "version": "v2.0.1" }, @@ -321,6 +366,9 @@ "symfony/yaml": { "version": "v5.0.7" }, + "symplify/package-builder": { + "version": "v7.2.12" + }, "twig/extra-bundle": { "version": "v3.0.3" }, From 77536e2bd13f28d0ec9e5447a696cdf6ce94a54c Mon Sep 17 00:00:00 2001 From: Takashi Kanemoto Date: Wed, 15 Apr 2020 18:02:00 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E3=83=90=E3=83=AA?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=8C=E4=B8=8D?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Entity/Article.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Entity/Article.php b/src/Entity/Article.php index 8ab43d7..69a211e 100644 --- a/src/Entity/Article.php +++ b/src/Entity/Article.php @@ -23,6 +23,7 @@ class Article implements TimestampableInterface /** * @ORM\Column(type="string", length=255) + * * @Assert\NotBlank * @Assert\Length(max=255) */ @@ -30,6 +31,8 @@ class Article implements TimestampableInterface /** * @ORM\Column(type="text") + * + * @Assert\NotBlank * @Assert\Length(max=1000) */ private $body; From bb29c09338b6828bfdde09327b4dd02b4d247630 Mon Sep 17 00:00:00 2001 From: Takashi Kanemoto Date: Wed, 15 Apr 2020 18:09:51 +0900 Subject: [PATCH 3/4] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=83=AD=E3=83=BC=E3=83=A9=E3=81=AE=E3=82=A2?= =?UTF-8?q?=E3=83=8E=E3=83=86=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=A8?= =?UTF-8?q?DI=E6=96=B9=E6=B3=95=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/ArticlesController.php | 56 +++++++++++++++++---------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index 9efa30c..8345426 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -5,60 +5,76 @@ use App\Entity\Article; use App\Entity\PostCount; use App\Form\ArticleType; +use App\Repository\ArticleRepository; use App\Repository\PostCountRepository; use DateTime; -use Exception; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +/** + * @Route("/articles", name="articles_") + */ class ArticlesController extends AbstractController { /** - * @Route("/articles", name="articles") + * @var ArticleRepository + */ + private $repository; + + /** + * @var EntityManagerInterface + */ + private $em; + + public function __construct(ArticleRepository $repository, EntityManagerInterface $em) + { + $this->repository = $repository; + $this->em = $em; + } + + /** + * @Route("/", name="index") */ public function index() { - $articleRepository = $this->getDoctrine()->getRepository(Article::class); - $articles = $articleRepository->findAll(); + $articles = $this->repository->findAll(); + return $this->render('articles/index.html.twig', [ 'articles' => $articles, ]); } /** - * @Route("/articles/new", name="articles_new") - * @param Request $request - * @return RedirectResponse|Response - * @throws Exception + * @Route("/new", name="new") */ - public function new(Request $request) + public function new(Request $request, PostCountRepository $postCountRepository) { $article = new Article(); - $form = $this->createForm(ArticleType::class, $article); + $form = $this->createForm(ArticleType::class, $article); $form->handleRequest($request); + if ($form->isSubmitted() && $form->isValid()) { - $article = $form->getData(); - $entityManager = $this->getDoctrine()->getManager(); - $entityManager->persist($article); - /** @var PostCountRepository $postCountRepository */ - $postCountRepository = $this->getDoctrine()->getRepository(PostCount::class); + $this->em->persist($article); + $postCount = $postCountRepository->findOneBy([ 'postDate' => new DateTime(), ]); + if (empty($postCount)) { $postCount = new PostCount(); $postCount->setPostDate(new DateTime()); - $entityManager->persist($postCount); + $this->em->persist($postCount); } + $postCount->setPostCount($postCount->getPostCount() + 1); - $entityManager->flush(); + $this->em->flush(); $this->addFlash('success', '็™ป้Œฒใ—ใพใ—ใŸ'); - return $this->redirectToRoute('articles'); + + return $this->redirectToRoute('articles_index'); } return $this->render('articles/new.html.twig', [ From a0a45eea4b2046a4d9d982aa04257447e39311e0 Mon Sep 17 00:00:00 2001 From: Takashi Kanemoto Date: Wed, 15 Apr 2020 19:04:20 +0900 Subject: [PATCH 4/4] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20PostCount?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=81=97=E3=81=A6ArticleRepository=E3=81=A7?= =?UTF-8?q?=E5=90=8C=E7=AD=89=E3=81=AE=E6=83=85=E5=A0=B1=E3=82=92=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E5=8F=AF=E8=83=BD=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 1 + composer.lock | 56 +++++++++++++++++++++++- config/packages/doctrine.yaml | 3 ++ src/Controller/ArticlesController.php | 20 ++------- src/Entity/PostCount.php | 60 -------------------------- src/Repository/ArticleRepository.php | 19 ++++++++ src/Repository/PostCountRepository.php | 50 --------------------- symfony.lock | 3 ++ templates/articles/index.html.twig | 12 ++++++ 9 files changed, 97 insertions(+), 127 deletions(-) delete mode 100644 src/Entity/PostCount.php delete mode 100644 src/Repository/PostCountRepository.php diff --git a/composer.json b/composer.json index 9c65338..c2f8f30 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "php": "^7.2.5", "ext-ctype": "*", "ext-iconv": "*", + "beberlei/doctrineextensions": "^1.2", "knplabs/doctrine-behaviors": "^2.0", "symfony/asset": "5.0.*", "symfony/console": "5.0.*", diff --git a/composer.lock b/composer.lock index 271ee40..6813e23 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,62 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e58395770762e057ac2228e97e3dfc40", + "content-hash": "2c8c0d4940d302d56144daeccd1c797d", "packages": [ + { + "name": "beberlei/doctrineextensions", + "version": "v1.2.6", + "source": { + "type": "git", + "url": "https://github.com/beberlei/DoctrineExtensions.git", + "reference": "af72c4a136b744f1268ca8bb4da47a2f8af78f86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/DoctrineExtensions/zipball/af72c4a136b744f1268ca8bb4da47a2f8af78f86", + "reference": "af72c4a136b744f1268ca8bb4da47a2f8af78f86", + "shasum": "" + }, + "require": { + "doctrine/orm": "^2.6", + "php": "^7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14", + "nesbot/carbon": "*", + "phpunit/phpunit": "^7.0 || ^8.0", + "symfony/yaml": "^4.2", + "zf1/zend-date": "^1.12", + "zf1/zend-registry": "^1.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "DoctrineExtensions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Steve Lacey", + "email": "steve@stevelacey.net" + } + ], + "description": "A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL and Oracle.", + "keywords": [ + "database", + "doctrine", + "orm" + ], + "time": "2019-12-05T09:49:04+00:00" + }, { "name": "brick/math", "version": "0.8.14", diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 5e80e77..68e59c2 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -16,3 +16,6 @@ doctrine: dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' alias: App + dql: + datetime_functions: + date_format: DoctrineExtensions\Query\Sqlite\DateFormat diff --git a/src/Controller/ArticlesController.php b/src/Controller/ArticlesController.php index 8345426..dc97dfd 100644 --- a/src/Controller/ArticlesController.php +++ b/src/Controller/ArticlesController.php @@ -3,11 +3,8 @@ namespace App\Controller; use App\Entity\Article; -use App\Entity\PostCount; use App\Form\ArticleType; use App\Repository\ArticleRepository; -use App\Repository\PostCountRepository; -use DateTime; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; @@ -40,16 +37,18 @@ public function __construct(ArticleRepository $repository, EntityManagerInterfac public function index() { $articles = $this->repository->findAll(); + $postCounts = $this->repository->findPostCountByDate(); return $this->render('articles/index.html.twig', [ 'articles' => $articles, + 'postCounts' => $postCounts, ]); } /** * @Route("/new", name="new") */ - public function new(Request $request, PostCountRepository $postCountRepository) + public function new(Request $request) { $article = new Article(); @@ -57,19 +56,8 @@ public function new(Request $request, PostCountRepository $postCountRepository) $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { - $this->em->persist($article); - - $postCount = $postCountRepository->findOneBy([ - 'postDate' => new DateTime(), - ]); - if (empty($postCount)) { - $postCount = new PostCount(); - $postCount->setPostDate(new DateTime()); - $this->em->persist($postCount); - } - - $postCount->setPostCount($postCount->getPostCount() + 1); + $this->em->persist($article); $this->em->flush(); $this->addFlash('success', '็™ป้Œฒใ—ใพใ—ใŸ'); diff --git a/src/Entity/PostCount.php b/src/Entity/PostCount.php deleted file mode 100644 index 4c141f1..0000000 --- a/src/Entity/PostCount.php +++ /dev/null @@ -1,60 +0,0 @@ -id; - } - - public function getPostDate(): ?\DateTimeInterface - { - return $this->postDate; - } - - public function setPostDate(\DateTimeInterface $postDate): self - { - $this->postDate = $postDate; - - return $this; - } - - public function getPostCount(): ?int - { - return $this->postCount; - } - - public function setPostCount(int $postCount): self - { - $this->postCount = $postCount; - - return $this; - } -} diff --git a/src/Repository/ArticleRepository.php b/src/Repository/ArticleRepository.php index 3f1638d..f1186b2 100644 --- a/src/Repository/ArticleRepository.php +++ b/src/Repository/ArticleRepository.php @@ -19,6 +19,25 @@ public function __construct(ManagerRegistry $registry) parent::__construct($registry, Article::class); } + public function findPostCountByDate(string $after = null, string $before = null) + { + $qb = $this->createQueryBuilder('a') + ->select('date_format(a.createdAt, \'%Y-%m-%d\') as date', 'COUNT(a.id) as count') + ->groupBy('date') + ->orderBy('a.createdAt', 'asc') + ; + + if ($after) { + $qb->andWhere('a.createdAt >= :after')->setParameter('after', new \DateTime($after)); + } + + if ($before) { + $qb->andWhere('a.createdAt <= :before')->setParameter('before', new \DateTime($before)); + } + + return $qb->getQuery()->getResult(); + } + // /** // * @return Article[] Returns an array of Article objects // */ diff --git a/src/Repository/PostCountRepository.php b/src/Repository/PostCountRepository.php deleted file mode 100644 index 116e999..0000000 --- a/src/Repository/PostCountRepository.php +++ /dev/null @@ -1,50 +0,0 @@ -createQueryBuilder('p') - ->andWhere('p.exampleField = :val') - ->setParameter('val', $value) - ->orderBy('p.id', 'ASC') - ->setMaxResults(10) - ->getQuery() - ->getResult() - ; - } - */ - - /* - public function findOneBySomeField($value): ?PostCount - { - return $this->createQueryBuilder('p') - ->andWhere('p.exampleField = :val') - ->setParameter('val', $value) - ->getQuery() - ->getOneOrNullResult() - ; - } - */ -} diff --git a/symfony.lock b/symfony.lock index 0093ee3..0d20298 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,7 @@ { + "beberlei/doctrineextensions": { + "version": "v1.2.6" + }, "brick/math": { "version": "0.8.14" }, diff --git a/templates/articles/index.html.twig b/templates/articles/index.html.twig index d605356..03b70f3 100644 --- a/templates/articles/index.html.twig +++ b/templates/articles/index.html.twig @@ -37,5 +37,17 @@ + +

ๆ—ฅไป˜ใ”ใจใฎๆŠ•็จฟๆ•ฐ

+ + + {% for postCount in postCounts %} + + + + + {% endfor %} + +
{{ postCount.date|date('Y/m/d') }}{{ postCount.count }}
{% endblock %}