aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-04-12 11:36:01 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-04-12 12:25:29 +0200
commit4094ea47712efbe58624ff74daeb1f77c9b0edcf (patch)
tree3d2c168092d0208e6ba888de969252a54bf0c6c1 /src/Wallabag/ImportBundle
parent7eccbda99f16dc39ee01a0c81ab88293e9b268fd (diff)
downloadwallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.tar.gz
wallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.tar.zst
wallabag-4094ea47712efbe58624ff74daeb1f77c9b0edcf.zip
Convert array + phpDoc
Thanks for https://github.com/thomasbachem/php-short-array-syntax-converter
Diffstat (limited to 'src/Wallabag/ImportBundle')
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php12
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagController.php4
-rw-r--r--src/Wallabag/ImportBundle/Form/Type/UploadImportType.php12
-rw-r--r--src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php18
-rw-r--r--src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php12
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/ImportCompilerPassTest.php2
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php2
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php2
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php2
9 files changed, 33 insertions, 33 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php
index 11ce649d..36ee25bf 100644
--- a/src/Wallabag/ImportBundle/Controller/PocketController.php
+++ b/src/Wallabag/ImportBundle/Controller/PocketController.php
@@ -17,10 +17,10 @@ class PocketController extends Controller
17 { 17 {
18 $pocket = $this->get('wallabag_import.pocket.import'); 18 $pocket = $this->get('wallabag_import.pocket.import');
19 $form = $this->createFormBuilder($pocket) 19 $form = $this->createFormBuilder($pocket)
20 ->add('mark_as_read', CheckboxType::class, array( 20 ->add('mark_as_read', CheckboxType::class, [
21 'label' => 'import.form.mark_as_read_label', 21 'label' => 'import.form.mark_as_read_label',
22 'required' => false, 22 'required' => false,
23 )) 23 ])
24 ->getForm(); 24 ->getForm();
25 25
26 return $this->render('WallabagImportBundle:Pocket:index.html.twig', [ 26 return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
@@ -36,7 +36,7 @@ class PocketController extends Controller
36 public function authAction(Request $request) 36 public function authAction(Request $request)
37 { 37 {
38 $requestToken = $this->get('wallabag_import.pocket.import') 38 $requestToken = $this->get('wallabag_import.pocket.import')
39 ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL)); 39 ->getRequestToken($this->generateUrl('import', [], UrlGeneratorInterface::ABSOLUTE_URL));
40 40
41 if (false === $requestToken) { 41 if (false === $requestToken) {
42 $this->get('session')->getFlashBag()->add( 42 $this->get('session')->getFlashBag()->add(
@@ -51,7 +51,7 @@ class PocketController extends Controller
51 $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']); 51 $this->get('session')->set('mark_as_read', $request->request->get('form')['mark_as_read']);
52 52
53 return $this->redirect( 53 return $this->redirect(
54 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL), 54 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], UrlGeneratorInterface::ABSOLUTE_URL),
55 301 55 301
56 ); 56 );
57 } 57 }
@@ -79,10 +79,10 @@ class PocketController extends Controller
79 79
80 if (true === $pocket->setMarkAsRead($markAsRead)->import()) { 80 if (true === $pocket->setMarkAsRead($markAsRead)->import()) {
81 $summary = $pocket->getSummary(); 81 $summary = $pocket->getSummary();
82 $message = $this->get('translator')->trans('flashes.import.notice.summary', array( 82 $message = $this->get('translator')->trans('flashes.import.notice.summary', [
83 '%imported%' => $summary['imported'], 83 '%imported%' => $summary['imported'],
84 '%skipped%' => $summary['skipped'], 84 '%skipped%' => $summary['skipped'],
85 )); 85 ]);
86 } 86 }
87 87
88 $this->get('session')->getFlashBag()->add( 88 $this->get('session')->getFlashBag()->add(
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagController.php b/src/Wallabag/ImportBundle/Controller/WallabagController.php
index 01883d4a..76ced0d2 100644
--- a/src/Wallabag/ImportBundle/Controller/WallabagController.php
+++ b/src/Wallabag/ImportBundle/Controller/WallabagController.php
@@ -55,10 +55,10 @@ abstract class WallabagController extends Controller
55 55
56 if (true === $res) { 56 if (true === $res) {
57 $summary = $wallabag->getSummary(); 57 $summary = $wallabag->getSummary();
58 $message = $this->get('translator')->trans('flashes.import.notice.summary', array( 58 $message = $this->get('translator')->trans('flashes.import.notice.summary', [
59 '%imported%' => $summary['imported'], 59 '%imported%' => $summary['imported'],
60 '%skipped%' => $summary['skipped'], 60 '%skipped%' => $summary['skipped'],
61 )); 61 ]);
62 62
63 unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); 63 unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name);
64 } 64 }
diff --git a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
index e0a44c36..92a167d9 100644
--- a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
+++ b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
@@ -13,16 +13,16 @@ class UploadImportType extends AbstractType
13 public function buildForm(FormBuilderInterface $builder, array $options) 13 public function buildForm(FormBuilderInterface $builder, array $options)
14 { 14 {
15 $builder 15 $builder
16 ->add('file', FileType::class, array( 16 ->add('file', FileType::class, [
17 'label' => 'import.form.file_label', 17 'label' => 'import.form.file_label',
18 )) 18 ])
19 ->add('mark_as_read', CheckboxType::class, array( 19 ->add('mark_as_read', CheckboxType::class, [
20 'label' => 'import.form.mark_as_read_label', 20 'label' => 'import.form.mark_as_read_label',
21 'required' => false, 21 'required' => false,
22 )) 22 ])
23 ->add('save', SubmitType::class, array( 23 ->add('save', SubmitType::class, [
24 'label' => 'import.form.save_label', 24 'label' => 'import.form.save_label',
25 )) 25 ])
26 ; 26 ;
27 } 27 }
28 28
diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php
index 8d353a71..f7de3fef 100644
--- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV1ControllerTest.php
@@ -29,9 +29,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
29 29
30 $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json'); 30 $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1.json', 'wallabag-v1.json');
31 31
32 $data = array( 32 $data = [
33 'upload_import_file[file]' => $file, 33 'upload_import_file[file]' => $file,
34 ); 34 ];
35 35
36 $client->submit($form, $data); 36 $client->submit($form, $data);
37 37
@@ -54,7 +54,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
54 54
55 $this->assertTrue($content->getTags()->contains($tag)); 55 $this->assertTrue($content->getTags()->contains($tag));
56 56
57 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); 57 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
58 $this->assertContains('flashes.import.notice.summary', $body[0]); 58 $this->assertContains('flashes.import.notice.summary', $body[0]);
59 } 59 }
60 60
@@ -68,10 +68,10 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
68 68
69 $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json'); 69 $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v1-read.json', 'wallabag-v1-read.json');
70 70
71 $data = array( 71 $data = [
72 'upload_import_file[file]' => $file, 72 'upload_import_file[file]' => $file,
73 'upload_import_file[mark_as_read]' => 1, 73 'upload_import_file[mark_as_read]' => 1,
74 ); 74 ];
75 75
76 $client->submit($form, $data); 76 $client->submit($form, $data);
77 77
@@ -99,7 +99,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
99 99
100 $this->assertTrue($content2->isArchived()); 100 $this->assertTrue($content2->isArchived());
101 101
102 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); 102 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
103 $this->assertContains('flashes.import.notice.summary', $body[0]); 103 $this->assertContains('flashes.import.notice.summary', $body[0]);
104 } 104 }
105 105
@@ -113,9 +113,9 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
113 113
114 $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); 114 $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt');
115 115
116 $data = array( 116 $data = [
117 'upload_import_file[file]' => $file, 117 'upload_import_file[file]' => $file,
118 ); 118 ];
119 119
120 $client->submit($form, $data); 120 $client->submit($form, $data);
121 121
@@ -123,7 +123,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
123 123
124 $crawler = $client->followRedirect(); 124 $crawler = $client->followRedirect();
125 125
126 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); 126 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
127 $this->assertContains('flashes.import.notice.failed', $body[0]); 127 $this->assertContains('flashes.import.notice.failed', $body[0]);
128 } 128 }
129} 129}
diff --git a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php
index 490f9ede..15251ae7 100644
--- a/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Controller/WallabagV2ControllerTest.php
@@ -29,9 +29,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
29 29
30 $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json'); 30 $file = new UploadedFile(__DIR__.'/../fixtures/wallabag-v2.json', 'wallabag-v2.json');
31 31
32 $data = array( 32 $data = [
33 'upload_import_file[file]' => $file, 33 'upload_import_file[file]' => $file,
34 ); 34 ];
35 35
36 $client->submit($form, $data); 36 $client->submit($form, $data);
37 37
@@ -39,7 +39,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
39 39
40 $crawler = $client->followRedirect(); 40 $crawler = $client->followRedirect();
41 41
42 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); 42 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
43 $this->assertContains('flashes.import.notice.summary', $body[0]); 43 $this->assertContains('flashes.import.notice.summary', $body[0]);
44 44
45 $content = $client->getContainer() 45 $content = $client->getContainer()
@@ -79,9 +79,9 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
79 79
80 $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt'); 80 $file = new UploadedFile(__DIR__.'/../fixtures/test.txt', 'test.txt');
81 81
82 $data = array( 82 $data = [
83 'upload_import_file[file]' => $file, 83 'upload_import_file[file]' => $file,
84 ); 84 ];
85 85
86 $client->submit($form, $data); 86 $client->submit($form, $data);
87 87
@@ -89,7 +89,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
89 89
90 $crawler = $client->followRedirect(); 90 $crawler = $client->followRedirect();
91 91
92 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(array('_text'))); 92 $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
93 $this->assertContains('flashes.import.notice.failed', $body[0]); 93 $this->assertContains('flashes.import.notice.failed', $body[0]);
94 } 94 }
95} 95}
diff --git a/src/Wallabag/ImportBundle/Tests/Import/ImportCompilerPassTest.php b/src/Wallabag/ImportBundle/Tests/Import/ImportCompilerPassTest.php
index bd62ab3b..b22fcfbc 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/ImportCompilerPassTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/ImportCompilerPassTest.php
@@ -25,7 +25,7 @@ class ImportCompilerPassTest extends \PHPUnit_Framework_TestCase
25 25
26 $container 26 $container
27 ->register('foo') 27 ->register('foo')
28 ->addTag('wallabag_import.import', array('alias' => 'pocket')) 28 ->addTag('wallabag_import.import', ['alias' => 'pocket'])
29 ; 29 ;
30 30
31 $this->process($container); 31 $this->process($container);
diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
index 43b60ec3..cb171572 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
@@ -73,7 +73,7 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
73 ); 73 );
74 74
75 $this->logHandler = new TestHandler(); 75 $this->logHandler = new TestHandler();
76 $logger = new Logger('test', array($this->logHandler)); 76 $logger = new Logger('test', [$this->logHandler]);
77 $pocket->setLogger($logger); 77 $pocket->setLogger($logger);
78 78
79 return $pocket; 79 return $pocket;
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
index 3ef852e5..8c967e1b 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV1ImportTest.php
@@ -30,7 +30,7 @@ class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase
30 $wallabag = new WallabagV1Import($this->em, $this->contentProxy); 30 $wallabag = new WallabagV1Import($this->em, $this->contentProxy);
31 31
32 $this->logHandler = new TestHandler(); 32 $this->logHandler = new TestHandler();
33 $logger = new Logger('test', array($this->logHandler)); 33 $logger = new Logger('test', [$this->logHandler]);
34 $wallabag->setLogger($logger); 34 $wallabag->setLogger($logger);
35 35
36 if (false === $unsetUser) { 36 if (false === $unsetUser) {
diff --git a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
index dbefdee3..b0667c9a 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/WallabagV2ImportTest.php
@@ -30,7 +30,7 @@ class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase
30 $wallabag = new WallabagV2Import($this->em, $this->contentProxy); 30 $wallabag = new WallabagV2Import($this->em, $this->contentProxy);
31 31
32 $this->logHandler = new TestHandler(); 32 $this->logHandler = new TestHandler();
33 $logger = new Logger('test', array($this->logHandler)); 33 $logger = new Logger('test', [$this->logHandler]);
34 $wallabag->setLogger($logger); 34 $wallabag->setLogger($logger);
35 35
36 if (false === $unsetUser) { 36 if (false === $unsetUser) {