diff options
-rw-r--r-- | composer.json | 2 | ||||
-rw-r--r-- | composer.lock | 91 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/FeedController.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 23 | ||||
-rw-r--r-- | src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | 17 | ||||
-rw-r--r-- | tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php | 4 |
6 files changed, 78 insertions, 61 deletions
diff --git a/composer.json b/composer.json index 44ac3474..46dc409b 100644 --- a/composer.json +++ b/composer.json | |||
@@ -78,7 +78,7 @@ | |||
78 | "guzzlehttp/guzzle": "^5.3.1", | 78 | "guzzlehttp/guzzle": "^5.3.1", |
79 | "doctrine/doctrine-migrations-bundle": "^1.3", | 79 | "doctrine/doctrine-migrations-bundle": "^1.3", |
80 | "craue/config-bundle": "dev-utf8mb4", | 80 | "craue/config-bundle": "dev-utf8mb4", |
81 | "mnapoli/piwik-twig-extension": "^1.0", | 81 | "mnapoli/piwik-twig-extension": "^2.0", |
82 | "ocramius/proxy-manager": "^2.1.1", | 82 | "ocramius/proxy-manager": "^2.1.1", |
83 | "white-october/pagerfanta-bundle": "^1.1", | 83 | "white-october/pagerfanta-bundle": "^1.1", |
84 | "php-amqplib/rabbitmq-bundle": "^1.14", | 84 | "php-amqplib/rabbitmq-bundle": "^1.14", |
diff --git a/composer.lock b/composer.lock index a0ac3e6d..8ff8fba8 100644 --- a/composer.lock +++ b/composer.lock | |||
@@ -4,7 +4,7 @@ | |||
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | "content-hash": "7e872d70c69629db503d9b8ed18e0f40", | 7 | "content-hash": "7b43c6d21bc5016660c4e95aa0fdbc12", |
8 | "packages": [ | 8 | "packages": [ |
9 | { | 9 | { |
10 | "name": "bdunogier/guzzle-site-authenticator", | 10 | "name": "bdunogier/guzzle-site-authenticator", |
@@ -3669,16 +3669,16 @@ | |||
3669 | }, | 3669 | }, |
3670 | { | 3670 | { |
3671 | "name": "j0k3r/graby-site-config", | 3671 | "name": "j0k3r/graby-site-config", |
3672 | "version": "1.0.84", | 3672 | "version": "1.0.85", |
3673 | "source": { | 3673 | "source": { |
3674 | "type": "git", | 3674 | "type": "git", |
3675 | "url": "https://github.com/j0k3r/graby-site-config.git", | 3675 | "url": "https://github.com/j0k3r/graby-site-config.git", |
3676 | "reference": "37ae71639d3844d022ea402a1f87af7e28d12cac" | 3676 | "reference": "64e6092f583ecc55db0b9e8e33162a4fca2f6659" |
3677 | }, | 3677 | }, |
3678 | "dist": { | 3678 | "dist": { |
3679 | "type": "zip", | 3679 | "type": "zip", |
3680 | "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/37ae71639d3844d022ea402a1f87af7e28d12cac", | 3680 | "url": "https://api.github.com/repos/j0k3r/graby-site-config/zipball/64e6092f583ecc55db0b9e8e33162a4fca2f6659", |
3681 | "reference": "37ae71639d3844d022ea402a1f87af7e28d12cac", | 3681 | "reference": "64e6092f583ecc55db0b9e8e33162a4fca2f6659", |
3682 | "shasum": "" | 3682 | "shasum": "" |
3683 | }, | 3683 | }, |
3684 | "require": { | 3684 | "require": { |
@@ -3705,7 +3705,7 @@ | |||
3705 | } | 3705 | } |
3706 | ], | 3706 | ], |
3707 | "description": "Graby site config files", | 3707 | "description": "Graby site config files", |
3708 | "time": "2019-05-23T07:28:03+00:00" | 3708 | "time": "2019-06-07T20:24:21+00:00" |
3709 | }, | 3709 | }, |
3710 | { | 3710 | { |
3711 | "name": "j0k3r/httplug-ssrf-plugin", | 3711 | "name": "j0k3r/httplug-ssrf-plugin", |
@@ -4783,24 +4783,25 @@ | |||
4783 | }, | 4783 | }, |
4784 | { | 4784 | { |
4785 | "name": "mnapoli/piwik-twig-extension", | 4785 | "name": "mnapoli/piwik-twig-extension", |
4786 | "version": "1.0.0", | 4786 | "version": "2.0.0", |
4787 | "source": { | 4787 | "source": { |
4788 | "type": "git", | 4788 | "type": "git", |
4789 | "url": "https://github.com/mnapoli/PiwikTwigExtension.git", | 4789 | "url": "https://github.com/mnapoli/PiwikTwigExtension.git", |
4790 | "reference": "5171ab7221830a9d377add03dd60dbe6bd7b331f" | 4790 | "reference": "95cafbaca13e436b1939fe0e70079f6db893fd51" |
4791 | }, | 4791 | }, |
4792 | "dist": { | 4792 | "dist": { |
4793 | "type": "zip", | 4793 | "type": "zip", |
4794 | "url": "https://api.github.com/repos/mnapoli/PiwikTwigExtension/zipball/5171ab7221830a9d377add03dd60dbe6bd7b331f", | 4794 | "url": "https://api.github.com/repos/mnapoli/PiwikTwigExtension/zipball/95cafbaca13e436b1939fe0e70079f6db893fd51", |
4795 | "reference": "5171ab7221830a9d377add03dd60dbe6bd7b331f", | 4795 | "reference": "95cafbaca13e436b1939fe0e70079f6db893fd51", |
4796 | "shasum": "" | 4796 | "shasum": "" |
4797 | }, | 4797 | }, |
4798 | "require": { | 4798 | "require": { |
4799 | "php": ">=5.4", | 4799 | "php": ">=7.0", |
4800 | "twig/twig": "~1.10" | 4800 | "twig/twig": "~2.10" |
4801 | }, | 4801 | }, |
4802 | "require-dev": { | 4802 | "require-dev": { |
4803 | "phpunit/phpunit": "~4.0" | 4803 | "php-coveralls/php-coveralls": "^2.0", |
4804 | "symfony/phpunit-bridge": "^4.2" | ||
4804 | }, | 4805 | }, |
4805 | "type": "library", | 4806 | "type": "library", |
4806 | "autoload": { | 4807 | "autoload": { |
@@ -4812,7 +4813,7 @@ | |||
4812 | "license": [ | 4813 | "license": [ |
4813 | "MIT" | 4814 | "MIT" |
4814 | ], | 4815 | ], |
4815 | "time": "2014-09-16T06:51:19+00:00" | 4816 | "time": "2019-06-21T10:24:22+00:00" |
4816 | }, | 4817 | }, |
4817 | { | 4818 | { |
4818 | "name": "monolog/monolog", | 4819 | "name": "monolog/monolog", |
@@ -7277,16 +7278,16 @@ | |||
7277 | }, | 7278 | }, |
7278 | { | 7279 | { |
7279 | "name": "sentry/sentry", | 7280 | "name": "sentry/sentry", |
7280 | "version": "2.1.0", | 7281 | "version": "2.1.1", |
7281 | "source": { | 7282 | "source": { |
7282 | "type": "git", | 7283 | "type": "git", |
7283 | "url": "https://github.com/getsentry/sentry-php.git", | 7284 | "url": "https://github.com/getsentry/sentry-php.git", |
7284 | "reference": "1f1704806820c16dcefcbf2e80b920024fda2234" | 7285 | "reference": "8e27e6c5fcf6f01fc2e5235dd14cc0b2b347d793" |
7285 | }, | 7286 | }, |
7286 | "dist": { | 7287 | "dist": { |
7287 | "type": "zip", | 7288 | "type": "zip", |
7288 | "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/1f1704806820c16dcefcbf2e80b920024fda2234", | 7289 | "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/8e27e6c5fcf6f01fc2e5235dd14cc0b2b347d793", |
7289 | "reference": "1f1704806820c16dcefcbf2e80b920024fda2234", | 7290 | "reference": "8e27e6c5fcf6f01fc2e5235dd14cc0b2b347d793", |
7290 | "shasum": "" | 7291 | "shasum": "" |
7291 | }, | 7292 | }, |
7292 | "require": { | 7293 | "require": { |
@@ -7352,7 +7353,7 @@ | |||
7352 | "logging", | 7353 | "logging", |
7353 | "sentry" | 7354 | "sentry" |
7354 | ], | 7355 | ], |
7355 | "time": "2019-05-22T07:44:47+00:00" | 7356 | "time": "2019-06-13T11:27:23+00:00" |
7356 | }, | 7357 | }, |
7357 | { | 7358 | { |
7358 | "name": "sentry/sentry-symfony", | 7359 | "name": "sentry/sentry-symfony", |
@@ -7791,16 +7792,16 @@ | |||
7791 | }, | 7792 | }, |
7792 | { | 7793 | { |
7793 | "name": "symfony/http-client-contracts", | 7794 | "name": "symfony/http-client-contracts", |
7794 | "version": "v1.1.3", | 7795 | "version": "v1.1.5", |
7795 | "source": { | 7796 | "source": { |
7796 | "type": "git", | 7797 | "type": "git", |
7797 | "url": "https://github.com/symfony/http-client-contracts.git", | 7798 | "url": "https://github.com/symfony/http-client-contracts.git", |
7798 | "reference": "05201f91d4f03c58f7324d019bdd791c8e8e418b" | 7799 | "reference": "e1924aea9c70ae3e69fff05afa3cb8ce541bf3bb" |
7799 | }, | 7800 | }, |
7800 | "dist": { | 7801 | "dist": { |
7801 | "type": "zip", | 7802 | "type": "zip", |
7802 | "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/05201f91d4f03c58f7324d019bdd791c8e8e418b", | 7803 | "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/e1924aea9c70ae3e69fff05afa3cb8ce541bf3bb", |
7803 | "reference": "05201f91d4f03c58f7324d019bdd791c8e8e418b", | 7804 | "reference": "e1924aea9c70ae3e69fff05afa3cb8ce541bf3bb", |
7804 | "shasum": "" | 7805 | "shasum": "" |
7805 | }, | 7806 | }, |
7806 | "require": { | 7807 | "require": { |
@@ -7844,7 +7845,7 @@ | |||
7844 | "interoperability", | 7845 | "interoperability", |
7845 | "standards" | 7846 | "standards" |
7846 | ], | 7847 | ], |
7847 | "time": "2019-06-05T13:28:50+00:00" | 7848 | "time": "2019-06-17T17:43:54+00:00" |
7848 | }, | 7849 | }, |
7849 | { | 7850 | { |
7850 | "name": "symfony/mime", | 7851 | "name": "symfony/mime", |
@@ -8069,7 +8070,7 @@ | |||
8069 | }, | 8070 | }, |
8070 | { | 8071 | { |
8071 | "name": "Gert de Pagter", | 8072 | "name": "Gert de Pagter", |
8072 | "email": "BackEndTea@gmail.com" | 8073 | "email": "backendtea@gmail.com" |
8073 | } | 8074 | } |
8074 | ], | 8075 | ], |
8075 | "description": "Symfony polyfill for ctype functions", | 8076 | "description": "Symfony polyfill for ctype functions", |
@@ -8602,16 +8603,16 @@ | |||
8602 | }, | 8603 | }, |
8603 | { | 8604 | { |
8604 | "name": "symfony/swiftmailer-bundle", | 8605 | "name": "symfony/swiftmailer-bundle", |
8605 | "version": "v3.2.6", | 8606 | "version": "v3.2.8", |
8606 | "source": { | 8607 | "source": { |
8607 | "type": "git", | 8608 | "type": "git", |
8608 | "url": "https://github.com/symfony/swiftmailer-bundle.git", | 8609 | "url": "https://github.com/symfony/swiftmailer-bundle.git", |
8609 | "reference": "7a83160b50a2479d37eb74ba71577380b9afe4f5" | 8610 | "reference": "cb125b3648f132fb8070b55393f20cb310907d3b" |
8610 | }, | 8611 | }, |
8611 | "dist": { | 8612 | "dist": { |
8612 | "type": "zip", | 8613 | "type": "zip", |
8613 | "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/7a83160b50a2479d37eb74ba71577380b9afe4f5", | 8614 | "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/cb125b3648f132fb8070b55393f20cb310907d3b", |
8614 | "reference": "7a83160b50a2479d37eb74ba71577380b9afe4f5", | 8615 | "reference": "cb125b3648f132fb8070b55393f20cb310907d3b", |
8615 | "shasum": "" | 8616 | "shasum": "" |
8616 | }, | 8617 | }, |
8617 | "require": { | 8618 | "require": { |
@@ -8621,6 +8622,9 @@ | |||
8621 | "symfony/dependency-injection": "~2.7|~3.3|~4.0", | 8622 | "symfony/dependency-injection": "~2.7|~3.3|~4.0", |
8622 | "symfony/http-kernel": "~2.7|~3.3|~4.0" | 8623 | "symfony/http-kernel": "~2.7|~3.3|~4.0" |
8623 | }, | 8624 | }, |
8625 | "conflict": { | ||
8626 | "twig/twig": "<1.41|<2.10" | ||
8627 | }, | ||
8624 | "require-dev": { | 8628 | "require-dev": { |
8625 | "symfony/console": "~2.7|~3.3|~4.0", | 8629 | "symfony/console": "~2.7|~3.3|~4.0", |
8626 | "symfony/framework-bundle": "~2.7|~3.3|~4.0", | 8630 | "symfony/framework-bundle": "~2.7|~3.3|~4.0", |
@@ -8660,7 +8664,7 @@ | |||
8660 | ], | 8664 | ], |
8661 | "description": "Symfony SwiftmailerBundle", | 8665 | "description": "Symfony SwiftmailerBundle", |
8662 | "homepage": "http://symfony.com", | 8666 | "homepage": "http://symfony.com", |
8663 | "time": "2019-04-18T15:52:54+00:00" | 8667 | "time": "2019-06-18T15:27:04+00:00" |
8664 | }, | 8668 | }, |
8665 | { | 8669 | { |
8666 | "name": "symfony/symfony", | 8670 | "name": "symfony/symfony", |
@@ -8920,21 +8924,22 @@ | |||
8920 | }, | 8924 | }, |
8921 | { | 8925 | { |
8922 | "name": "twig/twig", | 8926 | "name": "twig/twig", |
8923 | "version": "v1.42.2", | 8927 | "version": "v2.11.3", |
8924 | "source": { | 8928 | "source": { |
8925 | "type": "git", | 8929 | "type": "git", |
8926 | "url": "https://github.com/twigphp/Twig.git", | 8930 | "url": "https://github.com/twigphp/Twig.git", |
8927 | "reference": "21707d6ebd05476854805e4f91b836531941bcd4" | 8931 | "reference": "699ed2342557c88789a15402de5eb834dedd6792" |
8928 | }, | 8932 | }, |
8929 | "dist": { | 8933 | "dist": { |
8930 | "type": "zip", | 8934 | "type": "zip", |
8931 | "url": "https://api.github.com/repos/twigphp/Twig/zipball/21707d6ebd05476854805e4f91b836531941bcd4", | 8935 | "url": "https://api.github.com/repos/twigphp/Twig/zipball/699ed2342557c88789a15402de5eb834dedd6792", |
8932 | "reference": "21707d6ebd05476854805e4f91b836531941bcd4", | 8936 | "reference": "699ed2342557c88789a15402de5eb834dedd6792", |
8933 | "shasum": "" | 8937 | "shasum": "" |
8934 | }, | 8938 | }, |
8935 | "require": { | 8939 | "require": { |
8936 | "php": ">=5.4.0", | 8940 | "php": "^7.0", |
8937 | "symfony/polyfill-ctype": "^1.8" | 8941 | "symfony/polyfill-ctype": "^1.8", |
8942 | "symfony/polyfill-mbstring": "^1.3" | ||
8938 | }, | 8943 | }, |
8939 | "require-dev": { | 8944 | "require-dev": { |
8940 | "psr/container": "^1.0", | 8945 | "psr/container": "^1.0", |
@@ -8944,7 +8949,7 @@ | |||
8944 | "type": "library", | 8949 | "type": "library", |
8945 | "extra": { | 8950 | "extra": { |
8946 | "branch-alias": { | 8951 | "branch-alias": { |
8947 | "dev-master": "1.42-dev" | 8952 | "dev-master": "2.11-dev" |
8948 | } | 8953 | } |
8949 | }, | 8954 | }, |
8950 | "autoload": { | 8955 | "autoload": { |
@@ -8982,7 +8987,7 @@ | |||
8982 | "keywords": [ | 8987 | "keywords": [ |
8983 | "templating" | 8988 | "templating" |
8984 | ], | 8989 | ], |
8985 | "time": "2019-06-18T15:35:16+00:00" | 8990 | "time": "2019-06-18T15:37:11+00:00" |
8986 | }, | 8991 | }, |
8987 | { | 8992 | { |
8988 | "name": "wallabag/php-mobi", | 8993 | "name": "wallabag/php-mobi", |
@@ -10654,16 +10659,16 @@ | |||
10654 | }, | 10659 | }, |
10655 | { | 10660 | { |
10656 | "name": "phpstan/phpdoc-parser", | 10661 | "name": "phpstan/phpdoc-parser", |
10657 | "version": "0.3.4", | 10662 | "version": "0.3.5", |
10658 | "source": { | 10663 | "source": { |
10659 | "type": "git", | 10664 | "type": "git", |
10660 | "url": "https://github.com/phpstan/phpdoc-parser.git", | 10665 | "url": "https://github.com/phpstan/phpdoc-parser.git", |
10661 | "reference": "ab518a5fc8f1d90f58bd2c5552ba915e2c477b66" | 10666 | "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" |
10662 | }, | 10667 | }, |
10663 | "dist": { | 10668 | "dist": { |
10664 | "type": "zip", | 10669 | "type": "zip", |
10665 | "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ab518a5fc8f1d90f58bd2c5552ba915e2c477b66", | 10670 | "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", |
10666 | "reference": "ab518a5fc8f1d90f58bd2c5552ba915e2c477b66", | 10671 | "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", |
10667 | "shasum": "" | 10672 | "shasum": "" |
10668 | }, | 10673 | }, |
10669 | "require": { | 10674 | "require": { |
@@ -10697,7 +10702,7 @@ | |||
10697 | "MIT" | 10702 | "MIT" |
10698 | ], | 10703 | ], |
10699 | "description": "PHPDoc parser with support for nullable, intersection and generic types", | 10704 | "description": "PHPDoc parser with support for nullable, intersection and generic types", |
10700 | "time": "2019-05-28T11:40:00+00:00" | 10705 | "time": "2019-06-07T19:13:52+00:00" |
10701 | }, | 10706 | }, |
10702 | { | 10707 | { |
10703 | "name": "phpstan/phpstan", | 10708 | "name": "phpstan/phpstan", |
diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php index 8d422a90..9f671735 100644 --- a/src/Wallabag/CoreBundle/Controller/FeedController.php +++ b/src/Wallabag/CoreBundle/Controller/FeedController.php | |||
@@ -176,7 +176,7 @@ class FeedController extends Controller | |||
176 | $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); | 176 | $pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false); |
177 | $entries = new Pagerfanta($pagerAdapter); | 177 | $entries = new Pagerfanta($pagerAdapter); |
178 | 178 | ||
179 | $perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.Feed_limit'); | 179 | $perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.feed_limit'); |
180 | $entries->setMaxPerPage($perPage); | 180 | $entries->setMaxPerPage($perPage); |
181 | 181 | ||
182 | $url = $this->generateUrl( | 182 | $url = $this->generateUrl( |
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 536185d4..02f17f50 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php | |||
@@ -4,10 +4,14 @@ namespace Wallabag\CoreBundle\Twig; | |||
4 | 4 | ||
5 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; | 5 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
6 | use Symfony\Component\Translation\TranslatorInterface; | 6 | use Symfony\Component\Translation\TranslatorInterface; |
7 | use Twig\Extension\AbstractExtension; | ||
8 | use Twig\Extension\GlobalsInterface; | ||
9 | use Twig\TwigFilter; | ||
10 | use Twig\TwigFunction; | ||
7 | use Wallabag\CoreBundle\Repository\EntryRepository; | 11 | use Wallabag\CoreBundle\Repository\EntryRepository; |
8 | use Wallabag\CoreBundle\Repository\TagRepository; | 12 | use Wallabag\CoreBundle\Repository\TagRepository; |
9 | 13 | ||
10 | class WallabagExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface | 14 | class WallabagExtension extends AbstractExtension implements GlobalsInterface |
11 | { | 15 | { |
12 | private $tokenStorage; | 16 | private $tokenStorage; |
13 | private $entryRepository; | 17 | private $entryRepository; |
@@ -24,21 +28,26 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
24 | $this->translator = $translator; | 28 | $this->translator = $translator; |
25 | } | 29 | } |
26 | 30 | ||
31 | public function getGlobals() | ||
32 | { | ||
33 | return []; | ||
34 | } | ||
35 | |||
27 | public function getFilters() | 36 | public function getFilters() |
28 | { | 37 | { |
29 | return [ | 38 | return [ |
30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), | 39 | new TwigFilter('removeWww', [$this, 'removeWww']), |
31 | new \Twig_SimpleFilter('removeScheme', [$this, 'removeScheme']), | 40 | new TwigFilter('removeScheme', [$this, 'removeScheme']), |
32 | new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), | 41 | new TwigFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), |
33 | ]; | 42 | ]; |
34 | } | 43 | } |
35 | 44 | ||
36 | public function getFunctions() | 45 | public function getFunctions() |
37 | { | 46 | { |
38 | return [ | 47 | return [ |
39 | new \Twig_SimpleFunction('count_entries', [$this, 'countEntries']), | 48 | new TwigFunction('count_entries', [$this, 'countEntries']), |
40 | new \Twig_SimpleFunction('count_tags', [$this, 'countTags']), | 49 | new TwigFunction('count_tags', [$this, 'countTags']), |
41 | new \Twig_SimpleFunction('display_stats', [$this, 'displayStats']), | 50 | new TwigFunction('display_stats', [$this, 'displayStats']), |
42 | ]; | 51 | ]; |
43 | } | 52 | } |
44 | 53 | ||
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php index 2797efde..b25ba685 100644 --- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php +++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php | |||
@@ -4,6 +4,7 @@ namespace Wallabag\UserBundle\Mailer; | |||
4 | 4 | ||
5 | use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; | 5 | use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; |
6 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; | 6 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; |
7 | use Twig\Environment; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * Custom mailer for TwoFactorBundle email. | 10 | * Custom mailer for TwoFactorBundle email. |
@@ -21,7 +22,7 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
21 | /** | 22 | /** |
22 | * Twig to render the html's email. | 23 | * Twig to render the html's email. |
23 | * | 24 | * |
24 | * @var \Twig_Environment | 25 | * @var Environment |
25 | */ | 26 | */ |
26 | private $twig; | 27 | private $twig; |
27 | 28 | ||
@@ -56,14 +57,14 @@ class AuthCodeMailer implements AuthCodeMailerInterface | |||
56 | /** | 57 | /** |
57 | * Initialize the auth code mailer with the SwiftMailer object. | 58 | * Initialize the auth code mailer with the SwiftMailer object. |
58 | * | 59 | * |
59 | * @param \Swift_Mailer $mailer | 60 | * @param \Swift_Mailer $mailer |
60 | * @param \Twig_Environment $twig | 61 | * @param Environment $twig |
61 | * @param string $senderEmail | 62 | * @param string $senderEmail |
62 | * @param string $senderName | 63 | * @param string $senderName |
63 | * @param string $supportUrl wallabag support url | 64 | * @param string $supportUrl wallabag support url |
64 | * @param string $wallabagUrl wallabag instance url | 65 | * @param string $wallabagUrl wallabag instance url |
65 | */ | 66 | */ |
66 | public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) | 67 | public function __construct(\Swift_Mailer $mailer, Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) |
67 | { | 68 | { |
68 | $this->mailer = $mailer; | 69 | $this->mailer = $mailer; |
69 | $this->twig = $twig; | 70 | $this->twig = $twig; |
diff --git a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php index 1713c10c..4f93a92c 100644 --- a/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php +++ b/tests/Wallabag/UserBundle/Mailer/AuthCodeMailerTest.php | |||
@@ -3,6 +3,8 @@ | |||
3 | namespace Tests\Wallabag\UserBundle\Mailer; | 3 | namespace Tests\Wallabag\UserBundle\Mailer; |
4 | 4 | ||
5 | use PHPUnit\Framework\TestCase; | 5 | use PHPUnit\Framework\TestCase; |
6 | use Twig\Environment; | ||
7 | use Twig\Loader\ArrayLoader; | ||
6 | use Wallabag\UserBundle\Entity\User; | 8 | use Wallabag\UserBundle\Entity\User; |
7 | use Wallabag\UserBundle\Mailer\AuthCodeMailer; | 9 | use Wallabag\UserBundle\Mailer\AuthCodeMailer; |
8 | 10 | ||
@@ -27,7 +29,7 @@ class AuthCodeMailerTest extends TestCase | |||
27 | {% block body_text %}text body {{ support_url }}{% endblock %} | 29 | {% block body_text %}text body {{ support_url }}{% endblock %} |
28 | TWIG; | 30 | TWIG; |
29 | 31 | ||
30 | $this->twig = new \Twig_Environment(new \Twig_Loader_Array(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate])); | 32 | $this->twig = new Environment(new ArrayLoader(['WallabagUserBundle:TwoFactor:email_auth_code.html.twig' => $twigTemplate])); |
31 | } | 33 | } |
32 | 34 | ||
33 | public function testSendEmail() | 35 | public function testSendEmail() |