Compare commits

..

51 Commits
2.0.1 ... 2.0.3

Author SHA1 Message Date
08dea0edb1 Change travis configuration 2016-04-22 18:54:43 +02:00
79c44cb4f8 Release wallabag 2.0.3 2016-04-22 18:45:46 +02:00
9c0bc04cfe Merge pull request #1965 from wallabag/prepare-203
Prepare release 2.0.3
2016-04-22 18:40:48 +02:00
dafde7fb2f Prepare release 2.0.3 2016-04-22 18:08:16 +02:00
9481187896 Merge pull request #1962 from wallabag/update-api-documentation
Update API documentation with cURL examples
2016-04-22 08:38:04 +02:00
1c90663b79 Update API documentation with cURL examples 2016-04-21 18:48:17 +02:00
7d5b4631d0 Merge pull request #1948 from wallabag/prepare-202
Prepare release 2.0.2
2016-04-21 09:44:44 +02:00
9f151b469f Update changelog 2016-04-21 08:42:41 +02:00
45919a295e Merge pull request #1957 from wallabag/fix-gotoaccount-button-translation
Fix translation for Go to your account button after subscription
2016-04-21 08:37:36 +02:00
2499cdbf29 Fix translation for Go to your account button after subscription
Fix #1956
2016-04-20 15:53:20 +02:00
868e76af10 Merge pull request #1945 from ddeimeke/master
Added some curl examples
2016-04-20 10:10:46 +02:00
f88530de68 Merge pull request #1954 from wallabag/update-links-doc
Update links in documentation
2016-04-19 20:25:36 +02:00
4a25bef077 Update links in documentation 2016-04-19 20:03:34 +02:00
24f65a838c Merge pull request #1953 from maxi62330/master
Actualisation des liens morts (Documentation de traduction)
2016-04-19 19:54:44 +02:00
89bafa95ed Actualisation des liens morts (Documentation de traduction) 2016-04-19 19:25:04 +02:00
18bb5a90d5 Prepare release 2.0.2 2016-04-19 10:01:29 +02:00
938a16c0f6 Added some curl examples 2016-04-19 08:00:07 +02:00
ca8d61b958 Merge pull request #1942 from wallabag/optimize-import
Optimize import
2016-04-18 22:13:48 +02:00
23feba63bb Merge pull request #1944 from wallabag/travis-rename-branches
Update Travis configuration with branches renaming
2016-04-18 22:12:52 +02:00
3320d39418 Update Travis configuration with branches renaming 2016-04-18 21:46:36 +02:00
23d24b1750 Add tests 2016-04-18 15:29:57 +02:00
dc12084d93 Add doctrine clear after flush, thanks to @BitOne talk at Symfony Live 2016-04-18 14:48:18 +02:00
0907a72c64 Merge pull request #1938 from wallabag/hide-pagination
Display pagination only if we have more than one page
2016-04-18 09:41:56 +02:00
188b74b6df Display pagination only if we have more than one page 2016-04-18 09:03:21 +02:00
71601c171f Merge pull request #1935 from jami7/patch-8
Update messages.es.yml
2016-04-17 08:03:36 +02:00
5c2c1a6434 Update messages.es.yml 2016-04-16 14:04:39 -10:00
7fdecbb73c Merge pull request #1933 from wallabag/hide-pagination
Hide pagination if we only have one entry to display
2016-04-16 08:36:24 +02:00
1f034a3316 Hide pagination if we only have one entry to display 2016-04-16 07:19:30 +02:00
d1f4996b77 Merge pull request #1925 from wallabag/fix-redirect-without-referer
Redirect to homepage if referer is null
2016-04-15 17:52:33 +02:00
5180302650 Merge pull request #1929 from wallabag/change-guid-rss
Change guid and link in RSS feeds to give original entry URL
2016-04-15 17:51:56 +02:00
2d899e8d30 Change guid and link in RSS feeds to give original entry URL
Fix #1926
2016-04-15 16:07:34 +02:00
345d74268b Fix redirect when delete entry 2016-04-15 15:39:00 +02:00
4086e0782e Fix tests 2016-04-15 09:58:29 +02:00
af497a641c Redirect to homepage if referer is null
Fix #1924
2016-04-15 07:58:01 +02:00
f2e5fdc366 Merge pull request #1916 from wallabag/cleanup
Convert array + phpDoc
2016-04-13 09:43:14 +02:00
a417b86923 Merge pull request #1918 from wallabag/improve-pagination
Improve pagination when user has lot of entries
2016-04-13 09:42:18 +02:00
18078ded12 Fix indentation 2016-04-13 09:20:01 +02:00
245e2e2cae Merge pull request #1919 from wallabag/cleanup-composerjson
Remove useless dependancy
2016-04-12 22:20:05 +02:00
86732aa01c Move test parameters out of parameters.yml
The end user doesn't care to about the test database.
2016-04-12 22:14:22 +02:00
c31ea8a409 Remove useless dependancy 2016-04-12 21:47:16 +02:00
c95e39c51a Lost in translation pager 2016-04-12 20:38:56 +02:00
63995be5ee Fix display for Next/Previous link when they are disabled 2016-04-12 18:03:40 +02:00
1880da7420 Restore old behavior for OutOfRangeCurrentPageException 2016-04-12 16:40:18 +02:00
76cd8dbb05 Fix tests 2016-04-12 16:32:01 +02:00
624a7c6df1 Improve pagination when user has lot of entries
Fix #1905
* Usage of whiteoctober/WhiteOctoberPagerfantaBundle
2016-04-12 16:04:17 +02:00
80bd17f00d Merge pull request #1911 from wallabag/title-on-title-entry
add title hover on entry titles
2016-04-12 14:54:59 +02:00
1b8b3859c0 Add title hover on entry titles 2016-04-12 14:30:42 +02:00
443cff9840 Fix MySQL tests on HHVM 2016-04-12 12:37:10 +02:00
4094ea4771 Convert array + phpDoc
Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter
2016-04-12 12:25:29 +02:00
7eccbda99f Merge pull request #1915 from wallabag/doc-links
Fix doc links
2016-04-12 11:24:11 +02:00
8846ad0a90 Fix doc links 2016-04-12 10:51:46 +02:00
109 changed files with 1326 additions and 868 deletions

View File

@ -41,8 +41,7 @@ matrix:
# exclude v1 branches
branches:
except:
- master
- dev
- legacy
before_script:
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;

View File

