From f40c88eb1fa349aab600f9c1c94364f317fe62dd Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 9 Oct 2017 16:45:09 +0200 Subject: [PATCH 1/3] Jump to Symfony 3.3 & update others deps Also update tests urls --- app/config/config.yml | 7 +++++++ composer.json | 14 +++++++------- phpunit.xml.dist | 2 +- .../Controller/WallabagAnnotationController.php | 8 ++++---- .../ApiBundle/Controller/EntryRestController.php | 2 +- .../ApiBundle/Controller/TagRestController.php | 8 ++++---- .../ApiBundle/Controller/UserRestController.php | 6 +++--- .../Controller/WallabagRestController.php | 2 +- .../CoreBundle/Controller/EntryControllerTest.php | 4 ++-- .../Controller/ChromeControllerTest.php | 3 ++- .../Controller/FirefoxControllerTest.php | 2 ++ .../Controller/PinboardControllerTest.php | 3 +++ .../Controller/ReadabilityControllerTest.php | 7 +++++-- .../Controller/WallabagV1ControllerTest.php | 3 +++ .../Controller/WallabagV2ControllerTest.php | 3 +++ .../ImportBundle/fixtures/readability-read.json | 2 +- .../ImportBundle/fixtures/readability.json | 2 +- .../ImportBundle/fixtures/wallabag-v2.json | 4 ++-- 18 files changed, 52 insertions(+), 30 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index d37ed227b4..b76fb69663 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -350,3 +350,10 @@ fos_js_routing: - howto - fos_user_security_logout - new + +jms_serializer: + handlers: + # to be removed if we switch to (default) ISO8601 datetime instead of ATOM + # see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494 + datetime: + default_format: "Y-m-d\\TH:i:sO" # ATOM diff --git a/composer.json b/composer.json index fa0a4a39d7..d1f970c797 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "ext-iconv": "*", "ext-tokenizer": "*", "ext-pdo": "*", - "symfony/symfony": "3.2.*", + "symfony/symfony": "3.3.*", "doctrine/orm": "^2.5", "doctrine/doctrine-bundle": "^1.6", "doctrine/doctrine-cache-bundle": "^1.2", @@ -51,15 +51,15 @@ "symfony/swiftmailer-bundle": "^2.3", "symfony/monolog-bundle": "^3.0", "sensio/distribution-bundle": "^5.0", - "sensio/framework-extra-bundle": "^3.0.2", + "sensio/framework-extra-bundle": "^3.0", "incenteev/composer-parameter-handler": "^2.0", - "nelmio/cors-bundle": "~1.4.0", + "nelmio/cors-bundle": "~1.4", "friendsofsymfony/rest-bundle": "~2.1", - "jms/serializer-bundle": "~1.1", + "jms/serializer-bundle": "~2.2", "nelmio/api-doc-bundle": "~2.7", "mgargano/simplehtmldom": "~1.5", "wallabag/tcpdf": "^6.2", - "simplepie/simplepie": "~1.3.1", + "simplepie/simplepie": "~1.5", "willdurand/hateoas-bundle": "~1.0", "liip/theme-bundle": "~1.1", "lexik/form-filter-bundle": "~5.0", @@ -89,12 +89,12 @@ }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~2.2", - "doctrine/data-fixtures": "~1.1.1", + "doctrine/data-fixtures": "~1.1", "sensio/generator-bundle": "^3.0", "symfony/phpunit-bridge": "^3.3", "friendsofphp/php-cs-fixer": "~2.0", "m6web/redis-mock": "^2.0", - "dama/doctrine-test-bundle": "^1.0" + "dama/doctrine-test-bundle": "^3.0" }, "scripts": { "post-cmd": [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8f5285e65b..591b0909d2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -32,6 +32,6 @@ - + diff --git a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php index 8d7b6ee9ea..f3090e6503 100644 --- a/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php +++ b/src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php @@ -31,7 +31,7 @@ public function getAnnotationsAction(Entry $entry) $total = count($annotationRows); $annotations = ['total' => $total, 'rows' => $annotationRows]; - $json = $this->get('serializer')->serialize($annotations, 'json'); + $json = $this->get('jms_serializer')->serialize($annotations, 'json'); return (new JsonResponse())->setJson($json); } @@ -64,7 +64,7 @@ public function postAnnotationAction(Request $request, Entry $entry) $em->persist($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return JsonResponse::fromJsonString($json); } @@ -99,7 +99,7 @@ public function putAnnotationAction(Annotation $annotation, Request $request) $em->persist($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return JsonResponse::fromJsonString($json); } @@ -124,7 +124,7 @@ public function deleteAnnotationAction(Annotation $annotation) $em->remove($annotation); $em->flush(); - $json = $this->get('serializer')->serialize($annotation, 'json'); + $json = $this->get('jms_serializer')->serialize($annotation, 'json'); return (new JsonResponse())->setJson($json); } diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 6db9773106..86e723351c 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -752,7 +752,7 @@ private function sendResponse($data) $context = new SerializationContext(); $context->setSerializeNull(true); - $json = $this->get('serializer')->serialize($data, 'json', $context); + $json = $this->get('jms_serializer')->serialize($data, 'json', $context); return (new JsonResponse())->setJson($json); } diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index efa4e8cfc1..d19f122833 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php @@ -25,7 +25,7 @@ public function getTagsAction() ->getRepository('WallabagCoreBundle:Tag') ->findAllTags($this->getUser()->getId()); - $json = $this->get('serializer')->serialize($tags, 'json'); + $json = $this->get('jms_serializer')->serialize($tags, 'json'); return (new JsonResponse())->setJson($json); } @@ -58,7 +58,7 @@ public function deleteTagLabelAction(Request $request) $this->cleanOrphanTag($tag); - $json = $this->get('serializer')->serialize($tag, 'json'); + $json = $this->get('jms_serializer')->serialize($tag, 'json'); return (new JsonResponse())->setJson($json); } @@ -100,7 +100,7 @@ public function deleteTagsLabelAction(Request $request) $this->cleanOrphanTag($tags); - $json = $this->get('serializer')->serialize($tags, 'json'); + $json = $this->get('jms_serializer')->serialize($tags, 'json'); return (new JsonResponse())->setJson($json); } @@ -126,7 +126,7 @@ public function deleteTagAction(Tag $tag) $this->cleanOrphanTag($tag); - $json = $this->get('serializer')->serialize($tag, 'json'); + $json = $this->get('jms_serializer')->serialize($tag, 'json'); return (new JsonResponse())->setJson($json); } diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 6f47cff0dd..a1378fc54e 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php @@ -46,7 +46,7 @@ public function getUserAction() public function putUserAction(Request $request) { if (!$this->getParameter('fosuser_registration') || !$this->get('craue_config')->get('api_user_registration')) { - $json = $this->get('serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); + $json = $this->get('jms_serializer')->serialize(['error' => "Server doesn't allow registrations"], 'json'); return (new JsonResponse()) ->setJson($json) @@ -92,7 +92,7 @@ public function putUserAction(Request $request) $errors['password'] = $this->translateErrors($data['plainPassword']['children']['first']['errors']); } - $json = $this->get('serializer')->serialize(['error' => $errors], 'json'); + $json = $this->get('jms_serializer')->serialize(['error' => $errors], 'json'); return (new JsonResponse()) ->setJson($json) @@ -127,7 +127,7 @@ public function putUserAction(Request $request) */ private function sendUser(User $user, $group = 'user_api', $status = JsonResponse::HTTP_OK) { - $json = $this->get('serializer')->serialize( + $json = $this->get('jms_serializer')->serialize( $user, 'json', SerializationContext::create()->setGroups([$group]) diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 71da2a645e..7d8cfbba23 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -19,7 +19,7 @@ class WallabagRestController extends FOSRestController public function getVersionAction() { $version = $this->container->getParameter('wallabag_core.version'); - $json = $this->get('serializer')->serialize($version, 'json'); + $json = $this->get('jms_serializer')->serialize($version, 'json'); return (new JsonResponse())->setJson($json); } diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 33bfa71e67..907814df3a 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -1268,7 +1268,7 @@ public function dataForLanguage() 'ru', ], 'fr-FR' => [ - 'http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', + 'https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', 'fr_FR', ], 'de' => [ @@ -1300,7 +1300,7 @@ public function dataForLanguage() null, ], 'es-ES' => [ - 'http://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google/', + 'https://www.muylinux.com/2015/04/17/odf-reino-unido-microsoft-google/', 'es_ES', ], ]; diff --git a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php index 3873ccf4af..ddb7a65a86 100644 --- a/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ChromeControllerTest.php @@ -114,10 +114,11 @@ public function testImportWallabagWithChromeFile() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'http://www.usinenouvelle.com/article/la-multiplication-des-chefs-de-projet-est-une-catastrophe-manageriale-majeure-affirme-le-sociologue-francois-dupuy.N307730', + 'https://www.usinenouvelle.com/article/la-multiplication-des-chefs-de-projet-est-une-catastrophe-manageriale-majeure-affirme-le-sociologue-francois-dupuy.N307730', $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.usinenouvelle.com is ok'); $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.usinenouvelle.com is ok'); $this->assertSame(1, count($content->getTags())); diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php index 5e1260b15b..933fffa21f 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php @@ -118,6 +118,7 @@ public function testImportWallabagWithFirefoxFile() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://lexpansion.lexpress.fr is ok'); $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://lexpansion.lexpress.fr is ok'); $this->assertNotEmpty($content->getLanguage(), 'Language for http://lexpansion.lexpress.fr is ok'); @@ -131,6 +132,7 @@ public function testImportWallabagWithFirefoxFile() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://stackoverflow.com is ok'); $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://stackoverflow.com is ok'); $this->assertEmpty($content->getLanguage(), 'Language for https://stackoverflow.com is ok'); diff --git a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php index 9bb597664d..1135f32e90 100644 --- a/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/PinboardControllerTest.php @@ -118,6 +118,7 @@ public function testImportPinboardWithFile() $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertContains('flashes.import.notice.summary', $body[0]); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://ma.ttias.be is ok'); $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://ma.ttias.be is ok'); $this->assertNotEmpty($content->getLanguage(), 'Language for https://ma.ttias.be is ok'); @@ -161,6 +162,7 @@ public function testImportPinboardWithFileAndMarkAllAsRead() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content1); $this->assertTrue($content1->isArchived()); $content2 = $client->getContainer() @@ -171,6 +173,7 @@ public function testImportPinboardWithFileAndMarkAllAsRead() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content2); $this->assertTrue($content2->isArchived()); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); diff --git a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php index e191515057..fcb9dfab14 100644 --- a/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/ReadabilityControllerTest.php @@ -111,13 +111,14 @@ public function testImportReadabilityWithFile() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', + 'https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/', $this->getLoggedInUserId() ); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertContains('flashes.import.notice.summary', $body[0]); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.zataz.com is ok'); $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.zataz.com is ok'); $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.zataz.com is ok'); @@ -159,16 +160,18 @@ public function testImportReadabilityWithFileAndMarkAllAsRead() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content1); $this->assertTrue($content1->isArchived()); $content2 = $client->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'https://facebook.github.io/graphql/', + 'https://facebook.github.io/graphql/October2016/', $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content2); $this->assertTrue($content2->isArchived()); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php index 4bc982e0ae..e0e309b015 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV1ControllerTest.php @@ -119,6 +119,7 @@ public function testImportWallabagWithFile() $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); $this->assertContains('flashes.import.notice.summary', $body[0]); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is empty'); $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is empty'); $this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is empty'); @@ -160,6 +161,7 @@ public function testImportWallabagWithFileAndMarkAllAsRead() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content1); $this->assertTrue($content1->isArchived()); $content2 = $client->getContainer() @@ -170,6 +172,7 @@ public function testImportWallabagWithFileAndMarkAllAsRead() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content2); $this->assertTrue($content2->isArchived()); $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text'])); diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index a94adcaf45..e52b9c85f5 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php @@ -119,6 +119,8 @@ public function testImportWallabagWithFile() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); + // empty because it wasn't re-imported $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is empty'); $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is empty'); @@ -136,6 +138,7 @@ public function testImportWallabagWithFile() $this->getLoggedInUserId() ); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.mediapart.fr is ok'); $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.mediapart.fr is ok'); $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.mediapart.fr is ok'); diff --git a/tests/Wallabag/ImportBundle/fixtures/readability-read.json b/tests/Wallabag/ImportBundle/fixtures/readability-read.json index c60767dc8f..7dbd986804 100644 --- a/tests/Wallabag/ImportBundle/fixtures/readability-read.json +++ b/tests/Wallabag/ImportBundle/fixtures/readability-read.json @@ -14,7 +14,7 @@ "article__excerpt": "The GraphQL Type system describes the capabilities of a GraphQL server and is used to determine if a query is valid. The type system also describes the input types of query variables to determine if…", "favorite": false, "date_archived": "2016-07-19T06:48:31", - "article__url": "https://facebook.github.io/graphql/", + "article__url": "https://facebook.github.io/graphql/October2016/", "date_added": "2016-06-24T17:50:16", "date_favorited": null, "article__title": "GraphQL", diff --git a/tests/Wallabag/ImportBundle/fixtures/readability.json b/tests/Wallabag/ImportBundle/fixtures/readability.json index b9fd570df9..ba7be5bfa2 100644 --- a/tests/Wallabag/ImportBundle/fixtures/readability.json +++ b/tests/Wallabag/ImportBundle/fixtures/readability.json @@ -22,7 +22,7 @@ "date_added": "2016-09-08T11:55:58+0200", "favorite": 0, "article__title": "90% des dossiers médicaux des Coréens du sud vendus à des entreprises privées - ZATAZ", - "article__url": "http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/" + "article__url": "https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/" } ], "recommendations": [] diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json index 0e30d95b82..63c44cf9eb 100644 --- a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json +++ b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json @@ -71,14 +71,14 @@ "is_starred": 0, "id": 608, "title": "90% des dossiers médicaux des Coréens du sud vendus à des entreprises privées - ZATAZ", - "url": "http://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/", + "url": "https://www.zataz.com/90-des-dossiers-medicaux-des-coreens-du-sud-vendus-a-des-entreprises-privees/", "content": "