@ -2,6 +2,38 @@
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
## [2.0.3] - 2016-04-22
### Added
- [#1962](https://github.com/wallabag/wallabag/pull/1962) cURL examples in documentation about API (Dirk Deimeke)
### Fixed
- Forgot `composer.lock` file in 2.0.2 release so some users may encounter `Fatal error: Out of memory` error during installation
## [2.0.2] - 2016-04-21
### Added
- [#1945](https://github.com/wallabag/wallabag/pull/1945) cURL examples in documentation about API (Dirk Deimeke)
- [#1911](https://github.com/wallabag/wallabag/pull/1911) Add title hover on entry titles (Thomas Citharel)
### Changed
- [#1944](https://github.com/wallabag/wallabag/pull/1944), [#1953](https://github.com/wallabag/wallabag/pull/1953), [#1954](https://github.com/wallabag/wallabag/pull/1954) Due to branches renaming, update documentation and configuration (maxi62330, Nicolas Lœuillet)
- [#1942](https://github.com/wallabag/wallabag/pull/1942) Optimize import (Nicolas Lœuillet)
- [#1935](https://github.com/wallabag/wallabag/pull/1935) Update spanish translation (jami7)
- [#1929](https://github.com/wallabag/wallabag/pull/1929) Change guid and link in RSS feeds to give original entry URL (Nicolas Lœuillet)
- [#1918](https://github.com/wallabag/wallabag/pull/1918) Improve pagination when user has lot of entries (Nicolas Lœuillet)
- [#1916](https://github.com/wallabag/wallabag/pull/1916) Change PHP arrays and move test parameters in a separated file (Jeremy Benoist)
### Fixed
- [#1957](https://github.com/wallabag/wallabag/pull/1957) Fix translation for `Go to your account` button (Nicolas Lœuillet)
- [#1925](https://github.com/wallabag/wallabag/pull/1925) Redirect to homepage if refered is null (Nicolas Lœuillet)
- [#1912](https://github.com/wallabag/wallabag/pull/1912) Fix 500 Internal Server Error -> "Setting piwik_enabled couldn't be found" (Jeremy Benoist)
## [2.0.1] - 2016-04-11
### Added

View File

@ -16,7 +16,7 @@ Then you can install wallabag by executing the following commands:
```
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.0.1
git checkout 2.0.3
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
php bin/console server:run --env=prod

View File

@ -22,19 +22,22 @@ class AppKernel extends Kernel
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
new Liip\ThemeBundle\LiipThemeBundle(),
new Wallabag\CoreBundle\WallabagCoreBundle(),
new Wallabag\ApiBundle\WallabagApiBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Craue\ConfigBundle\CraueConfigBundle(),
new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(),
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
// wallabag bundles
new Wallabag\CoreBundle\WallabagCoreBundle(),
new Wallabag\ApiBundle\WallabagApiBundle(),
new Wallabag\UserBundle\WallabagUserBundle(),
new Wallabag\ImportBundle\WallabagImportBundle(),
new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
];

View File

@ -1,2 +1,2 @@
set :branch, 'v2'
set :branch, 'master'
set :deploy_to, '/var/www/v2.wallabag.org/web/'

View File

@ -28,7 +28,7 @@ framework:
assets: ~
wallabag_core:
version: 2.0.1
version: 2.0.3
paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
languages:
en: 'English'

View File

@ -1,5 +1,6 @@
imports:
- { resource: config_dev.yml }
- { resource: parameters_test.yml }
framework:
test: ~

View File

@ -19,14 +19,6 @@ parameters:
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: 127.0.0.1
test_database_port: ~
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~

View File

@ -0,0 +1,8 @@
parameters:
test_database_driver: pdo_sqlite
test_database_host: 127.0.0.1
test_database_port: null
test_database_name: null
test_database_user: null
test_database_password: null
test_database_path: '%kernel.root_dir%/../data/db/wallabag_testYO.sqlite'

View File

@ -6,7 +6,7 @@ services:
filesystem_cache:
class: Doctrine\Common\Cache\FilesystemCache
arguments:
- %kernel.cache_dir%/doctrine/metadata
- "%kernel.cache_dir%/doctrine/metadata"
twig.extension.text:
class: Twig_Extensions_Extension_Text

View File

@ -1,37 +0,0 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag_test
test_database_user: root
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_confirmation: true
from_email: no-reply@wallabag.org

View File

@ -1,37 +0,0 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_pgsql
test_database_host: localhost
test_database_port:
test_database_name: wallabag_test
test_database_user: travis
test_database_password: ~
test_database_path: ~
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_confirmation: true
from_email: no-reply@wallabag.org

View File

@ -1,37 +0,0 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_confirmation: true
from_email: no-reply@wallabag.org

View File

@ -0,0 +1,8 @@
parameters:
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_port: 3306
test_database_name: wallabag_test
test_database_user: root
test_database_password: ~
test_database_path: ~

View File

@ -0,0 +1,8 @@
parameters:
test_database_driver: pdo_pgsql
test_database_host: localhost
test_database_port:
test_database_name: wallabag_test
test_database_user: travis
test_database_password: ~
test_database_path: ~

View File

@ -0,0 +1,8 @@
parameters:
test_database_driver: pdo_sqlite
test_database_host: localhost
test_database_port:
test_database_name: ~
test_database_user: ~
test_database_password: ~
test_database_path: "%kernel.root_dir%/../data/db/wallabag_testHU.sqlite"

View File

@ -42,8 +42,8 @@
<target name="db_mysql" description="Run test for MySQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.mysql"/>
<arg value="${basedir}/app/config/parameters.yml"/>
<arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
<arg value="${basedir}/app/config/parameters_test.yml"/>
</exec>
<exec executable="php">
@ -56,8 +56,8 @@
<target name="db_sqlite" description="Run test for SQLite">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.sqlite"/>
<arg value="${basedir}/app/config/parameters.yml"/>
<arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
<arg value="${basedir}/app/config/parameters_test.yml"/>
</exec>
<exec executable="php">
@ -70,8 +70,8 @@
<target name="db_pgsql" description="Run test for PostgreSQL">
<delete dir="${basedir}/app/config/parameters.yml"/>
<exec executable="cp">
<arg value="${basedir}/app/config/tests/parameters.yml.dist.pgsql"/>
<arg value="${basedir}/app/config/parameters.yml"/>
<arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
<arg value="${basedir}/app/config/parameters_test.yml"/>
</exec>
<exec executable="php">

View File

@ -58,7 +58,6 @@
"friendsofsymfony/rest-bundle": "~1.4",
"jms/serializer-bundle": "~1.0",
"nelmio/api-doc-bundle": "~2.7",
"ezyang/htmlpurifier": "~4.6",
"mgargano/simplehtmldom": "~1.5",
"tecnickcom/tcpdf": "~6.2",
"simplepie/simplepie": "~1.3.1",
@ -81,7 +80,8 @@
"craue/config-bundle": "~1.4",
"mnapoli/piwik-twig-extension": "^1.0",
"lexik/maintenance-bundle": "~2.1",
"ocramius/proxy-manager": "1.*"
"ocramius/proxy-manager": "1.*",
"white-october/pagerfanta-bundle": "^1.0"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "~2.2",

136
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "ba30b73585f433f82b458cbc382ad137",
"content-hash": "241710c2b913269e8e7dff9edb379cef",
"hash": "13098bd7c43a673e99a14d6ed8148962",
"content-hash": "ed86235df64938684b50427919c0aea7",
"packages": [
{
"name": "behat/transliterator",
@ -1004,50 +1004,6 @@
],
"time": "2016-01-05 21:34:58"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.7.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "ae1828d955112356f7677c465f94f7deb7d27a40"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/ae1828d955112356f7677c465f94f7deb7d27a40",
"reference": "ae1828d955112356f7677c465f94f7deb7d27a40",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2015-08-05 01:03:42"
},
{
"name": "friendsofsymfony/oauth-server-bundle",
"version": "1.5.2",
@ -1122,16 +1078,16 @@
},
{
"name": "friendsofsymfony/oauth2-php",
"version": "1.2.0",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfSymfony/oauth2-php.git",
"reference": "4ae0a2aa85566146ef6f0f7169854c49e0c9243a"
"reference": "fa2aecb1fca2a03fd5f9aca19fe9adb9dfff928c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfSymfony/oauth2-php/zipball/4ae0a2aa85566146ef6f0f7169854c49e0c9243a",
"reference": "4ae0a2aa85566146ef6f0f7169854c49e0c9243a",
"url": "https://api.github.com/repos/FriendsOfSymfony/oauth2-php/zipball/fa2aecb1fca2a03fd5f9aca19fe9adb9dfff928c",
"reference": "fa2aecb1fca2a03fd5f9aca19fe9adb9dfff928c",
"shasum": ""
},
"require": {
@ -1144,7 +1100,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "1.2.x-dev"
}
},
"autoload": {
@ -1172,7 +1128,7 @@
"oauth",
"oauth2"
],
"time": "2015-12-21 11:32:17"
"time": "2016-03-31 14:24:17"
},
{
"name": "friendsofsymfony/rest-bundle",
@ -3737,16 +3693,16 @@
},
{
"name": "monolog/monolog",
"version": "1.18.2",
"version": "1.19.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "064b38c16790249488e7a8b987acf1c9d7383c09"
"reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/064b38c16790249488e7a8b987acf1c9d7383c09",
"reference": "064b38c16790249488e7a8b987acf1c9d7383c09",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf",
"reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf",
"shasum": ""
},
"require": {
@ -3811,7 +3767,7 @@
"logging",
"psr-3"
],
"time": "2016-04-02 13:12:58"
"time": "2016-04-12 18:29:35"
},
{
"name": "neitanod/forceutf8",
@ -4952,20 +4908,20 @@
},
{
"name": "symfony/monolog-bundle",
"version": "v2.10.0",
"version": "2.11.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/monolog-bundle.git",
"reference": "82fd8f36e2cccbe94faf237403c48052d4d4b77e"
"reference": "e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/82fd8f36e2cccbe94faf237403c48052d4d4b77e",
"reference": "82fd8f36e2cccbe94faf237403c48052d4d4b77e",
"url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00",
"reference": "e7caf4936c7be82bc6d68df87f1d23a0d5bf6e00",
"shasum": ""
},
"require": {
"monolog/monolog": "~1.12",
"monolog/monolog": "~1.18",
"php": ">=5.3.2",
"symfony/config": "~2.3|~3.0",
"symfony/dependency-injection": "~2.3|~3.0",
@ -4980,7 +4936,7 @@
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.9.x-dev"
"dev-master": "2.x-dev"
}
},
"autoload": {
@ -5008,7 +4964,7 @@
"log",
"logging"
],
"time": "2016-03-13 15:55:56"
"time": "2016-04-13 16:21:01"
},
{
"name": "symfony/polyfill-intl-icu",
@ -5699,6 +5655,58 @@
"homepage": "https://github.com/wallabag/phpMobi",
"time": "2015-10-16 08:42:42"
},
{
"name": "white-october/pagerfanta-bundle",
"version": "v1.0.6",
"source": {
"type": "git",
"url": "https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git",
"reference": "ada62843d9ba0d3aa61d0dcc7becdb25a2e2f545"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/whiteoctober/WhiteOctoberPagerfantaBundle/zipball/ada62843d9ba0d3aa61d0dcc7becdb25a2e2f545",
"reference": "ada62843d9ba0d3aa61d0dcc7becdb25a2e2f545",
"shasum": ""
},
"require": {
"pagerfanta/pagerfanta": "1.0.*",
"symfony/framework-bundle": "~2.3|~3.0",
"symfony/property-access": "~2.3|~3.0",
"symfony/twig-bundle": "~2.3|~3.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7",
"symfony/symfony": "~2.3|~3.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"WhiteOctober\\PagerfantaBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Pablo Díez",
"email": "pablodip@gmail.com"
}
],
"description": "Bundle to use Pagerfanta with Symfony2",
"keywords": [
"page",
"paging"
],
"time": "2016-03-16 19:24:56"
},
{
"name": "willdurand/hateoas",
"version": "2.9.1",

View File

@ -69,6 +69,12 @@ You'll have this in return:
We'll work with the ``access_token`` value in our next calls.
cURL example:
::
curl -s "https://localhost:8000/oauth/v2/token?grant_type=password&client_id=1_3o53gl30vhgk0c8ks4cocww08o84448osgo40wgw4gwkoo8skc&client_secret=636ocbqo978ckw0gsw4gcwwocg8044sco0w8w84cws48ggogs4&username=wallabag&password=wallabag"
Getting existing entries
------------------------
@ -120,6 +126,12 @@ returns:
The ``items`` array is empty.
cURL example:
::
curl --get "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Adding your first entry
-----------------------
@ -174,6 +186,12 @@ returns
Now, if you execute the previous command (see **Get existing entries**), you'll have data.
cURL example:
::
curl "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA&url=http://www.numerama.com/tech/160115-le-pocket-libre-wallabag-fait-le-plein-de-fonctionnalites.html"
Deleting an entry
-----------------
@ -227,6 +245,12 @@ returns
And if you want to list the existing entries (see **Get existing entries**), the array is empty.
cURL example:
::
curl --request DELETE "https://localhost:8000/api/entries/1.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Other methods
-------------

View File

@ -12,15 +12,15 @@ Translation files
As wallabag is mainly developed by a French team, please consider that french
translation is the most updated one and please copy it to create your own translation.
You can find translation files here: https://github.com/wallabag/wallabag/tree/v2/src/Wallabag/CoreBundle/Resources/translations.
You can find translation files here: https://github.com/wallabag/wallabag/tree/master/src/Wallabag/CoreBundle/Resources/translations.
You have to create ``messages.CODE.yml``, where CODE
is the ISO 639-1 code of your language (`see wikipedia <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>`__).
Other files to translate:
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/CraueConfigBundle/translations.
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/FOSUserBundle/translations.
- https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations.
You have to create ``THE_TRANSLATION_FILE.CODE.yml`` files.
@ -28,7 +28,7 @@ Configuration file
~~~~~~~~~~~~~~~~~~
You have to edit `app/config/config.yml
<https://github.com/wallabag/wallabag/blob/v2/app/config/config.yml>`__ to display
<https://github.com/wallabag/wallabag/blob/master/app/config/config.yml>`__ to display
your language on Configuration page of wallabag (to allow users to switch to this new translation).
Under the ``wallabag_core.languages`` section, you have to add a new line with
@ -55,6 +55,6 @@ wallabag documentation
Contrary to the web application, the main language for documentation is english.
Documentation files are stored here: https://github.com/wallabag/wallabag/tree/v2/docs
Documentation files are stored here: https://github.com/wallabag/wallabag/tree/master/docs
You need to respect the ``en`` folder structure when you create your own translation.

View File

@ -12,9 +12,9 @@ There may be several reasons:
How can I help to fix that?
---------------------------
- `by sending us an email with the article's URL <mailto:hello@wallabag.org>`_
- `by sending us an email with the article's URL <mailto:hello\@wallabag.org>`_
- by trying to fix this article by yourself :) by creating a file for the article.
You can use this tool http://siteconfig.fivefilters.org/.
You can use `this tool <http://siteconfig.fivefilters.org/>`__.
How can I try to re-fetch this article?
---------------------------------------

View File

@ -42,7 +42,7 @@ Install Composer:
curl -s http://getcomposer.org/installer | php
You can find specific instructions here : __ https://getcomposer.org/doc/00-intro.md
You can find specific instructions `here <https://getcomposer.org/doc/00-intro.md>`__:
To install wallabag itself, you must run these two commands:
@ -50,7 +50,7 @@ To install wallabag itself, you must run these two commands:
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.0.1
git checkout 2.0.3
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
@ -64,8 +64,7 @@ And access wallabag at http://yourserverip:8000
.. note::
To define parameters with environment variables, you have to set these variables with ``SYMFONY__`` prefix. For example, ``SYMFONY__DATABASE_DRIVER``. You can have a look to the `Symfony documentation
<http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__.
To define parameters with environment variables, you have to set these variables with ``SYMFONY__`` prefix. For example, ``SYMFONY__DATABASE_DRIVER``. You can have a look to the `Symfony documentation <http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__.
Installing on Apache
--------------------

View File

@ -7,7 +7,7 @@ Pré-requis
----------
* wallabag fraichement installé et disponible à http://localhost:8000
* ``httpie`` installé sur votre ordinateur (`voir le site du projet <https://github.com/jkbrzt/httpie>`__). Vous pouvez également adapter les commandes en utilisant curl ou wget.
* ``httpie`` installé sur votre ordinateur (`voir le site du projet <https://github.com/jkbrzt/httpie>`__). Vous pouvez également adapter les commandes en utilisant curl ou wget.
* toutes les méthodes de l'API documentées ici http://localhost:8000/api/doc
Créer un nouveau client d'API
@ -69,6 +69,12 @@ Vous obtiendrez :
Nous allons utiliser la valeur de ``access_token`` dans nos prochains appels.
Exemple cURL :
::
curl -s "https://localhost:8000/oauth/v2/token?grant_type=password&client_id=1_3o53gl30vhgk0c8ks4cocww08o84448osgo40wgw4gwkoo8skc&client_secret=636ocbqo978ckw0gsw4gcwwocg8044sco0w8w84cws48ggogs4&username=wallabag&password=wallabag"
Récupérer les articles existants
--------------------------------
@ -120,6 +126,12 @@ retournera :
Le tableau ``items`` est vide.
Exemple cURL :
::
curl --get "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Créer votre premier article
---------------------------
@ -174,6 +186,12 @@ retournera :
Maintenant, si vous exécutez la précédente commande (voir **Récupérer les articles existants**), vous obtiendrez quelque chose.
Exemple cURL :
::
curl "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA&url=http://www.numerama.com/tech/160115-le-pocket-libre-wallabag-fait-le-plein-de-fonctionnalites.html"
Supprimer un article
--------------------
@ -227,6 +245,12 @@ retournera :
Et si vous voulez voir la liste des articles existants (voir **Récupérer les articles existants**), le tableau sera vide.
Exemple cURL :
::
curl --request DELETE "https://localhost:8000/api/entries/1.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
Autres méthodes
---------------

View File

@ -13,15 +13,15 @@ Fichiers de traductions
cette traduction qui est considérée comme la plus récente. Merci de vous baser
sur celle-ci pour créer votre traduction.
Les principaux fichiers de traduction se trouvent ici : https://github.com/wallabag/wallabag/tree/v2/src/Wallabag/CoreBundle/Resources/translations.
Les principaux fichiers de traduction se trouvent ici : https://github.com/wallabag/wallabag/tree/master/src/Wallabag/CoreBundle/Resources/translations.
Vous devez créer le fichier ``messages.CODE.yml``,
où CODE est le code ISO 639-1 de votre langue (`cf wikipedia <https://fr.wikipedia.org/wiki/Liste_des_codes_ISO_639-1>`__).
Autres fichiers à traduire :
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/CraueConfigBundle/translations.
- https://github.com/wallabag/wallabag/tree/v2/app/Resources/FOSUserBundle/translations.
- https://github.com/wallabag/wallabag/tree/master/app/Resources/CraueConfigBundle/translations.
- https://github.com/wallabag/wallabag/tree/master/app/Resources/FOSUserBundle/translations.
Vous devez créer les fichiers ``LE_FICHIER_DE_TRADUCTION.CODE.yml``.
@ -29,7 +29,7 @@ Fichier de configuration
~~~~~~~~~~~~~~~~~~~~~~~~
Vous devez éditer `app/config/config.yml
<https://github.com/wallabag/wallabag/blob/v2/app/config/config.yml>`__ pour
<https://github.com/wallabag/wallabag/blob/master/app/config/config.yml>`__ pour
afficher votre langue dans la page Configuration de wallabag (pour permettre aux
utilisateurs de choisir cette nouvelle traduction).
@ -57,6 +57,6 @@ Documentation de wallabag
Contrairement à l'application, la langue principale de la documentation est l'anglais
Les fichiers de documentation se trouvent ici : https://github.com/wallabag/wallabag/tree/v2/docs
Les fichiers de documentation se trouvent ici : https://github.com/wallabag/wallabag/tree/master/docs
Vous devez respecter la structure du dossier ``en`` quand vous crééz votre traduction.

View File

@ -12,9 +12,9 @@ Il peut y avoir plusieurs raisons :
Comment puis-je aider pour réparer ça ?
---------------------------------------
- `en nous envoyant un email avec l'URL de l'article <mailto:hello@wallabag.org>`_
- `en nous envoyant un email avec l'URL de l'article <mailto:hello\@wallabag.org>`_
- en essayant de réparer cet article par vous-même :) en créant un fichier pour l'article.
Vous pouvez utiliser cet outil http://siteconfig.fivefilters.org/.
Vous pouvez utiliser `cet outil <http://siteconfig.fivefilters.org/>`__.
Comment puis-je réessayer de récupérer le contenu ?
---------------------------------------------------

View File

@ -40,7 +40,7 @@ Installation de Composer :
curl -s http://getcomposer.org/installer | php
Vous pouvez trouver des instructions spécifiques ici (en anglais) : __ https://getcomposer.org/doc/00-intro.md
Vous pouvez trouver des instructions spécifiques `ici (en anglais) <https://getcomposer.org/doc/00-intro.md>`__ :
Pour installer wallabag, vous devez exécuter ces deux commandes :
@ -48,7 +48,7 @@ Pour installer wallabag, vous devez exécuter ces deux commandes :
git clone https://github.com/wallabag/wallabag.git
cd wallabag
git checkout 2.0.1
git checkout 2.0.3
SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
php bin/console wallabag:install --env=prod
@ -61,9 +61,7 @@ Pour démarrer le serveur interne à php et vérifier que tout s'est installé c
Et accéder wallabag à l'adresse http://lipdevotreserveur:8000
.. note::
Pour définir des paramètres via des variables d'environnement, vous pouvez les spécifier avec le préfixe ``SYMFONY__``. Par exemple, ``SYMFONY__DATABASE_DRIVER``. Vous pouvez lire `documentation Symfony
<http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__ pour en savoir plus.
Pour définir des paramètres via des variables d'environnement, vous pouvez les spécifier avec le préfixe ``SYMFONY__``. Par exemple, ``SYMFONY__DATABASE_DRIVER``. Vous pouvez lire `documentation Symfony <http://symfony.com/doc/current/cookbook/configuration/external_parameters.html>`__ pour en savoir plus.
Installation avec Apache
------------------------

View File

@ -30,7 +30,7 @@ class WallabagAnnotationController extends FOSRestController
->getRepository('WallabagAnnotationBundle:Annotation')
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
$total = count($annotationRows);
$annotations = array('total' => $total, 'rows' => $annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows];
$json = $this->get('serializer')->serialize($annotations, 'json');
@ -141,6 +141,6 @@ class WallabagAnnotationController extends FOSRestController
*/
private function renderJsonResponse($json, $code = 200)
{
return new Response($json, $code, array('application/json'));
return new Response($json, $code, ['application/json']);
}
}

View File

@ -35,13 +35,13 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
->getRepository('WallabagCoreBundle:Entry')
->findOneByUsernameAndNotArchived('admin');
$headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode(array(
$headers = ['CONTENT_TYPE' => 'application/json'];
$content = json_encode([
'text' => 'my annotation',
'quote' => 'my quote',
'ranges' => array('start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31),
));
$crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', array(), array(), $headers, $content);
'ranges' => ['start' => '', 'startOffset' => 24, 'end' => '', 'endOffset' => 31],
]);
$crawler = $this->client->request('POST', 'annotations/'.$entry->getId().'.json', [], [], $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -69,11 +69,11 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$this->logInAs('admin');
$headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode(array(
$headers = ['CONTENT_TYPE' => 'application/json'];
$content = json_encode([
'text' => 'a modified annotation',
));
$crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content);
]);
$crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
@ -99,11 +99,11 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$this->logInAs('admin');
$headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode(array(
$headers = ['CONTENT_TYPE' => 'application/json'];
$content = json_encode([
'text' => 'a modified annotation',
));
$crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content);
]);
$crawler = $this->client->request('DELETE', 'annotations/'.$annotation->getId().'.json', [], [], $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);

View File

@ -26,10 +26,10 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
{
$crawler = $this->client->request('GET', '/login');
$form = $crawler->filter('button[type=submit]')->form();
$data = array(
$data = [
'_username' => $username,
'_password' => 'mypassword',
);
];
$this->client->submit($form, $data);
}
@ -48,7 +48,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
$loginManager = $container->get('fos_user.security.login_manager');
$firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(array('username' => 'admin'));
$this->user = $userManager->findUserBy(['username' => 'admin']);
$loginManager->loginUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie

View File

@ -384,6 +384,6 @@ class WallabagRestController extends FOSRestController
*/
private function renderJsonResponse($json)
{
return new Response($json, 200, array('application/json'));
return new Response($json, 200, ['application/json']);
}
}

View File

@ -13,7 +13,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneBy(array('user' => 1, 'isArchived' => false));
->findOneBy(['user' => 1, 'isArchived' => false]);
if (!$entry) {
$this->markTestSkipped('No content found in db.');
@ -44,7 +44,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->findOneBy(array('user' => 2, 'isArchived' => false));
->findOneBy(['user' => 2, 'isArchived' => false]);
if (!$entry) {
$this->markTestSkipped('No content found in db.');
@ -79,7 +79,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testGetStarredEntries()
{
$this->client->request('GET', '/api/entries', array('star' => 1, 'sort' => 'updated'));
$this->client->request('GET', '/api/entries', ['star' => 1, 'sort' => 'updated']);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -101,7 +101,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testGetArchiveEntries()
{
$this->client->request('GET', '/api/entries', array('archive' => 1));
$this->client->request('GET', '/api/entries', ['archive' => 1]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -149,10 +149,10 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostEntry()
{
$this->client->request('POST', '/api/entries.json', array(
$this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'tags' => 'google',
));
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -168,11 +168,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostSameEntry()
{
$this->client->request('POST', '/api/entries.json', array(
$this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html',
'archive' => '1',
'tags' => 'google, apple',
));
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -187,11 +187,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostArchivedAndStarredEntry()
{
$this->client->request('POST', '/api/entries.json', array(
$this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
'archive' => '1',
'starred' => '1',
));
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -206,11 +206,11 @@ class WallabagRestControllerTest extends WallabagApiTestCase
public function testPostArchivedAndStarredEntryWithoutQuotes()
{
$this->client->request('POST', '/api/entries.json', array(
$this->client->request('POST', '/api/entries.json', [
'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
'archive' => 0,
'starred' => 1,
));
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -236,12 +236,12 @@ class WallabagRestControllerTest extends WallabagApiTestCase
// hydrate the tags relations
$nbTags = count($entry->getTags());
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [
'title' => 'New awesome title',
'tags' => 'new tag '.uniqid(),
'starred' => '1',
'archive' => '0',
));
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -268,12 +268,12 @@ class WallabagRestControllerTest extends WallabagApiTestCase
// hydrate the tags relations
$nbTags = count($entry->getTags());
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', array(
$this->client->request('PATCH', '/api/entries/'.$entry->getId().'.json', [
'title' => 'New awesome title',
'tags' => 'new tag '.uniqid(),
'starred' => 1,
'archive' => 0,
));
]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -298,9 +298,9 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$this->markTestSkipped('No content found in db.');
}
$tags = array();
$tags = [];
foreach ($entry->getTags() as $tag) {
$tags[] = array('id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug());
$tags[] = ['id' => $tag->getId(), 'label' => $tag->getLabel(), 'slug' => $tag->getSlug()];
}
$this->client->request('GET', '/api/entries/'.$entry->getId().'/tags');
@ -323,7 +323,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
$newTags = 'tag1,tag2,tag3';
$this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', array('tags' => $newTags));
$this->client->request('POST', '/api/entries/'.$entry->getId().'/tags', ['tags' => $newTags]);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
@ -337,7 +337,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
->getRepository('WallabagCoreBundle:Entry')
->find($entry->getId());
$tagsInDB = array();
$tagsInDB = [];
foreach ($entryDB->getTags()->toArray() as $tag) {
$tagsInDB[$tag->getId()] = $tag->getLabel();
}

View File

@ -36,7 +36,7 @@ abstract class WallabagApiTestCase extends WebTestCase
$loginManager = $container->get('fos_user.security.login_manager');
$firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(array('username' => 'admin'));
$this->user = $userManager->findUserBy(['username' => 'admin']);
$loginManager->loginUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie

View File

@ -468,7 +468,7 @@ class InstallCommand extends ContainerAwareCommand
try {
return in_array($databaseName, $schemaManager->listDatabases());
} catch (\Doctrine\DBAL\Exception\ConnectionException $e) {
} catch (\Doctrine\DBAL\Exception\DriverException $e) {
// it means we weren't able to get database list, assume the database doesn't exist
return false;

View File

@ -32,7 +32,7 @@ class ConfigController extends Controller
$user = $this->getUser();
// handle basic config detail (this form is defined as a service)
$configForm = $this->createForm(ConfigType::class, $config, array('action' => $this->generateUrl('config')));
$configForm = $this->createForm(ConfigType::class, $config, ['action' => $this->generateUrl('config')]);
$configForm->handleRequest($request);
if ($configForm->isValid()) {
@ -52,7 +52,7 @@ class ConfigController extends Controller
}
// handle changing password
$pwdForm = $this->createForm(ChangePasswordType::class, null, array('action' => $this->generateUrl('config').'#set4'));
$pwdForm = $this->createForm(ChangePasswordType::class, null, ['action' => $this->generateUrl('config').'#set4']);
$pwdForm->handleRequest($request);
if ($pwdForm->isValid()) {
@ -71,10 +71,10 @@ class ConfigController extends Controller
}
// handle changing user information
$userForm = $this->createForm(UserInformationType::class, $user, array(
'validation_groups' => array('Profile'),
$userForm = $this->createForm(UserInformationType::class, $user, [
'validation_groups' => ['Profile'],
'action' => $this->generateUrl('config').'#set3',
));
]);
$userForm->handleRequest($request);
if ($userForm->isValid()) {
@ -89,7 +89,7 @@ class ConfigController extends Controller
}
// handle rss information
$rssForm = $this->createForm(RssType::class, $config, array('action' => $this->generateUrl('config').'#set2'));
$rssForm = $this->createForm(RssType::class, $config, ['action' => $this->generateUrl('config').'#set2']);
$rssForm->handleRequest($request);
if ($rssForm->isValid()) {
@ -106,7 +106,7 @@ class ConfigController extends Controller
// handle tagging rule
$taggingRule = new TaggingRule();
$newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, array('action' => $this->generateUrl('config').'#set5'));
$newTaggingRule = $this->createForm(TaggingRuleType::class, $taggingRule, ['action' => $this->generateUrl('config').'#set5']);
$newTaggingRule->handleRequest($request);
if ($newTaggingRule->isValid()) {
@ -126,10 +126,10 @@ class ConfigController extends Controller
$newUser = $userManager->createUser();
// enable created user by default
$newUser->setEnabled(true);
$newUserForm = $this->createForm(NewUserType::class, $newUser, array(
'validation_groups' => array('Profile'),
$newUserForm = $this->createForm(NewUserType::class, $newUser, [
'validation_groups' => ['Profile'],
'action' => $this->generateUrl('config').'#set6',
));
]);
$newUserForm->handleRequest($request);
if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) {
@ -147,27 +147,27 @@ class ConfigController extends Controller
$this->get('session')->getFlashBag()->add(
'notice',
$this->get('translator')->trans('flashes.config.notice.user_added', array('%username%' => $newUser->getUsername()))
$this->get('translator')->trans('flashes.config.notice.user_added', ['%username%' => $newUser->getUsername()])
);
return $this->redirect($this->generateUrl('config').'#set6');
}
return $this->render('WallabagCoreBundle:Config:index.html.twig', array(
'form' => array(
return $this->render('WallabagCoreBundle:Config:index.html.twig', [
'form' => [
'config' => $configForm->createView(),
'rss' => $rssForm->createView(),
'pwd' => $pwdForm->createView(),
'user' => $userForm->createView(),
'new_user' => $newUserForm->createView(),
'new_tagging_rule' => $newTaggingRule->createView(),
),
'rss' => array(
],
'rss' => [
'username' => $user->getUsername(),
'token' => $config->getRssToken(),
),
],
'twofactor_auth' => $this->getParameter('twofactor_auth'),
));
]);
}
/**
@ -187,7 +187,7 @@ class ConfigController extends Controller
$em->flush();
if ($request->isXmlHttpRequest()) {
return new JsonResponse(array('token' => $config->getRssToken()));
return new JsonResponse(['token' => $config->getRssToken()]);
}
$this->get('session')->getFlashBag()->add(
@ -229,7 +229,7 @@ class ConfigController extends Controller
* Retrieve config for the current user.
* If no config were found, create a new one.
*
* @return Wallabag\CoreBundle\Entity\Config
* @return Config
*/
private function getConfig()
{

View File

@ -21,9 +21,9 @@ class DeveloperController extends Controller
{
$clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findAll();
return $this->render('WallabagCoreBundle:Developer:index.html.twig', array(
return $this->render('WallabagCoreBundle:Developer:index.html.twig', [
'clients' => $clients,
));
]);
}
/**
@ -43,7 +43,7 @@ class DeveloperController extends Controller
$clientForm->handleRequest($request);
if ($clientForm->isValid()) {
$client->setAllowedGrantTypes(array('token', 'authorization_code', 'password', 'refresh_token'));
$client->setAllowedGrantTypes(['token', 'authorization_code', 'password', 'refresh_token']);
$em->persist($client);
$em->flush();
@ -52,15 +52,15 @@ class DeveloperController extends Controller
'flashes.developer.notice.client_created'
);
return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', array(
return $this->render('WallabagCoreBundle:Developer:client_parameters.html.twig', [
'client_id' => $client->getPublicId(),
'client_secret' => $client->getSecret(),
));
]);
}
return $this->render('WallabagCoreBundle:Developer:client.html.twig', array(
return $this->render('WallabagCoreBundle:Developer:client.html.twig', [
'form' => $clientForm->createView(),
));
]);
}
/**

View File

@ -54,10 +54,10 @@ class EntryController extends Controller
if (false !== $existingEntry) {
$this->get('session')->getFlashBag()->add(
'notice',
$this->get('translator')->trans('flashes.entry.notice.entry_already_saved', array('%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')))
$this->get('translator')->trans('flashes.entry.notice.entry_already_saved', ['%date%' => $existingEntry->getCreatedAt()->format('d-m-Y')])
);
return $this->redirect($this->generateUrl('view', array('id' => $existingEntry->getId())));
return $this->redirect($this->generateUrl('view', ['id' => $existingEntry->getId()]));
}
$this->updateEntry($entry);
@ -69,9 +69,9 @@ class EntryController extends Controller
return $this->redirect($this->generateUrl('homepage'));
}
return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', array(
return $this->render('WallabagCoreBundle:Entry:new_form.html.twig', [
'form' => $form->createView(),
));
]);
}
/**
@ -131,12 +131,12 @@ class EntryController extends Controller
'flashes.entry.notice.entry_updated'
);
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
return $this->render('WallabagCoreBundle:Entry:edit.html.twig', array(
return $this->render('WallabagCoreBundle:Entry:edit.html.twig', [
'form' => $form->createView(),
));
]);
}
/**
@ -257,17 +257,17 @@ class EntryController extends Controller
$entries->setCurrentPage($page);
} catch (OutOfRangeCurrentPageException $e) {
if ($page > 1) {
return $this->redirect($this->generateUrl($type, array('page' => $entries->getNbPages())), 302);
return $this->redirect($this->generateUrl($type, ['page' => $entries->getNbPages()]), 302);
}
}
return $this->render(
'WallabagCoreBundle:Entry:entries.html.twig',
array(
[
'form' => $form->createView(),
'entries' => $entries,
'currentPage' => $page,
)
]
);
}
@ -286,7 +286,7 @@ class EntryController extends Controller
return $this->render(
'WallabagCoreBundle:Entry:entry.html.twig',
array('entry' => $entry)
['entry' => $entry]
);
}
@ -314,7 +314,7 @@ class EntryController extends Controller
$message
);
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
/**
@ -344,7 +344,9 @@ class EntryController extends Controller
$message
);
return $this->redirect($request->headers->get('referer'));
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
return $this->redirect($redirectUrl);
}
/**
@ -374,7 +376,9 @@ class EntryController extends Controller
$message
);
return $this->redirect($request->headers->get('referer'));
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
return $this->redirect($redirectUrl);
}
/**
@ -394,7 +398,7 @@ class EntryController extends Controller
// to avoid redirecting to the deleted entry. Ugh.
$url = $this->generateUrl(
'view',
array('id' => $entry->getId()),
['id' => $entry->getId()],
UrlGeneratorInterface::ABSOLUTE_URL
);
@ -408,7 +412,11 @@ class EntryController extends Controller
);
// don't redirect user to the deleted entry
return $this->redirect($url !== $request->headers->get('referer') ? $request->headers->get('referer') : $this->generateUrl('homepage'));
$to = ($url !== $request->headers->get('referer') ? $request->headers->get('referer') : null);
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($to);
return $this->redirect($redirectUrl);
}
/**
@ -426,11 +434,11 @@ class EntryController extends Controller
/**
* Check for existing entry, if it exists, redirect to it with a message.
*
* @param $entry
* @param Entry $entry
*
* @return array|bool
* @return Entry|bool
*/
private function checkIfEntryAlreadyExists($entry)
private function checkIfEntryAlreadyExists(Entry $entry)
{
return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
}

View File

@ -16,12 +16,15 @@ class ExportController extends Controller
/**
* Gets one entry content.
*
* @param Entry $entry
* @param Entry $entry
* @param string $format
*
* @Route("/export/{id}.{format}", name="export_entry", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv",
* "id": "\d+"
* })
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function downloadEntryAction(Entry $entry, $format)
{
@ -38,10 +41,15 @@ class ExportController extends Controller
/**
* Export all entries for current user.
*
* @param string $format
* @param string $category
*
* @Route("/export/{category}.{format}", name="export_entries", requirements={
* "format": "epub|mobi|pdf|json|xml|txt|csv",
* "category": "all|unread|starred|archive"
* })
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function downloadEntriesAction($format, $category)
{

View File

@ -87,9 +87,9 @@ class RssController extends Controller
$perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit');
$entries->setMaxPerPage($perPage);
return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', [
'type' => $type,
'entries' => $entries,
));
]);
}
}

View File

@ -14,7 +14,7 @@ class StaticController extends Controller
{
return $this->render(
'WallabagCoreBundle:Static:howto.html.twig',
array()
[]
);
}
@ -25,10 +25,10 @@ class StaticController extends Controller
{
return $this->render(
'WallabagCoreBundle:Static:about.html.twig',
array(
[
'version' => $this->getParameter('wallabag_core.version'),
'paypal_url' => $this->getParameter('wallabag_core.paypal_url'),
)
]
);
}
@ -39,7 +39,7 @@ class StaticController extends Controller
{
return $this->render(
'WallabagCoreBundle:Static:quickstart.html.twig',
array()
[]
);
}
}

View File

@ -13,6 +13,7 @@ class TagController extends Controller
{
/**
* @param Request $request
* @param Entry $entry
*
* @Route("/new-tag/{entry}", requirements={"entry" = "\d+"}, name="new_tag")
*
@ -38,13 +39,13 @@ class TagController extends Controller
'flashes.tag.notice.tag_added'
);
return $this->redirect($this->generateUrl('view', array('id' => $entry->getId())));
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
}
return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', array(
return $this->render('WallabagCoreBundle:Tag:new_form.html.twig', [
'form' => $form->createView(),
'entry' => $entry,
));
]);
}
/**
@ -64,7 +65,9 @@ class TagController extends Controller
}
$em->flush();
return $this->redirect($request->headers->get('referer'));
$redirectUrl = $this->get('wallabag_core.helper.redirect')->to($request->headers->get('referer'));
return $this->redirect($redirectUrl);
}
/**
@ -82,9 +85,9 @@ class TagController extends Controller
return $this->render(
'WallabagCoreBundle:Tag:tags.html.twig',
array(
[
'tags' => $tags,
)
]
);
}
}

View File

@ -16,14 +16,14 @@ class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInter
{
$tr1 = new TaggingRule();
$tr1->setRule('content matches "spurs"');
$tr1->setTags(array('sport'));
$tr1->setTags(['sport']);
$tr1->setConfig($this->getReference('admin-config'));
$manager->persist($tr1);
$tr2 = new TaggingRule();
$tr2->setRule('content matches "basket"');
$tr2->setTags(array('sport'));
$tr2->setTags(['sport']);
$tr2->setConfig($this->getReference('admin-config'));
$manager->persist($tr2);

View File

@ -36,9 +36,9 @@ class LocaleListener implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return array(
return [
// must be registered before the default Locale listener
KernelEvents::REQUEST => array(array('onKernelRequest', 17)),
);
KernelEvents::REQUEST => [['onKernelRequest', 17]],
];
}
}

View File

@ -28,9 +28,9 @@ class RegistrationConfirmedListener implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return array(
return [
FOSUserEvents::REGISTRATION_CONFIRMED => 'authenticate',
);
];
}
public function authenticate(FilterUserResponseEvent $event, $eventName = null, EventDispatcherInterface $eventDispatcher = null)

View File

@ -15,28 +15,28 @@ class ChangePasswordType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('old_password', PasswordType::class, array(
'constraints' => new UserPassword(array('message' => 'validator.password_wrong_value')),
->add('old_password', PasswordType::class, [
'constraints' => new UserPassword(['message' => 'validator.password_wrong_value']),
'label' => 'config.form_password.old_password_label',
))
->add('new_password', RepeatedType::class, array(
])
->add('new_password', RepeatedType::class, [
'type' => PasswordType::class,
'invalid_message' => 'validator.password_must_match',
'required' => true,
'first_options' => array('label' => 'config.form_password.new_password_label'),
'second_options' => array('label' => 'config.form_password.repeat_new_password_label'),
'constraints' => array(
new Constraints\Length(array(
'first_options' => ['label' => 'config.form_password.new_password_label'],
'second_options' => ['label' => 'config.form_password.repeat_new_password_label'],
'constraints' => [
new Constraints\Length([
'min' => 8,
'minMessage' => 'validator.password_too_short',
)),
]),
new Constraints\NotBlank(),
),
],
'label' => 'config.form_password.new_password_label',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
))
])
;
}

View File

@ -14,8 +14,8 @@ class ClientType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('redirect_uris', UrlType::class, array('required' => true, 'label' => 'developer.client.form.redirect_uris_label'))
->add('save', SubmitType::class, array('label' => 'developer.client.form.save_label'))
->add('redirect_uris', UrlType::class, ['required' => true, 'label' => 'developer.client.form.redirect_uris_label'])
->add('save', SubmitType::class, ['label' => 'developer.client.form.save_label'])
;
$builder->get('redirect_uris')
@ -24,7 +24,7 @@ class ClientType extends AbstractType
return $originalUri;
},
function ($submittedUri) {
return array($submittedUri);
return [$submittedUri];
}
))
;
@ -32,9 +32,9 @@ class ClientType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\ApiBundle\Entity\Client',
));
]);
}
public function getBlockPrefix()

View File

@ -10,8 +10,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class ConfigType extends AbstractType
{
private $themes = array();
private $languages = array();
private $themes = [];
private $languages = [];
/**
* @param array $themes Themes come from the LiipThemeBundle (liip_theme.themes)
@ -30,39 +30,39 @@ class ConfigType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('theme', ChoiceType::class, array(
->add('theme', ChoiceType::class, [
'choices' => array_flip($this->themes),
'choices_as_values' => true,
'label' => 'config.form_settings.theme_label',
))
->add('items_per_page', null, array(
])
->add('items_per_page', null, [
'label' => 'config.form_settings.items_per_page_label',
))
->add('reading_speed', ChoiceType::class, array(
])
->add('reading_speed', ChoiceType::class, [
'label' => 'config.form_settings.reading_speed.label',
'choices' => array(
'choices' => [
'config.form_settings.reading_speed.100_word' => '0.5',
'config.form_settings.reading_speed.200_word' => '1',
'config.form_settings.reading_speed.300_word' => '1.5',
'config.form_settings.reading_speed.400_word' => '2',
),
))
->add('language', ChoiceType::class, array(
],
])
->add('language', ChoiceType::class, [
'choices' => array_flip($this->languages),
'choices_as_values' => true,
'label' => 'config.form_settings.language_label',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
))
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\Config',
));
]);
}
public function getBlockPrefix()

View File

@ -14,30 +14,30 @@ class EditEntryType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', TextType::class, array(
->add('title', TextType::class, [
'required' => true,
'label' => 'entry.edit.title_label',
))
->add('is_public', CheckboxType::class, array(
])
->add('is_public', CheckboxType::class, [
'required' => false,
'label' => 'entry.edit.is_public_label',
))
->add('url', TextType::class, array(
])
->add('url', TextType::class, [
'disabled' => true,
'required' => false,
'label' => 'entry.edit.url_label',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'entry.edit.save_label',
))
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
));
]);
}
public function getBlockPrefix()

View File

@ -34,28 +34,28 @@ class EntryFilterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('readingTime', NumberRangeFilterType::class, array(
->add('readingTime', NumberRangeFilterType::class, [
'label' => 'entry.filters.reading_time.label',
))
->add('createdAt', DateRangeFilterType::class, array(
'left_date_options' => array(
'attr' => array(
])
->add('createdAt', DateRangeFilterType::class, [
'left_date_options' => [
'attr' => [
'placeholder' => 'dd/mm/yyyy',
),
],
'format' => 'dd/MM/yyyy',
'widget' => 'single_text',
),
'right_date_options' => array(
'attr' => array(
],
'right_date_options' => [
'attr' => [
'placeholder' => 'dd/mm/yyyy',
),
],
'format' => 'dd/MM/yyyy',
'widget' => 'single_text',
),
],
'label' => 'entry.filters.created_at.label',
)
]
)
->add('domainName', TextFilterType::class, array(
->add('domainName', TextFilterType::class, [
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
$value = $values['value'];
if (strlen($value) <= 2 || empty($value)) {
@ -66,14 +66,14 @@ class EntryFilterType extends AbstractType
return $filterQuery->createCondition($expression);
},
'label' => 'entry.filters.domain_label',
))
->add('isArchived', CheckboxFilterType::class, array(
])
->add('isArchived', CheckboxFilterType::class, [
'label' => 'entry.filters.archived_label',
))
->add('isStarred', CheckboxFilterType::class, array(
])
->add('isStarred', CheckboxFilterType::class, [
'label' => 'entry.filters.starred_label',
))
->add('previewPicture', CheckboxFilterType::class, array(
])
->add('previewPicture', CheckboxFilterType::class, [
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
if (false === $values['value']) {
return;
@ -84,12 +84,12 @@ class EntryFilterType extends AbstractType
return $filterQuery->createCondition($expression);
},
'label' => 'entry.filters.preview_picture_label',
))
->add('language', ChoiceFilterType::class, array(
])
->add('language', ChoiceFilterType::class, [
'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
'choices_as_values' => true,
'label' => 'entry.filters.language_label',
))
])
;
}
@ -100,9 +100,9 @@ class EntryFilterType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'csrf_protection' => false,
'validation_groups' => array('filtering'),
));
'validation_groups' => ['filtering'],
]);
}
}

View File

@ -12,18 +12,18 @@ class NewEntryType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('url', UrlType::class, array(
->add('url', UrlType::class, [
'required' => true,
'label' => 'entry.new.form_new.url_label',
))
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
));
]);
}
public function getBlockPrefix()

View File

@ -12,15 +12,15 @@ class NewTagType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('label', TextType::class, array('required' => true))
->add('label', TextType::class, ['required' => true])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\Tag',
));
]);
}
public function getBlockPrefix()

View File

@ -17,38 +17,38 @@ class NewUserType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', TextType::class, array(
->add('username', TextType::class, [
'required' => true,
'label' => 'config.form_new_user.username_label',
))
->add('plainPassword', RepeatedType::class, array(
])
->add('plainPassword', RepeatedType::class, [
'type' => PasswordType::class,
'invalid_message' => 'validator.password_must_match',
'first_options' => array('label' => 'config.form_new_user.password_label'),
'second_options' => array('label' => 'config.form_new_user.repeat_new_password_label'),
'constraints' => array(
new Constraints\Length(array(
'first_options' => ['label' => 'config.form_new_user.password_label'],
'second_options' => ['label' => 'config.form_new_user.repeat_new_password_label'],
'constraints' => [
new Constraints\Length([
'min' => 8,
'minMessage' => 'validator.password_too_short',
)),
]),
new Constraints\NotBlank(),
),
],
'label' => 'config.form_new_user.plain_password_label',
))
->add('email', EmailType::class, array(
])
->add('email', EmailType::class, [
'label' => 'config.form_new_user.email_label',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
))
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\UserBundle\Entity\User',
));
]);
}
public function getBlockPrefix()

View File

@ -12,20 +12,20 @@ class RssType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('rss_limit', null, array(
->add('rss_limit', null, [
'label' => 'config.form_rss.rss_limit',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
))
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\Config',
));
]);
}
public function getBlockPrefix()

View File

@ -14,19 +14,19 @@ class TaggingRuleType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('rule', TextType::class, array(
->add('rule', TextType::class, [
'required' => true,
'label' => 'config.form_rules.rule_label',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
))
])
;
$tagsField = $builder
->create('tags', TextType::class, array(
->create('tags', TextType::class, [
'label' => 'config.form_rules.tags_label',
))
])
->addModelTransformer(new StringToListTransformer(','));
$builder->add($tagsField);
@ -34,9 +34,9 @@ class TaggingRuleType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\CoreBundle\Entity\TaggingRule',
));
]);
}
public function getBlockPrefix()

View File

@ -15,19 +15,19 @@ class UserInformationType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TextType::class, array(
->add('name', TextType::class, [
'label' => 'config.form_user.name_label',
))
->add('email', EmailType::class, array(
])
->add('email', EmailType::class, [
'label' => 'config.form_user.email_label',
))
->add('twoFactorAuthentication', CheckboxType::class, array(
])
->add('twoFactorAuthentication', CheckboxType::class, [
'required' => false,
'label' => 'config.form_user.twoFactorAuthentication_label',
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'config.form.save',
))
])
->remove('username')
->remove('plainPassword')
;
@ -40,9 +40,9 @@ class UserInformationType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
$resolver->setDefaults([
'data_class' => 'Wallabag\UserBundle\Entity\User',
));
]);
}
public function getBlockPrefix()

View File

@ -82,10 +82,10 @@ class ContentProxy
try {
$this->tagger->tag($entry);
} catch (\Exception $e) {
$this->logger->error('Error while trying to automatically tag an entry.', array(
$this->logger->error('Error while trying to automatically tag an entry.', [
'entry_url' => $url,
'error_msg' => $e->getMessage(),
));
]);
}
return $entry;

View File

@ -18,10 +18,10 @@ class EntriesExport
private $wallabagUrl;
private $logoPath;
private $title = '';
private $entries = array();
private $authors = array('wallabag');
private $entries = [];
private $authors = ['wallabag'];
private $language = '';
private $tags = array();
private $tags = [];
private $footerTemplate = '<div style="text-align:center;">
<p>Produced by wallabag with %EXPORT_METHOD%</p>
<p>Please open <a href="https://github.com/wallabag/wallabag/issues">an issue</a> if you have trouble with the display of this E-Book on your device.</p>
@ -41,12 +41,14 @@ class EntriesExport
* Define entries.
*
* @param array|Entry $entries An array of entries or one entry
*
* @return EntriesExport
*/
public function setEntries($entries)
{
if (!is_array($entries)) {
$this->language = $entries->getLanguage();
$entries = array($entries);
$entries = [$entries];
}
$this->entries = $entries;
@ -62,6 +64,8 @@ class EntriesExport
* Sets the category of which we want to get articles, or just one entry.
*
* @param string $method Method to get articles
*
* @return EntriesExport
*/
public function updateTitle($method)
{
@ -78,6 +82,8 @@ class EntriesExport
* Sets the output format.
*
* @param string $format
*
* @return Response
*/
public function exportAs($format)
{
@ -91,6 +97,8 @@ class EntriesExport
/**
* Use PHPePub to dump a .epub file.
*
* @return Response
*/
private function produceEpub()
{
@ -162,17 +170,19 @@ class EntriesExport
return Response::create(
$book->getBook(),
200,
array(
[
'Content-Description' => 'File Transfer',
'Content-type' => 'application/epub+zip',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.epub"',
'Content-Transfer-Encoding' => 'binary',
)
]
);
}
/**
* Use PHPMobi to dump a .mobi file.
*
* @return Response
*/
private function produceMobi()
{
@ -211,18 +221,20 @@ class EntriesExport
return Response::create(
$mobi->toString(),
200,
array(
[
'Accept-Ranges' => 'bytes',
'Content-Description' => 'File Transfer',
'Content-type' => 'application/x-mobipocket-ebook',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.mobi"',
'Content-Transfer-Encoding' => 'binary',
)
]
);
}
/**
* Use TCPDF to dump a .pdf file.
*
* @return Response
*/
private function producePdf()
{
@ -266,17 +278,19 @@ class EntriesExport
return Response::create(
$pdf->Output('', 'S'),
200,
array(
[
'Content-Description' => 'File Transfer',
'Content-type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.pdf"',
'Content-Transfer-Encoding' => 'binary',
)
]
);
}
/**
* Inspired from CsvFileDumper.
*
* @return Response
*/
private function produceCsv()
{
@ -284,20 +298,20 @@ class EntriesExport
$enclosure = '"';
$handle = fopen('php://memory', 'rb+');
fputcsv($handle, array('Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'), $delimiter, $enclosure);
fputcsv($handle, ['Title', 'URL', 'Content', 'Tags', 'MIME Type', 'Language'], $delimiter, $enclosure);
foreach ($this->entries as $entry) {
fputcsv(
$handle,
array(
[
$entry->getTitle(),
$entry->getURL(),
// remove new line to avoid crazy results
str_replace(array("\r\n", "\r", "\n"), '', $entry->getContent()),
str_replace(["\r\n", "\r", "\n"], '', $entry->getContent()),
implode(', ', $entry->getTags()->toArray()),
$entry->getMimetype(),
$entry->getLanguage(),
),
],
$delimiter,
$enclosure
);
@ -310,40 +324,55 @@ class EntriesExport
return Response::create(
$output,
200,
array(
[
'Content-type' => 'application/csv',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.csv"',
'Content-Transfer-Encoding' => 'UTF-8',
)
]
);
}
/**
* Dump a JSON file.
*
* @return Response
*/
private function produceJson()
{
return Response::create(
$this->prepareSerializingContent('json'),
200,
array(
[
'Content-type' => 'application/json',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.json"',
'Content-Transfer-Encoding' => 'UTF-8',
)
]
);
}
/**
* Dump a XML file.
*
* @return Response
*/
private function produceXml()
{
return Response::create(
$this->prepareSerializingContent('xml'),
200,
array(
[
'Content-type' => 'application/xml',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.xml"',
'Content-Transfer-Encoding' => 'UTF-8',
)
]
);
}
/**
* Dump a TXT file.
*
* @return Response
*/
private function produceTxt()
{
$content = '';
@ -356,11 +385,11 @@ class EntriesExport
return Response::create(
$content,
200,
array(
[
'Content-type' => 'text/plain',
'Content-Disposition' => 'attachment; filename="'.$this->title.'.txt"',
'Content-Transfer-Encoding' => 'UTF-8',
)
]
);
}
@ -378,7 +407,7 @@ class EntriesExport
return $serializer->serialize(
$this->entries,
$format,
SerializationContext::create()->setGroups(array('entries_for_user'))
SerializationContext::create()->setGroups(['entries_for_user'])
);
}

View File

@ -0,0 +1,37 @@
<?php
namespace Wallabag\CoreBundle\Helper;
use Symfony\Component\Routing\Router;
/**
* Manage redirections to avoid redirecting to empty routes.
*/
class Redirect
{
private $router;
public function __construct(Router $router)
{
$this->router = $router;
}
/**
* @param string $url URL to redirect
* @param string $fallback Fallback URL if $url is null
*
* @return string
*/
public function to($url, $fallback = '')
{
if (null !== $url) {
return $url;
}
if ('' === $fallback) {
return $this->router->generate('homepage');
}
return $fallback;
}
}

View File

@ -54,7 +54,7 @@ class RuleBasedTagger
public function tagAllForUser(User $user)
{
$rules = $this->getRulesForUser($user);
$entries = array();
$entries = [];
foreach ($rules as $rule) {
$qb = $this->entryRepository->getBuilderForAllByUser($user->getId());

View File

@ -157,7 +157,7 @@ class EntryRepository extends EntityRepository
->getQuery()
->getResult();
$languages = array();
$languages = [];
foreach ($results as $result) {
$languages[$result['language']] = $result['language'];
}
@ -233,7 +233,7 @@ class EntryRepository extends EntityRepository
* @param $url
* @param $userId
*
* @return array|bool
* @return Entry|bool
*/
public function findByUrlAndUserId($url, $userId)
{

View File

@ -3,14 +3,14 @@ services:
class: Wallabag\CoreBundle\Helper\DetectActiveTheme
arguments:
- "@security.token_storage"
- %wallabag_core.theme%
- "%wallabag_core.theme%"
# custom form type
wallabag_core.form.type.config:
class: Wallabag\CoreBundle\Form\Type\ConfigType
arguments:
- %liip_theme.themes%
- %wallabag_core.languages%
- "%liip_theme.themes%"
- "%wallabag_core.languages%"
tags:
- { name: form.type }
@ -32,7 +32,7 @@ services:
wallabag_core.table_prefix_subscriber:
class: Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber
arguments:
- %database_table_prefix%
- "%database_table_prefix%"
tags:
- { name: doctrine.event_subscriber }
@ -92,10 +92,10 @@ services:
class: Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener
arguments:
- "@doctrine.orm.entity_manager"
- %wallabag_core.theme%
- %wallabag_core.items_on_page%
- %wallabag_core.rss_limit%
- %wallabag_core.language%
- "%wallabag_core.theme%"
- "%wallabag_core.items_on_page%"
- "%wallabag_core.rss_limit%"
- "%wallabag_core.language%"
tags:
- { name: kernel.event_subscriber }
@ -114,3 +114,8 @@ services:
class: Wallabag\CoreBundle\Operator\Doctrine\Matches
tags:
- { name: rulerz.operator, executor: rulerz.executor.doctrine, operator: matches, inline: true }
wallabag_core.helper.redirect:
class: Wallabag\CoreBundle\Helper\Redirect
arguments:
- "@router"

View File

@ -512,7 +512,7 @@ img.preview {
width: 50%;
}
.pagination {
div.pagination ul {
text-align: right;
margin-bottom:50px;
}
@ -523,25 +523,25 @@ img.preview {
color: #999;
}
.pagination > * {
div.pagination ul > * {
display: inline-block;
margin-left: 0.5em;
}
.pagination a {
div.pagination ul a {
color: #999;
text-decoration: none;
}
.pagination a:hover, .pagination a:focus {
div.pagination ul a:hover, div.pagination ul a:focus {
text-decoration: underline;
}
}
.pagination .disabled {
div.pagination ul .disabled {
display: none;
}
.pagination .current {
div.pagination ul .current {
height: 25px;
padding: 4px 8px;
border: 1px solid #d5d5d5;

View File

@ -80,6 +80,14 @@ main, #content, .valign-wrapper {
margin-bottom: 0;
}
.pagination {
float: right;
}
.pagination ul {
margin: 0 !important;
}
.pagination li {
padding: 0;
}
@ -90,6 +98,18 @@ main, #content, .valign-wrapper {
display: block;
}
.pagination li.active span {
padding: 0px 10px;
height: 30px;
display: block;
color: #fff;
}
.pagination .disabled {
margin-right: 10px;
margin-left: 10px;
}
.page-footer .footer-copyright p {
display: inline;
}

View File

@ -100,7 +100,7 @@ config:
tagging_rules_definition_title: '¿Qué significa reglas de etiquetado autómaticas?'
tagging_rules_definition_description: 'Son las reglas usadas por Wallabag para etiquetar automáticamente los nuevos artículos.<br />Cada vez que un nuevo artículo sea añadido, todas las reglas de etiquetado automáticas serán usadas para etiquetarlo, ayudándole a clasificar automáticamente los artículos.'
how_to_use_them_title: '¿Cómo se utilizan?'
how_to_use_them_description: 'Supongamos que quiere etiquetar nuevos artículos como « <i>lectura corta</i> » cuando el tiempo de leer sea menos de 3 minutos. <br /> En este caso, debe poner Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »'
how_to_use_them_description: 'Supongamos que quiere etiquetar nuevos artículos como « <i>lectura corta</i> » cuando el tiempo de leer sea menos de 3 minutos. <br /> En ese caso, debe poner « tiempo de leer &lt;= 3 » en el <i>Regla</i> campo y « <i>lectura corta</i> » en el <i>Etiquetas</i> campo.<br />Algunas etiquetas se pueden ser añadidas al mismo tiempo por separarlas con una coma: « <i>lectura corta, debe leer</i> »<br />Reglas complejas se pueden ser escritas por usar operadores predefinidos: si « <i>tiempo de leer &gt;= 5 Y nombre del dominio = "github.com"</i> » entonces etiquete como « <i>lectura larga, github </i> »'
variables_available_title: '¿Qué variables y operadores se pueden utilizar para escribir las reglas?'
variables_available_description: 'Las siguientes variables y operadores se pueden utilizar para crear las reglas de etiquetado automáticas:'
meaning: 'Significado'
@ -111,7 +111,7 @@ config:
isArchived: 'El artículo está guardado o no'
isStarred: 'Si el artículo es un favorito o no'
content: "El contenido del artículo"
language: "El idoma del artículo"
language: "El idioma del artículo"
mimetype: "Tipo MIME del artículo"
readingTime: "El tiempo estimado de lectura del artículo, en minutos"
domainName: 'El dominio del artículo'
@ -123,9 +123,9 @@ config:
strictly_greater_than: 'Estrictámente mas que…'
equal_to: 'Egual a…'
not_equal_to: 'Diferente de…'
or: 'Una regla O otra'
or: 'Una regla U otra'
and: 'Una regla Y la otra'
matches: 'Prueba si un <i>sujeto</i> corresponde a una <i>busqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>título coincide "football"</code>'
matches: 'Pruebe si un <i>sujeto</i> corresponde a una <i>búsqueda</i> (insensible a mayusculas).<br />Ejemplo : <code>título coincide "football"</code>'
form_new_user:
username_label: 'Nombre de usuario'
password_label: 'Contraseña'
@ -135,18 +135,18 @@ config:
entry:
page_titles:
# unread: 'Unread entries'
# starred: 'Starred entries'
# archived: 'Archived entries'
# filtered: 'Filtered entries'
unread: 'Artúclos no leídos'
starred: 'Artículos favoritos'
archived: 'Artículos archivados'
filtered: 'Artículos filtrados'
list:
number_on_the_page: '{0} No hay artículos.|{1} Hay un artículo.|]1,Inf[ Hay %count% artículos.'
reading_time: 'tiempo estimado de lectura'
reading_time_minutes: 'tiempo estimado de lectura: %readingTime% min'
reading_time_less_one_minute: 'tiempo estimado de lectura: <small class="inferieur">&lt;</small> 1 min'
original_article: 'original'
toogle_as_read: 'Marcar cómo leído/ no leído'
toogle_as_star: 'Marcar cómo favorito/ no favorito'
toogle_as_read: 'Marcar como leído/ no leído'
toogle_as_star: 'Marcar como favorito/ no favorito'
delete: 'Suprimir'
export_title: 'Exportar'
filters:
@ -158,7 +158,7 @@ entry:
preview_picture_help: 'Foto de preview'
language_label: 'Idioma'
reading_time:
label: 'Duración de lectura en minutos'
label: 'Duración de lectura en minutos'
from: 'de'
to: 'a'
domain_label: 'Nombre de dominio'
@ -175,7 +175,7 @@ entry:
back_to_homepage: 'Volver'
set_as_read: 'Marcar como leído'
# set_as_unread: 'Mark as unread'
set_as_favorite: 'Marcar cómo favorito'
set_as_favorite: 'Marcar como favorito'
view_original_article: 'Artículo original'
re_fetch_content: 'Redescargar el contenido'
delete: 'Suprimir'
@ -205,18 +205,18 @@ entry:
about:
page_title: 'Acerca de'
top_menu:
who_behind_wallabag: 'Equipo de desarrollo de wallabag'
getting_help: 'Conseguir ayuda'
who_behind_wallabag: 'Equipo del desarrollo de wallabag'
getting_help: 'Pedir ayuda'
helping: 'Ayudar a wallabag'
contributors: 'Contribuidores'
third_party: 'Librerías de terceeros'
contributors: 'Colaboradores'
third_party: 'Librerías de terceros'
who_behind_wallabag:
developped_by: 'Desarrollado por'
website: 'Sitio web'
many_contributors: 'Y muchos otros contribuidores ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">en Github</a>'
project_website: 'Web del proyecto'
many_contributors: 'Y muchos otros colaboradores ♥ <a href="https://github.com/wallabag/wallabag/graphs/contributors">en Github</a>'
project_website: 'Sitio web del proyecto'
license: 'Licencia'
version: 'Version'
version: 'Versión'
getting_help:
documentation: 'Documentación'
bug_reports: 'Reporte de errores'
@ -227,7 +227,7 @@ about:
by_contributing_2: 'nuestras necesidades están en un ticket'
by_paypal: 'via Paypal'
contributors:
description: 'Gradias a los contribuidores de la aplicación web de wallabag'
description: 'Gradias a los colaboradores de la aplicación web de wallabag'
third_party:
description: 'Aquí está la lista de las dependencias utilizadas por wallabag (con sus licencias) :'
package: 'Paquete'
@ -235,10 +235,10 @@ about:
howto:
page_title: 'Ayuda'
# page_description: 'There are several ways to save an article:'
page_description: 'Hay muchas maneras para guardar un artículo:'
top_menu:
browser_addons: 'Extensiones de navigador'
mobile_apps: 'Applicaciones para smartphone'
mobile_apps: 'Aplicaciones para smartphone'
bookmarklet: 'Bookmarklet'
form:
description: 'Gracias a este formulario'
@ -249,8 +249,8 @@ howto:
android:
via_f_droid: 'via F-Droid'
via_google_play: 'via Google Play'
# ios: 'on the iTunes Store'
# windows: 'on the Microsoft Store'
ios: 'por la tienda de iTunes'
windows: 'por la tienda de Microsoft'
bookmarklet:
description: 'Desplazar y soltar este link en la barra de marcadores :'

View File

@ -14,7 +14,7 @@
<ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li>
</ul>

View File

@ -6,15 +6,10 @@
{% block pager %}
<div class="results">
<div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
<div class="pagination">
<div class="pagination">
<a href="#" id="filter">{{ 'entry.filters.title'|trans }}</a>
{% if entries is not empty %}
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li>
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}" class="{{ currentPage == p ? 'current':''}}" >{{ p }}</a>
</li>
{% endfor %}
{% if entries.getNbPages > 1 %}
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
{% endif %}
</div>
</div>
@ -22,7 +17,7 @@
{% for entry in entries %}
<div id="entry-{{ entry.id|e }}" class="entry">
<h2><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></h2>
<h2><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|raw }}</a></h2>
{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
<div class="estimatedTime">

View File

@ -12,8 +12,8 @@
<item>
<title><![CDATA[{{ entry.title }}]]></title>
<source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source>
<link>{{ url('view', { 'id': entry.id }) }}</link>
<guid>{{ url('view', { 'id': entry.id }) }}</guid>
<link>{{ entry.url }}</link>
<guid>{{ entry.url }}</guid>
<pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate>
<description>
<![CDATA[

View File

@ -25,8 +25,8 @@
<dl>
<dt>{{ 'about.getting_help.documentation'|trans }}</dt>
<dd><a href="http://doc.wallabag.org/en/v2/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/v2/">français</a></dd>
<dd><a href="http://doc.wallabag.org/en/master/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/master/">français</a></dd>
<dt>{{ 'about.getting_help.bug_reports'|trans }}</dt>
<dd>{{ 'about.getting_help.support'|trans|raw }}</dd>
@ -67,7 +67,6 @@
<tr><td>doctrine/lexer</td><td>MIT</td></tr>
<tr><td>doctrine/migrations</td><td>LGPL-2.1</td></tr>
<tr><td>doctrine/orm</td><td>MIT</td></tr>
<tr><td>ezyang/htmlpurifier</td><td>LGPL</td></tr>
<tr><td>friendsofsymfony/oauth-server-bundle</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/oauth2-php</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/rest-bundle</td><td>MIT</td></tr>

View File

@ -48,10 +48,10 @@
<h4>{{ 'quickstart.docs.title'|trans }}</h4>
<ul>
<li><a href="http://doc.wallabag.org/en/v2/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
</ul>

View File

@ -14,7 +14,7 @@
<ul>
<li><a href="{{ path('developer_howto_firstapp') }}">{{ 'developer.how_to_first_app'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/developer/api.html">{{ 'developer.full_documentation'|trans }}</a></li>
<li><a href="{{ path('nelmio_api_doc_index') }}">{{ 'developer.list_methods'|trans }}</a></li>
</ul>

View File

@ -21,13 +21,9 @@
<div class="nb-results left">
{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
</div>
<ul class="pagination right">
{% for p in range(1, entries.nbPages) if entries.nbPages > 1 %}
<li class="{{ currentPage == p ? 'active':'waves-effect'}}">
<a href="{{ path(app.request.attributes.get('_route'), app.request.query.all|merge({'page': p})) }}">{{ p }}</a>
</li>
{% endfor %}
</ul>
{% if entries.getNbPages > 1 %}
{{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
{% endif %}
</div>
{% endblock %}
<br />
@ -48,7 +44,7 @@
<i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i>
{% endif %}
<span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span>
<span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span>
<div class="estimatedTime grey-text">
<span class="tool reading-time">

View File

@ -12,8 +12,8 @@
<item>
<title><![CDATA[{{ entry.title }}]]></title>
<source url="{{ url('view', { 'id': entry.id }) }}">wallabag</source>
<link>{{ url('view', { 'id': entry.id }) }}</link>
<guid>{{ url('view', { 'id': entry.id }) }}</guid>
<link>{{ entry.url }}</link>
<guid>{{ entry.url }}</guid>
<pubDate>{{ entry.createdAt|date('D, d M Y H:i:s') }}</pubDate>
<description>
<![CDATA[

View File

@ -34,8 +34,8 @@
<div id="set2" class="col s12">
<dl>
<dt>{{ 'about.getting_help.documentation'|trans }}</dt>
<dd><a href="http://doc.wallabag.org/en/v2/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/v2/">français</a></dd>
<dd><a href="http://doc.wallabag.org/en/master/">english</a></dd>
<dd><a href="http://doc.wallabag.org/fr/master/">français</a></dd>
<dt>{{ 'about.getting_help.bug_reports'|trans }}</dt>
<dd>{{ 'about.getting_help.support'|trans|raw }}</dd>
@ -76,7 +76,6 @@
<tr><td>doctrine/lexer</td><td>MIT</td></tr>
<tr><td>doctrine/migrations</td><td>LGPL-2.1</td></tr>
<tr><td>doctrine/orm</td><td>MIT</td></tr>
<tr><td>ezyang/htmlpurifier</td><td>LGPL</td></tr>
<tr><td>friendsofsymfony/oauth-server-bundle</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/oauth2-php</td><td>MIT</td></tr>
<tr><td>friendsofsymfony/rest-bundle</td><td>MIT</td></tr>

View File

@ -53,10 +53,10 @@
<h4>{{ 'quickstart.docs.title'|trans }}</h4>
<ul>
<li><a href="http://doc.wallabag.org/en/v2/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/v2/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/annotations.html">{{ 'quickstart.docs.annotate'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/download_articles.html">{{ 'quickstart.docs.export'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/filters.html">{{ 'quickstart.docs.search_filters'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html">{{ 'quickstart.docs.fetching_errors'|trans }}</a></li>
<li><a href="http://doc.wallabag.org/">{{ 'quickstart.docs.all_docs'|trans }}</a></li>
</ul>

View File

@ -27,7 +27,7 @@ class TablePrefixSubscriber implements EventSubscriber
public function getSubscribedEvents()
{
return array('loadClassMetadata');
return ['loadClassMetadata'];
}
public function loadClassMetadata(LoadClassMetadataEventArgs $args)

View File

@ -37,11 +37,11 @@ class InstallCommandTest extends WallabagCoreTestCase
$application = new Application(static::$kernel);
$application->setAutoExit(false);
$code = $application->run(new ArrayInput(array(
$code = $application->run(new ArrayInput([
'command' => 'doctrine:fixtures:load',
'--no-interaction' => true,
'--env' => 'test',
)), new NullOutput());
]), new NullOutput());
}
public function testRunInstallCommand()
@ -63,9 +63,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
));
]);
$this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
@ -93,10 +93,10 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
'--reset' => true,
));
]);
$this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
@ -116,10 +116,10 @@ class InstallCommandTest extends WallabagCoreTestCase
// drop database first, so the install command won't ask to reset things
$command = $application->find('doctrine:database:drop');
$command->run(new ArrayInput(array(
$command->run(new ArrayInput([
'command' => 'doctrine:database:drop',
'--force' => true,
)), new NullOutput());
]), new NullOutput());
// start a new application to avoid lagging connexion to pgsql
$client = static::createClient();
@ -140,9 +140,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
));
]);
$this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
@ -178,9 +178,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
));
]);
$this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
@ -201,19 +201,19 @@ class InstallCommandTest extends WallabagCoreTestCase
// drop database first, so the install command won't ask to reset things
$command = new DropDatabaseDoctrineCommand();
$command->setApplication($application);
$command->run(new ArrayInput(array(
$command->run(new ArrayInput([
'command' => 'doctrine:database:drop',
'--force' => true,
)), new NullOutput());
]), new NullOutput());
$this->getClient()->getContainer()->get('doctrine')->getConnection()->close();
$command = new CreateDatabaseDoctrineCommand();
$command->setApplication($application);
$command->run(new ArrayInput(array(
$command->run(new ArrayInput([
'command' => 'doctrine:database:create',
'--env' => 'test',
)), new NullOutput());
]), new NullOutput());
$command = $application->find('wallabag:install');
@ -233,9 +233,9 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
));
]);
$this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());
@ -265,10 +265,10 @@ class InstallCommandTest extends WallabagCoreTestCase
$command->getHelperSet()->set($question, 'question');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
'--no-interaction' => true,
));
]);
$this->assertContains('Checking system requirements.', $tester->getDisplay());
$this->assertContains('Setting up database.', $tester->getDisplay());

View File

@ -21,9 +21,9 @@ class TagAllCommandTest extends WallabagCoreTestCase
$command = $application->find('wallabag:tag:all');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
));
]);
}
public function testRunTagAllCommandWithBadUsername()
@ -34,10 +34,10 @@ class TagAllCommandTest extends WallabagCoreTestCase
$command = $application->find('wallabag:tag:all');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
'username' => 'unknown',
));
]);
$this->assertContains('User "unknown" not found', $tester->getDisplay());
}
@ -50,10 +50,10 @@ class TagAllCommandTest extends WallabagCoreTestCase
$command = $application->find('wallabag:tag:all');
$tester = new CommandTester($command);
$tester->execute(array(
$tester->execute([
'command' => $command->getName(),
'username' => 'admin',
));
]);
$this->assertContains('Tagging entries for user « admin »... Done', $tester->getDisplay());
}

View File

@ -43,12 +43,12 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=config_save]')->form();
$data = array(
$data = [
'config[theme]' => 'baggy',
'config[items_per_page]' => '30',
'config[reading_speed]' => '0.5',
'config[language]' => 'en',
);
];
$client->submit($form, $data);
@ -56,19 +56,19 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text']));
$this->assertContains('flashes.config.notice.config_saved', $alert[0]);
}
public function dataForUpdateFailed()
{
return array(
array(array(
return [
[[
'config[theme]' => 'baggy',
'config[items_per_page]' => '',
'config[language]' => 'en',
)),
);
]],
];
}
/**
@ -89,46 +89,46 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
$this->assertContains('This value should not be blank', $alert[0]);
}
public function dataForChangePasswordFailed()
{
return array(
array(
array(
return [
[
[
'change_passwd[old_password]' => 'material',
'change_passwd[new_password][first]' => '',
'change_passwd[new_password][second]' => '',
),
],
'validator.password_wrong_value',
),
array(
array(
],
[
[
'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => '',
'change_passwd[new_password][second]' => '',
),
],
'This value should not be blank',
),
array(
array(
],
[
[
'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'hop',
'change_passwd[new_password][second]' => '',
),
],
'validator.password_must_match',
),
array(
array(
],
[
[
'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'hop',
'change_passwd[new_password][second]' => 'hop',
),
],
'validator.password_too_short',
),
);
],
];
}
/**
@ -149,7 +149,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
$this->assertContains($expectedMessage, $alert[0]);
}
@ -164,11 +164,11 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=change_passwd_save]')->form();
$data = array(
$data = [
'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'mypassword',
'change_passwd[new_password][second]' => 'mypassword',
);
];
$client->submit($form, $data);
@ -176,28 +176,28 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text']));
$this->assertContains('flashes.config.notice.password_updated', $alert[0]);
}
public function dataForUserFailed()
{
return array(
array(
array(
return [
[
[
'update_user[name]' => '',
'update_user[email]' => '',
),
],
'fos_user.email.blank',
),
array(
array(
],
[
[
'update_user[name]' => '',
'update_user[email]' => 'test',
),
],
'fos_user.email.invalid',
),
);
],
];
}
/**
@ -218,7 +218,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
$this->assertContains($expectedMessage, $alert[0]);
}
@ -233,10 +233,10 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=update_user_save]')->form();
$data = array(
$data = [
'update_user[name]' => 'new name',
'update_user[email]' => 'admin@wallabag.io',
);
];
$client->submit($form, $data);
@ -244,59 +244,59 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.config.notice.user_updated', $alert[0]);
}
public function dataForNewUserFailed()
{
return array(
array(
array(
return [
[
[
'new_user[username]' => '',
'new_user[plainPassword][first]' => '',
'new_user[plainPassword][second]' => '',
'new_user[email]' => '',
),
],
'fos_user.username.blank',
),
array(
array(
],
[
[
'new_user[username]' => 'a',
'new_user[plainPassword][first]' => 'mypassword',
'new_user[plainPassword][second]' => 'mypassword',
'new_user[email]' => '',
),
],
'fos_user.username.short',
),
array(
array(
],
[
[
'new_user[username]' => 'wallace',
'new_user[plainPassword][first]' => 'mypassword',
'new_user[plainPassword][second]' => 'mypassword',
'new_user[email]' => 'test',
),
],
'fos_user.email.invalid',
),
array(
array(
],
[
[
'new_user[username]' => 'admin',
'new_user[plainPassword][first]' => 'wallacewallace',
'new_user[plainPassword][second]' => 'wallacewallace',
'new_user[email]' => 'wallace@wallace.me',
),
],
'fos_user.username.already_used',
),
array(
array(
],
[
[
'new_user[username]' => 'wallace',
'new_user[plainPassword][first]' => 'mypassword1',
'new_user[plainPassword][second]' => 'mypassword2',
'new_user[email]' => 'wallace@wallace.me',
),
],
'validator.password_must_match',
),
);
],
];
}
/**
@ -317,7 +317,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
$this->assertContains($expectedMessage, $alert[0]);
}
@ -332,12 +332,12 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=new_user_save]')->form();
$data = array(
$data = [
'new_user[username]' => 'wallace',
'new_user[plainPassword][first]' => 'wallace1',
'new_user[plainPassword][second]' => 'wallace1',
'new_user[email]' => 'wallace@wallace.me',
);
];
$client->submit($form, $data);
@ -345,7 +345,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text']));
$this->assertContains('flashes.config.notice.user_added', $alert[0]);
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
@ -381,7 +381,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('config.form_rss.no_token', $body[0]);
$client->request('GET', '/generate-token');
@ -389,7 +389,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertNotContains('config.form_rss.no_token', $body[0]);
}
@ -401,9 +401,9 @@ class ConfigControllerTest extends WallabagCoreTestCase
$client->request(
'GET',
'/generate-token',
array(),
array(),
array('HTTP_X-Requested-With' => 'XMLHttpRequest')
[],
[],
['HTTP_X-Requested-With' => 'XMLHttpRequest']
);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
@ -422,9 +422,9 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=rss_config_save]')->form();
$data = array(
$data = [
'rss_config[rss_limit]' => 12,
);
];
$client->submit($form, $data);
@ -432,26 +432,26 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text']));
$this->assertContains('flashes.config.notice.rss_updated', $alert[0]);
}
public function dataForRssFailed()
{
return array(
array(
array(
return [
[
[
'rss_config[rss_limit]' => 0,
),
],
'This value should be 1 or more.',
),
array(
array(
],
[
[
'rss_config[rss_limit]' => 1000000000000,
),
],
'validator.rss_limit_too_hight',
),
);
],
];
}
/**
@ -472,7 +472,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
$this->assertContains($expectedMessage, $alert[0]);
}
@ -487,10 +487,10 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=tagging_rule_save]')->form();
$data = array(
$data = [
'tagging_rule[rule]' => 'readingTime <= 3',
'tagging_rule[tags]' => 'short reading',
);
];
$client->submit($form, $data);
@ -498,7 +498,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text']));
$this->assertContains('flashes.config.notice.tagging_rules_updated', $alert[0]);
$deleteLink = $crawler->filter('.delete')->last()->link();
@ -507,34 +507,34 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div.messages.success')->extract(['_text']));
$this->assertContains('flashes.config.notice.tagging_rules_deleted', $alert[0]);
}
public function dataForTaggingRuleFailed()
{
return array(
array(
array(
return [
[
[
'tagging_rule[rule]' => 'unknownVar <= 3',
'tagging_rule[tags]' => 'cool tag',
),
array(
],
[
'The variable',
'does not exist.',
),
),
array(
array(
],
],
[
[
'tagging_rule[rule]' => 'length(domainName) <= 42',
'tagging_rule[tags]' => 'cool tag',
),
array(
],
[
'The operator',
'does not exist.',
),
),
);
],
],
];
}
/**
@ -555,7 +555,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
foreach ($messages as $message) {
$this->assertContains($message, $body[0]);
@ -574,7 +574,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/tagging-rule/delete/'.$rule->getId());
$this->assertEquals(403, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('You can not access this tagging rule', $body[0]);
}
@ -593,11 +593,11 @@ class ConfigControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=change_passwd_save]')->form();
$data = array(
$data = [
'change_passwd[old_password]' => 'mypassword',
'change_passwd[new_password][first]' => 'mypassword',
'change_passwd[new_password][second]' => 'mypassword',
);
];
$client->submit($form, $data);

View File

@ -28,7 +28,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('quickstart.intro.paragraph_1', $body[0]);
// Test if quickstart is disabled when user has 1 entry
@ -38,16 +38,16 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form();
$data = array(
$data = [
'entry[url]' => $this->url,
);
];
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$client->followRedirect();
$crawler = $client->request('GET', '/unread/list');
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('entry.list.number_on_the_page', $body[0]);
}
@ -74,7 +74,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertCount(4, $crawler->filter('div[class=entry]'));
// Good URL
$client->request('GET', '/bookmarklet', array('url' => $this->url));
$client->request('GET', '/bookmarklet', ['url' => $this->url]);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
$client->followRedirect();
$crawler = $client->request('GET', '/');
@ -103,7 +103,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->submit($form);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(array('_text')));
$this->assertCount(1, $alert = $crawler->filter('form ul li')->extract(['_text']));
$this->assertEquals('This value should not be blank.', $alert[0]);
}
@ -121,9 +121,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form();
$data = array(
$data = [
'entry[url]' => $this->url,
);
];
$client->submit($form, $data);
@ -150,9 +150,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form();
$data = array(
$data = [
'entry[url]' => $this->url,
);
];
$client->submit($form, $data);
@ -174,9 +174,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=entry]')->form();
$data = array(
$data = [
'entry[url]' => $url = 'https://github.com/wallabag/wallabag',
);
];
$client->submit($form, $data);
@ -245,7 +245,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/view/'.$content->getId());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains($content->getTitle(), $body[0]);
}
@ -315,9 +315,9 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[type=submit]')->form();
$data = array(
$data = [
'entry[title]' => 'My updated title hehe :)',
);
];
$client->submit($form, $data);
@ -325,7 +325,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(array('_text')));
$this->assertGreaterThan(1, $alert = $crawler->filter('div[id=article] h1')->extract(['_text']));
$this->assertContains('My updated title hehe :)', $alert[0]);
}
@ -461,10 +461,10 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
$data = [
'entry_filter[readingTime][right_number]' => 11,
'entry_filter[readingTime][left_number]' => 11,
);
];
$crawler = $client->submit($form, $data);
@ -480,28 +480,28 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
$data = [
'entry_filter[createdAt][left_date]' => date('d/m/Y'),
'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')),
);
];
$crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]'));
$data = array(
$data = [
'entry_filter[createdAt][left_date]' => date('d/m/Y'),
'entry_filter[createdAt][right_date]' => date('d/m/Y'),
);
];
$crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]'));
$data = array(
$data = [
'entry_filter[createdAt][left_date]' => '01/01/1970',
'entry_filter[createdAt][right_date]' => '01/01/1970',
);
];
$crawler = $client->submit($form, $data);
@ -516,13 +516,13 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=config_save]')->form();
$data = array(
$data = [
'config[items_per_page]' => '1',
);
];
$client->submit($form, $data);
$parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&amp;entry_filter%5BreadingTime%5D%5Bright_number%5D=';
$parameters = '?entry_filter%5BreadingTime%5D%5Bleft_number%5D=&entry_filter%5BreadingTime%5D%5Bright_number%5D=';
$client->request('GET', 'unread/list'.$parameters);
@ -531,9 +531,9 @@ class EntryControllerTest extends WallabagCoreTestCase
// reset pagination
$crawler = $client->request('GET', '/config');
$form = $crawler->filter('button[id=config_save]')->form();
$data = array(
$data = [
'config[items_per_page]' => '12',
);
];
$client->submit($form, $data);
}
@ -544,17 +544,17 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
$data = [
'entry_filter[domainName]' => 'domain',
);
];
$crawler = $client->submit($form, $data);
$this->assertCount(5, $crawler->filter('div[class=entry]'));
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
$data = [
'entry_filter[domainName]' => 'wallabag',
);
];
$crawler = $client->submit($form, $data);
$this->assertCount(0, $crawler->filter('div[class=entry]'));
@ -601,17 +601,17 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
$data = [
'entry_filter[language]' => 'fr',
);
];
$crawler = $client->submit($form, $data);
$this->assertCount(2, $crawler->filter('div[class=entry]'));
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
$data = [
'entry_filter[language]' => 'en',
);
];
$crawler = $client->submit($form, $data);
$this->assertCount(2, $crawler->filter('div[class=entry]'));

View File

@ -34,17 +34,17 @@ class RssControllerTest extends WallabagCoreTestCase
public function dataForBadUrl()
{
return array(
array(
return [
[
'/admin/YZIOAUZIAO/unread.xml',
),
array(
],
[
'/wallace/YZIOAUZIAO/starred.xml',
),
array(
],
[
'/wallace/YZIOAUZIAO/archives.xml',
),
);
],
];
}
/**

View File

@ -13,7 +13,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
$client->followRedirects();
$crawler = $client->request('GET', '/config');
$this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(array('_text'))[0]);
$this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(['_text'])[0]);
}
public function testLoginWith2Factor()
@ -38,7 +38,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
$this->logInAs('admin');
$crawler = $client->request('GET', '/config');
$this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(array('_text'))[0]);
$this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(['_text'])[0]);
// restore user
$user = $em

View File

@ -32,9 +32,9 @@ class TagControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=tag]')->form();
$data = array(
$data = [
'tag[label]' => $this->tagName,
);
];
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
@ -53,9 +53,9 @@ class TagControllerTest extends WallabagCoreTestCase
$this->assertEquals(1, count($newEntry->getTags()));
# tag already exists but still not assigned to this entry
$data = array(
$data = [
'tag[label]' => 'foo',
);
];
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());
@ -82,9 +82,9 @@ class TagControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=tag]')->form();
$data = array(
$data = [
'tag[label]' => 'foo2, bar2',
);
];
$client->submit($form, $data);
$this->assertEquals(302, $client->getResponse()->getStatusCode());

View File

@ -18,12 +18,12 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
public function transformProvider()
{
return array(
array(null, ''),
array(array(), ''),
array(array('single value'), 'single value'),
array(array('first value', 'second value'), 'first value,second value'),
);
return [
[null, ''],
[[], ''],
[['single value'], 'single value'],
[['first value', 'second value'], 'first value,second value'],
];
}
/**
@ -38,13 +38,13 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
public function reverseTransformProvider()
{
return array(
array(null, null),
array('', array()),
array('single value', array('single value')),
array('first value,second value', array('first value', 'second value')),
array('first value, second value', array('first value', 'second value')),
array('first value, , second value', array('first value', 'second value')),
);
return [
[null, null],
['', []],
['single value', ['single value']],
['first value,second value', ['first value', 'second value']],
['first value, second value', ['first value', 'second value']],
['first value, , second value', ['first value', 'second value']],
];
}
}

View File

@ -17,19 +17,19 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag');
$graby = $this->getMockBuilder('Graby\Graby')
->setMethods(array('fetchContent'))
->setMethods(['fetchContent'])
->disableOriginalConstructor()
->getMock();
$graby->expects($this->any())
->method('fetchContent')
->willReturn(array(
->willReturn([
'html' => false,
'title' => '',
'url' => '',
'content_type' => '',
'language' => '',
));
]);
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://user@:80');
@ -51,19 +51,19 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag');
$graby = $this->getMockBuilder('Graby\Graby')
->setMethods(array('fetchContent'))
->setMethods(['fetchContent'])
->disableOriginalConstructor()
->getMock();
$graby->expects($this->any())
->method('fetchContent')
->willReturn(array(
->willReturn([
'html' => false,
'title' => '',
'url' => '',
'content_type' => '',
'language' => '',
));
]);
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0');
@ -85,23 +85,23 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag');
$graby = $this->getMockBuilder('Graby\Graby')
->setMethods(array('fetchContent'))
->setMethods(['fetchContent'])
->disableOriginalConstructor()
->getMock();
$graby->expects($this->any())
->method('fetchContent')
->willReturn(array(
->willReturn([
'html' => false,
'title' => '',
'url' => '',
'content_type' => '',
'language' => '',
'open_graph' => array(
'open_graph' => [
'og_title' => 'my title',
'og_description' => 'desc',
),
));
],
]);
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://domain.io');
@ -123,24 +123,24 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
->method('tag');
$graby = $this->getMockBuilder('Graby\Graby')
->setMethods(array('fetchContent'))
->setMethods(['fetchContent'])
->disableOriginalConstructor()
->getMock();
$graby->expects($this->any())
->method('fetchContent')
->willReturn(array(
->willReturn([
'html' => str_repeat('this is my content', 325),
'title' => 'this is my title',
'url' => 'http://1.1.1.1',
'content_type' => 'text/html',
'language' => 'fr',
'open_graph' => array(
'open_graph' => [
'og_title' => 'my OG title',
'og_description' => 'OG desc',
'og_image' => 'http://3.3.3.3/cover.jpg',
),
));
],
]);
$proxy = new ContentProxy($graby, $tagger, $this->getTagRepositoryMock(), $this->getLogger());
$entry = $proxy->updateEntry(new Entry(new User()), 'http://0.0.0.0');
@ -217,7 +217,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$entry = new Entry(new User());
$proxy->assignTagsToEntry($entry, array(' tag1', 'tag2 '));
$proxy->assignTagsToEntry($entry, [' tag1', 'tag2 ']);
$this->assertCount(2, $entry->getTags());
$this->assertEquals('tag1', $entry->getTags()[0]->getLabel());
@ -253,7 +253,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
$entry = new Entry(new User());
$proxy->assignTagsToEntry($entry, array());
$proxy->assignTagsToEntry($entry, []);
$this->assertCount(0, $entry->getTags());
}
@ -299,7 +299,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
private function getTaggerMock()
{
return $this->getMockBuilder('Wallabag\CoreBundle\Helper\RuleBasedTagger')
->setMethods(array('tag'))
->setMethods(['tag'])
->disableOriginalConstructor()
->getMock();
}

View File

@ -0,0 +1,55 @@
<?php
namespace Wallabag\CoreBundle\Tests\Helper;
use Wallabag\CoreBundle\Helper\Redirect;
class RedirectTest extends \PHPUnit_Framework_TestCase
{
/** @var \PHPUnit_Framework_MockObject_MockObject */
private $routerMock;
/** @var Redirect */
private $redirect;
public function setUp()
{
$this->routerMock = $this->getRouterMock();
$this->redirect = new Redirect($this->routerMock);
}
public function testRedirectToNullWithFallback()
{
$redirectUrl = $this->redirect->to(null, 'fallback');
$this->assertEquals('fallback', $redirectUrl);
}
public function testRedirectToNullWithoutFallback()
{
$redirectUrl = $this->redirect->to(null);
$this->assertEquals($this->routerMock->generate('homepage'), $redirectUrl);
}
public function testRedirectToValidUrl()
{
$redirectUrl = $this->redirect->to('/unread/list');
$this->assertEquals('/unread/list', $redirectUrl);
}
private function getRouterMock()
{
$mock = $this->getMockBuilder('Symfony\Component\Routing\Router')
->disableOriginalConstructor()
->getMock();
$mock->expects($this->any())
->method('generate')
->with('homepage')
->willReturn('homepage');
return $mock;
}
}

View File

@ -36,7 +36,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagWithNoMatchingRule()
{
$taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar'));
$taggingRule = $this->getTaggingRule('rule as string', ['foo', 'bar']);
$user = $this->getUser([$taggingRule]);
$entry = new Entry($user);
@ -53,7 +53,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagWithAMatchingRule()
{
$taggingRule = $this->getTaggingRule('rule as string', array('foo', 'bar'));
$taggingRule = $this->getTaggingRule('rule as string', ['foo', 'bar']);
$user = $this->getUser([$taggingRule]);
$entry = new Entry($user);
@ -74,8 +74,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagWithAMixOfMatchingRules()
{
$taggingRule = $this->getTaggingRule('bla bla', array('hey'));
$otherTaggingRule = $this->getTaggingRule('rule as string', array('foo'));
$taggingRule = $this->getTaggingRule('bla bla', ['hey']);
$otherTaggingRule = $this->getTaggingRule('rule as string', ['foo']);
$user = $this->getUser([$taggingRule, $otherTaggingRule]);
$entry = new Entry($user);
@ -94,7 +94,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testWhenTheTagExists()
{
$taggingRule = $this->getTaggingRule('rule as string', array('foo'));
$taggingRule = $this->getTaggingRule('rule as string', ['foo']);
$user = $this->getUser([$taggingRule]);
$entry = new Entry($user);
$tag = new Tag();
@ -122,8 +122,8 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testSameTagWithDifferentfMatchingRules()
{
$taggingRule = $this->getTaggingRule('bla bla', array('hey'));
$otherTaggingRule = $this->getTaggingRule('rule as string', array('hey'));
$taggingRule = $this->getTaggingRule('bla bla', ['hey']);
$otherTaggingRule = $this->getTaggingRule('rule as string', ['hey']);
$user = $this->getUser([$taggingRule, $otherTaggingRule]);
$entry = new Entry($user);
@ -142,7 +142,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
public function testTagAllEntriesForAUser()
{
$taggingRule = $this->getTaggingRule('bla bla', array('hey'));
$taggingRule = $this->getTaggingRule('bla bla', ['hey']);
$user = $this->getUser([$taggingRule]);
@ -152,7 +152,7 @@ class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase
$this->rulerz
->method('filter')
->willReturn(array(new Entry($user), new Entry($user)));
->willReturn([new Entry($user), new Entry($user)]);
$entries = $this->tagger->tagAllForUser($user);

View File

@ -15,7 +15,7 @@ use Wallabag\CoreBundle\Command\InstallCommand;
*/
class InstallCommandMock extends InstallCommand
{
protected function runCommand($command, $parameters = array())
protected function runCommand($command, $parameters = [])
{
return $this;
}

View File

@ -11,7 +11,7 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
{
public function testSupportsWithNoRegistry()
{
$params = new ParamConverter(array());
$params = new ParamConverter([]);
$converter = new UsernameRssTokenConverter();
$this->assertFalse($converter->supports($params));
@ -25,9 +25,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once())
->method('getManagers')
->will($this->returnValue(array()));
->will($this->returnValue([]));
$params = new ParamConverter(array());
$params = new ParamConverter([]);
$converter = new UsernameRssTokenConverter($registry);
$this->assertFalse($converter->supports($params));
@ -41,9 +41,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once())
->method('getManagers')
->will($this->returnValue(array('default' => null)));
->will($this->returnValue(['default' => null]));
$params = new ParamConverter(array());
$params = new ParamConverter([]);
$converter = new UsernameRssTokenConverter($registry);
$this->assertFalse($converter->supports($params));
@ -74,14 +74,14 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once())
->method('getManagers')
->will($this->returnValue(array('default' => null)));
->will($this->returnValue(['default' => null]));
$registry->expects($this->once())
->method('getManagerForClass')
->with('superclass')
->will($this->returnValue($em));
$params = new ParamConverter(array('class' => 'superclass'));
$params = new ParamConverter(['class' => 'superclass']);
$converter = new UsernameRssTokenConverter($registry);
$this->assertFalse($converter->supports($params));
@ -112,14 +112,14 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
$registry->expects($this->once())
->method('getManagers')
->will($this->returnValue(array('default' => null)));
->will($this->returnValue(['default' => null]));
$registry->expects($this->once())
->method('getManagerForClass')
->with('WallabagUserBundle:User')
->will($this->returnValue($em));
$params = new ParamConverter(array('class' => 'WallabagUserBundle:User'));
$params = new ParamConverter(['class' => 'WallabagUserBundle:User']);
$converter = new UsernameRssTokenConverter($registry);
$this->assertTrue($converter->supports($params));
@ -131,7 +131,7 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
*/
public function testApplyEmptyRequest()
{
$params = new ParamConverter(array());
$params = new ParamConverter([]);
$converter = new UsernameRssTokenConverter();
$converter->apply(new Request(), $params);
@ -170,9 +170,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
->with('WallabagUserBundle:User')
->will($this->returnValue($em));
$params = new ParamConverter(array('class' => 'WallabagUserBundle:User'));
$params = new ParamConverter(['class' => 'WallabagUserBundle:User']);
$converter = new UsernameRssTokenConverter($registry);
$request = new Request(array(), array(), array('username' => 'test', 'token' => 'test'));
$request = new Request([], [], ['username' => 'test', 'token' => 'test']);
$converter->apply($request, $params);
}
@ -208,9 +208,9 @@ class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
->with('WallabagUserBundle:User')
->will($this->returnValue($em));
$params = new ParamConverter(array('class' => 'WallabagUserBundle:User', 'name' => 'user'));
$params = new ParamConverter(['class' => 'WallabagUserBundle:User', 'name' => 'user']);
$converter = new UsernameRssTokenConverter($registry);
$request = new Request(array(), array(), array('username' => 'test', 'token' => 'test'));
$request = new Request([], [], ['username' => 'test', 'token' => 'test']);
$converter->apply($request, $params);

View File

@ -11,23 +11,23 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
{
public function dataForPrefix()
{
return array(
array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '`wallabag_user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
return [
['wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()],
['wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '`wallabag_user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()],
['wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()],
array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
['wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()],
['wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\MySqlPlatform()],
['wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\SqlitePlatform()],
array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '`user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
['', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()],
['', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '`user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()],
['', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()],
array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
);
['', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()],
['', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\MySqlPlatform()],
['', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\SqlitePlatform()],
];
}
/**
@ -42,7 +42,7 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
$subscriber = new TablePrefixSubscriber($prefix);
$metaClass = new ClassMetadata($entityName);
$metaClass->setPrimaryTable(array('name' => $tableName));
$metaClass->setPrimaryTable(['name' => $tableName]);
$metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
@ -64,7 +64,7 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
->getMock();
$metaClass = new ClassMetadata($entityName);
$metaClass->setPrimaryTable(array('name' => $tableName));
$metaClass->setPrimaryTable(['name' => $tableName]);
$metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
@ -88,18 +88,18 @@ class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
$subscriber = new TablePrefixSubscriber('yo_');
$metaClass = new ClassMetadata('Wallabag\UserBundle\Entity\Entry');
$metaClass->setPrimaryTable(array('name' => 'entry'));
$metaClass->mapManyToMany(array(
$metaClass->setPrimaryTable(['name' => 'entry']);
$metaClass->mapManyToMany([
'fieldName' => 'tags',
'joinTable' => array('name' => null, 'schema' => null),
'joinTable' => ['name' => null, 'schema' => null],
'targetEntity' => 'Tag',
'mappedBy' => null,
'inversedBy' => 'entries',
'cascade' => array('persist'),
'cascade' => ['persist'],
'indexBy' => null,
'orphanRemoval' => false,
'fetch' => 2,
));
]);
$metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);

View File

@ -24,10 +24,10 @@ abstract class WallabagCoreTestCase extends WebTestCase
{
$crawler = $this->client->request('GET', '/login');
$form = $crawler->filter('button[type=submit]')->form();
$data = array(
$data = [
'_username' => $username,
'_password' => 'mypassword',
);
];
$this->client->submit($form, $data);
}

View File

@ -16,7 +16,7 @@ class Utils
$token = substr(base64_encode(random_bytes($length)), 0, $length);
// remove character which can broken the url
return str_replace(array('+', '/'), '', $token);
return str_replace(['+', '/'], '', $token);
}
/**

View File

@ -6,9 +6,9 @@ class WallabagExtension extends \Twig_Extension
{
public function getFilters()
{
return array(
new \Twig_SimpleFilter('removeWww', array($this, 'removeWww')),
);
return [
new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']),
];
}
public function removeWww($url)

View File

@ -17,10 +17,10 @@ class PocketController extends Controller
{
$pocket = $this->get('wallabag_import.pocket.import');
$form = $this->createFormBuilder($pocket)
->add('mark_as_read', CheckboxType::class, array(
->add('mark_as_read', CheckboxType::class, [
'label' => 'import.form.mark_as_read_label',
'required' => false,
))
])
->getForm();
return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
@ -36,7 +36,7 @@ class PocketController extends Controller
public function authAction(Request $request)
{
$requestToken = $this->get('wallabag_import.pocket.import')
->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL));
->getRequestToken($this->generateUrl('import', [], UrlGeneratorInterface::ABSOLUTE_URL));
if (false === $requestToken) {
$this->get('session')->getFlashBag()->add(
@ -51,7 +51,7 @@ class PocketController extends Controller
$this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']);
return $this->redirect(
'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL),
'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], UrlGeneratorInterface::ABSOLUTE_URL),
301
);
}
@ -79,10 +79,10 @@ class PocketController extends Controller
if (true === $pocket->setMarkAsRead($markAsRead)->import()) {
$summary = $pocket->getSummary();
$message = $this->get('translator')->trans('flashes.import.notice.summary', array(
$message = $this->get('translator')->trans('flashes.import.notice.summary', [
'%imported%' => $summary['imported'],
'%skipped%' => $summary['skipped'],
));
]);
}
$this->get('session')->getFlashBag()->add(

View File

@ -55,10 +55,10 @@ abstract class WallabagController extends Controller
if (true === $res) {
$summary = $wallabag->getSummary();
$message = $this->get('translator')->trans('flashes.import.notice.summary', array(
$message = $this->get('translator')->trans('flashes.import.notice.summary', [
'%imported%' => $summary['imported'],
'%skipped%' => $summary['skipped'],
));
]);
unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name);
}

View File

@ -13,16 +13,16 @@ class UploadImportType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('file', FileType::class, array(
->add('file', FileType::class, [
'label' => 'import.form.file_label',
))
->add('mark_as_read', CheckboxType::class, array(
])
->add('mark_as_read', CheckboxType::class, [
'label' => 'import.form.mark_as_read_label',
'required' => false,
))
->add('save', SubmitType::class, array(
])
->add('save', SubmitType::class, [
'label' => 'import.form.save_label',
))
])
;
}

View File

@ -258,6 +258,7 @@ class PocketImport implements ImportInterface
// flush every 20 entries
if (($i % 20) === 0) {
$this->em->flush();
$this->em->clear($entry);
}
++$i;
}

View File

@ -185,6 +185,7 @@ abstract class WallabagImport implements ImportInterface
// flush every 20 entries
if (($i % 20) === 0) {
$this->em->flush();
$this->em->clear($entry);
}
++$i;
}

View File

@ -29,9 +29,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json');
$data = array(
$data = [
'upload_import_file[file]' => $file,
);
];
$client->submit($form, $data);
@ -54,7 +54,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content->getTags()->contains($tag));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
}
@ -68,10 +68,10 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json');
$data = array(
$data = [
'upload_import_file[file]' => $file,
'upload_import_file[mark_as_read]' => 1,
);
];
$client->submit($form, $data);
@ -99,7 +99,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$this->assertTrue($content2->isArchived());
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
}
@ -113,9 +113,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt');
$data = array(
$data = [
'upload_import_file[file]' => $file,
);
];
$client->submit($form, $data);
@ -123,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -29,9 +29,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json');
$data = array(
$data = [
'upload_import_file[file]' => $file,
);
];
$client->submit($form, $data);
@ -39,7 +39,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.summary', $body[0]);
$content = $client->getContainer()
@ -79,9 +79,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt');
$data = array(
$data = [
'upload_import_file[file]' => $file,
);
];
$client->submit($form, $data);
@ -89,7 +89,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$crawler = $client->followRedirect();
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text')));
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
$this->assertContains('flashes.import.notice.failed', $body[0]);
}
}

View File

@ -25,7 +25,7 @@ class ImportCompilerPassTest extends \PHPUnit_Framework_TestCase
$container
->register('foo')
->addTag('wallabag_import.import', array('alias' => 'pocket'))
->addTag('wallabag_import.import', ['alias' => 'pocket'])
;
$this->process($container);

Some files were not shown because too many files have changed in this diff Show More