La Corée du Sud vibre en ce moment à la lecture d’une information qui pend aux nez des Français. Une entreprise privée a récupéré 90% des dossiers médicaux des habitants du pays du matin calme au soleil levant pour les revendre.

\n

Une entreprise spécialisée dans le développement de logiciels en charge de gérer les frais médicaux, programmes utilisés dans les hôpitaux et la Korean Pharmaceutical Information Center, a offert il y a quelques mois ses logiciels de gestion d’officines. Plus de la moitié des pharmacies du pays ont utilisé l’outil. Sauf que les données sauvegardées ont été revendues à IMS Health Korea. Cette entreprise, dont le siège social est basé aux USA, a ensuite commercialisé, illégalement, les données à d’autres sociétés en Corée.

\n

La loi 2011 sur le droit de la protection des renseignements personnels interdit l’utilisation des renseignements personnels et des renseignements médicaux sans le consentement des patients. Le Pharmaceutical Information Center est actuellement jugé pour cette collecte illégale, qui date de 2013, et la distribution des informations médicales de 90% des Coréens.

\n
\n

Un cas qui pourrait toucher la France ?

\n
\n

Depuis février 2015, l’ouverture des données de santé dans l’hexagone a été décidée par le législateur. L’assurance-maladie a annoncé qu’elle proposait, en accès libre, sa base de données « Damir » sur le site data.gouv.fr. Un big data de la santé qui regroupe les informations issues de 1,2 milliard de feuilles de soins, de 500 millions d’actes médicaux et de 11 millions d’hospitalisations. Ce big data ne propose pas les identités (pas de nom, de numéro de sécurité sociale, …), uniquement des millions de chiffres et de données de santé. Cette faramineuse base de données, qui double de volume chaque année, permet d’extraire, par exemple, des statistiques liées à la santé dans les régions. L’article 47 de loi permet aux acteurs privés d’accéder aux données de la CNAMTS. C’est l’Institut national des données de santé (INDS) qui a en charge de répondre aux demandes du « privé » pour accéder aux données plus ciblées (et payantes).

\n", "annotations": [], "mimetype": "text/html", "language": "fr-FR", "reading_time": 1, "domain_name": "www.zataz.com", - "preview_picture": "http://www.zataz.com/wp-content/uploads/HD-Virus.png", + "preview_picture": "https://www.zataz.com/wp-content/uploads/HD-Virus.png", "tags": [] }, { From 3ef055ced3d6ea0d2f15ba660602545f477e9c3c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 9 Oct 2017 16:47:15 +0200 Subject: [PATCH 2/3] CS --- app/DoctrineMigrations/Version20161001072726.php | 2 +- app/DoctrineMigrations/Version20161022134138.php | 4 ++-- app/DoctrineMigrations/Version20161024212538.php | 2 +- app/DoctrineMigrations/Version20170510082609.php | 4 ++-- app/DoctrineMigrations/Version20170719231144.php | 2 +- .../ApiBundle/Controller/TagRestController.php | 2 +- src/Wallabag/CoreBundle/Command/ListUserCommand.php | 2 +- src/Wallabag/CoreBundle/Command/ShowUserCommand.php | 2 +- .../CoreBundle/Controller/ConfigController.php | 2 +- .../CoreBundle/Controller/EntryController.php | 2 +- .../CoreBundle/Controller/ExportController.php | 2 +- src/Wallabag/CoreBundle/Controller/TagController.php | 2 +- .../Event/Subscriber/TablePrefixSubscriber.php | 2 +- .../Form/DataTransformer/StringToListTransformer.php | 2 +- .../GrabySiteConfigBuilder.php | 4 ++-- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 2 +- .../CoreBundle/Operator/Doctrine/Matches.php | 2 +- .../CoreBundle/Operator/Doctrine/NotMatches.php | 2 +- src/Wallabag/CoreBundle/Operator/PHP/Matches.php | 2 +- src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php | 2 +- src/Wallabag/ImportBundle/Import/AbstractImport.php | 2 +- src/Wallabag/ImportBundle/Import/BrowserImport.php | 2 +- src/Wallabag/ImportBundle/Import/ChromeImport.php | 2 +- src/Wallabag/ImportBundle/Import/FirefoxImport.php | 2 +- .../ImportBundle/Import/InstapaperImport.php | 6 +++--- src/Wallabag/ImportBundle/Import/PocketImport.php | 12 ++++++------ .../ImportBundle/Import/WallabagV1Import.php | 2 +- 27 files changed, 37 insertions(+), 37 deletions(-) diff --git a/app/DoctrineMigrations/Version20161001072726.php b/app/DoctrineMigrations/Version20161001072726.php index 4babe1721b..f9d088a37b 100644 --- a/app/DoctrineMigrations/Version20161001072726.php +++ b/app/DoctrineMigrations/Version20161001072726.php @@ -28,7 +28,7 @@ public function setContainer(ContainerInterface $container = null) */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); // remove all FK from entry_tag switch ($this->connection->getDatabasePlatform()->getName()) { diff --git a/app/DoctrineMigrations/Version20161022134138.php b/app/DoctrineMigrations/Version20161022134138.php index 89ba99732d..c84f8fbbac 100644 --- a/app/DoctrineMigrations/Version20161022134138.php +++ b/app/DoctrineMigrations/Version20161022134138.php @@ -27,7 +27,7 @@ public function setContainer(ContainerInterface $container = null) */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); $this->addSql('ALTER DATABASE ' . $this->connection->getParams()['dbname'] . ' CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;'); @@ -58,7 +58,7 @@ public function up(Schema $schema) */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); $this->addSql('ALTER DATABASE ' . $this->connection->getParams()['dbname'] . ' CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;'); diff --git a/app/DoctrineMigrations/Version20161024212538.php b/app/DoctrineMigrations/Version20161024212538.php index 35853d033f..698819be33 100644 --- a/app/DoctrineMigrations/Version20161024212538.php +++ b/app/DoctrineMigrations/Version20161024212538.php @@ -55,7 +55,7 @@ public function down(Schema $schema) $clientsTable->dropColumn('user_id', 'integer'); - if ($this->connection->getDatabasePlatform()->getName() !== 'sqlite') { + if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) { $clientsTable->removeForeignKey($this->constraintName); } } diff --git a/app/DoctrineMigrations/Version20170510082609.php b/app/DoctrineMigrations/Version20170510082609.php index 329613b1bb..52c70168c1 100644 --- a/app/DoctrineMigrations/Version20170510082609.php +++ b/app/DoctrineMigrations/Version20170510082609.php @@ -34,7 +34,7 @@ public function setContainer(ContainerInterface $container = null) */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); foreach ($this->fields as $field) { $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;'); @@ -46,7 +46,7 @@ public function up(Schema $schema) */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); foreach ($this->fields as $field) { $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;'); diff --git a/app/DoctrineMigrations/Version20170719231144.php b/app/DoctrineMigrations/Version20170719231144.php index 0f5fa75ae5..0c74915078 100644 --- a/app/DoctrineMigrations/Version20170719231144.php +++ b/app/DoctrineMigrations/Version20170719231144.php @@ -27,7 +27,7 @@ public function setContainer(ContainerInterface $container = null) */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() === 'sqlite', 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); + $this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.'); // Find tags which need to be merged $dupTags = $this->connection->query(' diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index d19f122833..9d333fe4ee 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php @@ -145,7 +145,7 @@ private function cleanOrphanTag($tags) $em = $this->getDoctrine()->getManager(); foreach ($tags as $tag) { - if (count($tag->getEntries()) === 0) { + if (0 === count($tag->getEntries())) { $em->remove($tag); } } diff --git a/src/Wallabag/CoreBundle/Command/ListUserCommand.php b/src/Wallabag/CoreBundle/Command/ListUserCommand.php index 20660d1874..68e515da2c 100644 --- a/src/Wallabag/CoreBundle/Command/ListUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ListUserCommand.php @@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output) '%s/%s%s user(s) displayed.', count($users), $nbUsers, - $input->getArgument('search') === null ? '' : ' (filtered)' + null === $input->getArgument('search') ? '' : ' (filtered)' ) ); diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php index 2dca32c40a..a0184267e8 100644 --- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php @@ -56,7 +56,7 @@ private function showUser(User $user) sprintf('Email: %s', $user->getEmail()), sprintf('Display name: %s', $user->getName()), sprintf('Creation date: %s', $user->getCreatedAt()->format('Y-m-d H:i:s')), - sprintf('Last login: %s', $user->getLastLogin() !== null ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'), + sprintf('Last login: %s', null !== $user->getLastLogin() ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'), sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'yes' : 'no'), ]); } diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 7e39992d50..a89bb7805b 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -348,7 +348,7 @@ private function removeAllTagsByStatusAndUserId($tags, $userId) $em = $this->getDoctrine()->getManager(); foreach ($tags as $tag) { - if (count($tag->getEntries()) === 0) { + if (0 === count($tag->getEntries())) { $em->remove($tag); } } diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b0b74c3816..840dc25442 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -195,7 +195,7 @@ public function showAllAction(Request $request, $page) public function showUnreadAction(Request $request, $page) { // load the quickstart if no entry in database - if ((int) $page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) { + if (1 === (int) $page && 0 === $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId())) { return $this->redirect($this->generateUrl('quickstart')); } diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 35a2204606..7ca8923943 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php @@ -59,7 +59,7 @@ public function downloadEntriesAction(Request $request, $format, $category) $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; $repository = $this->get('wallabag_core.entry_repository'); - if ($category === 'tag_entries') { + if ('tag_entries' === $category) { $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); $entries = $repository->findAllByTagId( diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index be2dff98b3..616c37f2c6 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -65,7 +65,7 @@ public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag) $em->flush(); // remove orphan tag in case no entries are associated to it - if (count($tag->getEntries()) === 0) { + if (0 === count($tag->getEntries())) { $em->remove($tag); $em->flush(); } diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php index 35902654ff..fb8f225fc5 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php @@ -42,7 +42,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $args) $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]); foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { - if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { + if (ClassMetadataInfo::MANY_TO_MANY === $mapping['type'] && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; } diff --git a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php index cb4bee8306..57dbc95ed9 100644 --- a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php +++ b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php @@ -48,7 +48,7 @@ public function transform($list) */ public function reverseTransform($string) { - if ($string === null) { + if (null === $string) { return; } diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index da19fe3124..2c85da6259 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -58,7 +58,7 @@ public function buildForHost($host) { // required by credentials below $host = strtolower($host); - if (substr($host, 0, 4) === 'www.') { + if ('www.' === substr($host, 0, 4)) { $host = substr($host, 4); } @@ -113,7 +113,7 @@ protected function processExtraFields($extraFieldsStrings) $extraFields = []; foreach ($extraFieldsStrings as $extraField) { - if (strpos($extraField, '=') === false) { + if (false === strpos($extraField, '=')) { continue; } diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 1ac7ad83c8..854acb6ae3 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -125,7 +125,7 @@ public function updatePublishedAt(Entry $entry, $value) $date = $value; // is it a timestamp? - if (filter_var($date, FILTER_VALIDATE_INT) !== false) { + if (false !== filter_var($date, FILTER_VALIDATE_INT)) { $date = '@' . $date; } diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php index e6bb03b12d..e161016194 100644 --- a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php +++ b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php @@ -16,7 +16,7 @@ class Matches { public function __invoke($subject, $pattern) { - if ($pattern[0] === "'") { + if ("'" === $pattern[0]) { $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1)); } diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php index b7f9da57f5..8e50f8d67c 100644 --- a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php +++ b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php @@ -16,7 +16,7 @@ class NotMatches { public function __invoke($subject, $pattern) { - if ($pattern[0] === "'") { + if ("'" === $pattern[0]) { $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1)); } diff --git a/src/Wallabag/CoreBundle/Operator/PHP/Matches.php b/src/Wallabag/CoreBundle/Operator/PHP/Matches.php index 987ed2a50b..bc0c3f8f76 100644 --- a/src/Wallabag/CoreBundle/Operator/PHP/Matches.php +++ b/src/Wallabag/CoreBundle/Operator/PHP/Matches.php @@ -16,6 +16,6 @@ class Matches { public function __invoke($subject, $pattern) { - return stripos($subject, $pattern) !== false; + return false !== stripos($subject, $pattern); } } diff --git a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php index 68b2676fd8..bd4d887a60 100644 --- a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php +++ b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php @@ -16,6 +16,6 @@ class NotMatches { public function __invoke($subject, $pattern) { - return stripos($subject, $pattern) === false; + return false === stripos($subject, $pattern); } } diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index cb46db09b5..58a234f46b 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -165,7 +165,7 @@ protected function parseEntries($entries) $entryToBeFlushed[] = $entry; // flush every 20 entries - if (($i % 20) === 0) { + if (0 === ($i % 20)) { $this->em->flush(); foreach ($entryToBeFlushed as $entry) { diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 780773246e..b5593180f7 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -171,7 +171,7 @@ protected function parseEntries($entries) $entryToBeFlushed[] = $entry; // flush every 20 entries - if (($i % 20) === 0) { + if (0 === ($i % 20)) { $this->em->flush(); foreach ($entryToBeFlushed as $entry) { diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index e3ba636a0c..09183abe47 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php @@ -45,7 +45,7 @@ protected function prepareEntry(array $entry = []) 'created_at' => substr($entry['date_added'], 0, 10), ]; - if (array_key_exists('tags', $entry) && $entry['tags'] !== '') { + if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index c18e7e93e6..73269fe164 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -45,7 +45,7 @@ protected function prepareEntry(array $entry = []) 'created_at' => substr($entry['dateAdded'], 0, 10), ]; - if (array_key_exists('tags', $entry) && $entry['tags'] !== '') { + if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 7d70154a66..7ab69e7a34 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -63,7 +63,7 @@ public function import() $entries = []; $handle = fopen($this->filepath, 'r'); - while (($data = fgetcsv($handle, 10240)) !== false) { + while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { continue; } @@ -80,8 +80,8 @@ public function import() 'url' => $data[0], 'title' => $data[1], 'status' => $data[3], - 'is_archived' => $data[3] === 'Archive' || $data[3] === 'Starred', - 'is_starred' => $data[3] === 'Starred', + 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3], + 'is_starred' => 'Starred' === $data[3], 'html' => false, 'tags' => $tags, ]; diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 7d38826b2a..dddb87f4e5 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -149,7 +149,7 @@ public function import($offset = 0) // - first call get 5k offset 0 // - second call get 5k offset 5k // - and so on - if (count($entries['list']) === self::NB_ELEMENTS) { + if (self::NB_ELEMENTS === count($entries['list'])) { ++$run; return $this->import(self::NB_ELEMENTS * $run); @@ -175,7 +175,7 @@ public function setClient(Client $client) */ public function parseEntry(array $importedEntry) { - $url = isset($importedEntry['resolved_url']) && $importedEntry['resolved_url'] !== '' ? $importedEntry['resolved_url'] : $importedEntry['given_url']; + $url = isset($importedEntry['resolved_url']) && '' !== $importedEntry['resolved_url'] ? $importedEntry['resolved_url'] : $importedEntry['given_url']; $existingEntry = $this->em ->getRepository('WallabagCoreBundle:Entry') @@ -194,15 +194,15 @@ public function parseEntry(array $importedEntry) $this->fetchContent($entry, $url); // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted - $entry->setArchived($importedEntry['status'] === 1 || $this->markAsRead); + $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead); // 0 or 1 - 1 If the item is starred - $entry->setStarred($importedEntry['favorite'] === 1); + $entry->setStarred(1 === $importedEntry['favorite']); $title = 'Untitled'; - if (isset($importedEntry['resolved_title']) && $importedEntry['resolved_title'] !== '') { + if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) { $title = $importedEntry['resolved_title']; - } elseif (isset($importedEntry['given_title']) && $importedEntry['given_title'] !== '') { + } elseif (isset($importedEntry['given_title']) && '' !== $importedEntry['given_title']) { $title = $importedEntry['given_title']; } diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index d585d44d3d..a35c411e45 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -61,7 +61,7 @@ protected function prepareEntry($entry = []) $data['html'] = $this->fetchingErrorMessage; } - if (array_key_exists('tags', $entry) && $entry['tags'] !== '') { + if (array_key_exists('tags', $entry) && '' !== $entry['tags']) { $data['tags'] = $entry['tags']; } From f645d371ce55e9c2a45712df34244318742b0d74 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 10 Oct 2017 10:20:57 +0200 Subject: [PATCH 3/3] Fix MondeDiplo https url --- tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 907814df3a..ca275b3276 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -1343,7 +1343,7 @@ public function testLanguageValidation($url, $expectedLanguage) */ public function testRestrictedArticle() { - $url = 'http://www.monde-diplomatique.fr/2017/05/BONNET/57475'; + $url = 'https://www.monde-diplomatique.fr/2017/05/BONNET/57475'; $this->logInAs('admin'); $client = $this->getClient(); $em = $client->getContainer()->get('doctrine.orm.entity_manager');