aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-05-30 13:52:26 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-05-30 13:59:33 +0200
commit4346a86068781f4acdeb574d7e2af08b77b58ea7 (patch)
tree5c392314913f7cbcd2658893432ff5f9db318465 /src/Wallabag
parent399bd777d7900f532bfcfa367da88767739391bc (diff)
downloadwallabag-4346a86068781f4acdeb574d7e2af08b77b58ea7.tar.gz
wallabag-4346a86068781f4acdeb574d7e2af08b77b58ea7.tar.zst
wallabag-4346a86068781f4acdeb574d7e2af08b77b58ea7.zip
CS
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php38
-rw-r--r--src/Wallabag/ApiBundle/DependencyInjection/Configuration.php2
-rw-r--r--src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php9
-rw-r--r--src/Wallabag/ApiBundle/Security/Authentication/Token/WsseUserToken.php1
-rw-r--r--src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php8
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php10
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php16
-rw-r--r--src/Wallabag/CoreBundle/Controller/RssController.php6
-rw-r--r--src/Wallabag/CoreBundle/Controller/SecurityController.php9
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php8
-rw-r--r--src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php8
-rw-r--r--src/Wallabag/CoreBundle/Entity/Config.php56
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php55
-rw-r--r--src/Wallabag/CoreBundle/Entity/Tag.php15
-rw-r--r--src/Wallabag/CoreBundle/Entity/User.php60
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ConfigType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EntryType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewUserType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/RssType.php1
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/UserInformationType.php1
-rwxr-xr-xsrc/Wallabag/CoreBundle/Helper/Tools.php12
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php8
-rw-r--r--src/Wallabag/CoreBundle/Repository/UserRepository.php2
-rw-r--r--src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php3
-rw-r--r--src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php2
-rw-r--r--src/Wallabag/CoreBundle/Service/Extractor.php23
-rw-r--r--src/Wallabag/CoreBundle/Tools/Utils.php2
-rw-r--r--src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php6
31 files changed, 204 insertions, 163 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 21e4552d..2f5923c8 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -47,6 +47,7 @@ class WallabagRestController extends Controller
47 * {"name"="username", "dataType"="string", "required"=true, "description"="username"} 47 * {"name"="username", "dataType"="string", "required"=true, "description"="username"}
48 * } 48 * }
49 * ) 49 * )
50 *
50 * @return array 51 * @return array
51 */ 52 */
52 public function getSaltAction($username) 53 public function getSaltAction($username)
@@ -77,6 +78,7 @@ class WallabagRestController extends Controller
77 * {"name"="tags", "dataType"="string", "required"=false, "format"="api%2Crest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."}, 78 * {"name"="tags", "dataType"="string", "required"=false, "format"="api%2Crest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."},
78 * } 79 * }
79 * ) 80 * )
81 *
80 * @return Entry 82 * @return Entry
81 */ 83 */
82 public function getEntriesAction(Request $request) 84 public function getEntriesAction(Request $request)
@@ -109,13 +111,14 @@ class WallabagRestController extends Controller
109 } 111 }
110 112
111 /** 113 /**
112 * Retrieve a single entry 114 * Retrieve a single entry.
113 * 115 *
114 * @ApiDoc( 116 * @ApiDoc(
115 * requirements={ 117 * requirements={
116 * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} 118 * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
117 * } 119 * }
118 * ) 120 * )
121 *
119 * @return Entry 122 * @return Entry
120 */ 123 */
121 public function getEntryAction(Entry $entry) 124 public function getEntryAction(Entry $entry)
@@ -128,7 +131,7 @@ class WallabagRestController extends Controller
128 } 131 }
129 132
130 /** 133 /**
131 * Create an entry 134 * Create an entry.
132 * 135 *
133 * @ApiDoc( 136 * @ApiDoc(
134 * parameters={ 137 * parameters={
@@ -137,6 +140,7 @@ class WallabagRestController extends Controller
137 * {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."}, 140 * {"name"="tags", "dataType"="string", "required"=false, "format"="tag1,tag2,tag3", "description"="a comma-separated list of tags."},
138 * } 141 * }
139 * ) 142 * )
143 *
140 * @return Entry 144 * @return Entry
141 */ 145 */
142 public function postEntriesAction(Request $request) 146 public function postEntriesAction(Request $request)
@@ -164,7 +168,7 @@ class WallabagRestController extends Controller
164 } 168 }
165 169
166 /** 170 /**
167 * Change several properties of an entry 171 * Change several properties of an entry.
168 * 172 *
169 * @ApiDoc( 173 * @ApiDoc(
170 * requirements={ 174 * requirements={
@@ -177,15 +181,16 @@ class WallabagRestController extends Controller
177 * {"name"="star", "dataType"="boolean", "required"=false, "format"="true or false", "description"="starred the entry."}, 181 * {"name"="star", "dataType"="boolean", "required"=false, "format"="true or false", "description"="starred the entry."},
178 * } 182 * }
179 * ) 183 * )
184 *
180 * @return Entry 185 * @return Entry
181 */ 186 */
182 public function patchEntriesAction(Entry $entry, Request $request) 187 public function patchEntriesAction(Entry $entry, Request $request)
183 { 188 {
184 $this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId()); 189 $this->validateUserAccess($entry->getUser()->getId(), $this->getUser()->getId());
185 190
186 $title = $request->request->get("title"); 191 $title = $request->request->get('title');
187 $isArchived = $request->request->get("archive"); 192 $isArchived = $request->request->get('archive');
188 $isStarred = $request->request->get("star"); 193 $isStarred = $request->request->get('star');
189 194
190 if (!is_null($title)) { 195 if (!is_null($title)) {
191 $entry->setTitle($title); 196 $entry->setTitle($title);
@@ -213,13 +218,14 @@ class WallabagRestController extends Controller
213 } 218 }
214 219
215 /** 220 /**
216 * Delete **permanently** an entry 221 * Delete **permanently** an entry.
217 * 222 *
218 * @ApiDoc( 223 * @ApiDoc(
219 * requirements={ 224 * requirements={
220 * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"} 225 * {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
221 * } 226 * }
222 * ) 227 * )
228 *
223 * @return Entry 229 * @return Entry
224 */ 230 */
225 public function deleteEntriesAction(Entry $entry) 231 public function deleteEntriesAction(Entry $entry)
@@ -236,7 +242,7 @@ class WallabagRestController extends Controller
236 } 242 }
237 243
238 /** 244 /**
239 * Retrieve all tags for an entry 245 * Retrieve all tags for an entry.
240 * 246 *
241 * @ApiDoc( 247 * @ApiDoc(
242 * requirements={ 248 * requirements={
@@ -254,7 +260,7 @@ class WallabagRestController extends Controller
254 } 260 }
255 261
256 /** 262 /**
257 * Add one or more tags to an entry 263 * Add one or more tags to an entry.
258 * 264 *
259 * @ApiDoc( 265 * @ApiDoc(
260 * requirements={ 266 * requirements={
@@ -284,7 +290,7 @@ class WallabagRestController extends Controller
284 } 290 }
285 291
286 /** 292 /**
287 * Permanently remove one tag for an entry 293 * Permanently remove one tag for an entry.
288 * 294 *
289 * @ApiDoc( 295 * @ApiDoc(
290 * requirements={ 296 * requirements={
@@ -308,7 +314,7 @@ class WallabagRestController extends Controller
308 } 314 }
309 315
310 /** 316 /**
311 * Retrieve all tags 317 * Retrieve all tags.
312 * 318 *
313 * @ApiDoc() 319 * @ApiDoc()
314 */ 320 */
@@ -320,7 +326,7 @@ class WallabagRestController extends Controller
320 } 326 }
321 327
322 /** 328 /**
323 * Permanently remove one tag from **every** entry 329 * Permanently remove one tag from **every** entry.
324 * 330 *
325 * @ApiDoc( 331 * @ApiDoc(
326 * requirements={ 332 * requirements={
@@ -343,10 +349,10 @@ class WallabagRestController extends Controller
343 349
344 /** 350 /**
345 * Validate that the first id is equal to the second one. 351 * Validate that the first id is equal to the second one.
346 * If not, throw exception. It means a user try to access information from an other user 352 * If not, throw exception. It means a user try to access information from an other user.
347 * 353 *
348 * @param integer $requestUserId User id from the requested source 354 * @param int $requestUserId User id from the requested source
349 * @param integer $currentUserId User id from the retrieved source 355 * @param int $currentUserId User id from the retrieved source
350 */ 356 */
351 private function validateUserAccess($requestUserId, $currentUserId) 357 private function validateUserAccess($requestUserId, $currentUserId)
352 { 358 {
@@ -357,7 +363,7 @@ class WallabagRestController extends Controller
357 363
358 /** 364 /**
359 * Send a JSON Response. 365 * Send a JSON Response.
360 * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string 366 * We don't use the Symfony JsonRespone, because it takes an array as parameter instead of a JSON string.
361 * 367 *
362 * @param string $json 368 * @param string $json
363 * 369 *
diff --git a/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php b/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php
index 80a07ca2..cec45412 100644
--- a/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php
@@ -6,7 +6,7 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6use Symfony\Component\Config\Definition\ConfigurationInterface; 6use Symfony\Component\Config\Definition\ConfigurationInterface;
7 7
8/** 8/**
9 * This is the class that validates and merges configuration from your app/config files 9 * This is the class that validates and merges configuration from your app/config files.
10 * 10 *
11 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} 11 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12 */ 12 */
diff --git a/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php b/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php
index 8e49167a..db73ae2a 100644
--- a/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php
+++ b/src/Wallabag/ApiBundle/Security/Authentication/Provider/WsseProvider.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\ApiBundle\Security\Authentication\Provider; 3namespace Wallabag\ApiBundle\Security\Authentication\Provider;
3 4
4use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; 5use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
@@ -29,7 +30,7 @@ class WsseProvider implements AuthenticationProviderInterface
29 $user = $this->userProvider->loadUserByUsername($token->getUsername()); 30 $user = $this->userProvider->loadUserByUsername($token->getUsername());
30 31
31 if (!$user) { 32 if (!$user) {
32 throw new AuthenticationException("Bad credentials. Did you forgot your username?"); 33 throw new AuthenticationException('Bad credentials. Did you forgot your username?');
33 } 34 }
34 35
35 if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) { 36 if ($user && $this->validateDigest($token->digest, $token->nonce, $token->created, $user->getPassword())) {
@@ -46,12 +47,12 @@ class WsseProvider implements AuthenticationProviderInterface
46 { 47 {
47 // Check created time is not in the future 48 // Check created time is not in the future
48 if (strtotime($created) > time()) { 49 if (strtotime($created) > time()) {
49 throw new AuthenticationException("Back to the future..."); 50 throw new AuthenticationException('Back to the future...');
50 } 51 }
51 52
52 // Expire timestamp after 5 minutes 53 // Expire timestamp after 5 minutes
53 if (time() - strtotime($created) > 300) { 54 if (time() - strtotime($created) > 300) {
54 throw new AuthenticationException("Too late for this timestamp... Watch your watch."); 55 throw new AuthenticationException('Too late for this timestamp... Watch your watch.');
55 } 56 }
56 57
57 // Validate nonce is unique within 5 minutes 58 // Validate nonce is unique within 5 minutes
@@ -65,7 +66,7 @@ class WsseProvider implements AuthenticationProviderInterface
65 $expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true)); 66 $expected = base64_encode(sha1(base64_decode($nonce).$created.$secret, true));
66 67
67 if ($digest !== $expected) { 68 if ($digest !== $expected) {
68 throw new AuthenticationException("Bad credentials ! Digest is not as expected."); 69 throw new AuthenticationException('Bad credentials ! Digest is not as expected.');
69 } 70 }
70 71
71 return $digest === $expected; 72 return $digest === $expected;
diff --git a/src/Wallabag/ApiBundle/Security/Authentication/Token/WsseUserToken.php b/src/Wallabag/ApiBundle/Security/Authentication/Token/WsseUserToken.php
index aa68dbdc..e6d30224 100644
--- a/src/Wallabag/ApiBundle/Security/Authentication/Token/WsseUserToken.php
+++ b/src/Wallabag/ApiBundle/Security/Authentication/Token/WsseUserToken.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\ApiBundle\Security\Authentication\Token; 3namespace Wallabag\ApiBundle\Security\Authentication\Token;
3 4
4use Symfony\Component\Security\Core\Authentication\Token\AbstractToken; 5use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
index b36ae7c6..86c8de1e 100644
--- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -9,7 +9,7 @@ class WallabagRestControllerTest extends WebTestCase
9 protected static $salt; 9 protected static $salt;
10 10
11 /** 11 /**
12 * Grab the salt once and store it to be available for all tests 12 * Grab the salt once and store it to be available for all tests.
13 */ 13 */
14 public static function setUpBeforeClass() 14 public static function setUpBeforeClass()
15 { 15 {
@@ -24,7 +24,7 @@ class WallabagRestControllerTest extends WebTestCase
24 } 24 }
25 25
26 /** 26 /**
27 * Generate HTTP headers for authenticate user on API 27 * Generate HTTP headers for authenticate user on API.
28 * 28 *
29 * @param string $username 29 * @param string $username
30 * @param string $password 30 * @param string $password
@@ -327,7 +327,7 @@ class WallabagRestControllerTest extends WebTestCase
327 $content = json_decode($client->getResponse()->getContent(), true); 327 $content = json_decode($client->getResponse()->getContent(), true);
328 328
329 $this->assertArrayHasKey('tags', $content); 329 $this->assertArrayHasKey('tags', $content);
330 $this->assertEquals($nbTags+3, count($content['tags'])); 330 $this->assertEquals($nbTags + 3, count($content['tags']));
331 331
332 $entryDB = $client->getContainer() 332 $entryDB = $client->getContainer()
333 ->get('doctrine.orm.entity_manager') 333 ->get('doctrine.orm.entity_manager')
@@ -369,7 +369,7 @@ class WallabagRestControllerTest extends WebTestCase
369 $content = json_decode($client->getResponse()->getContent(), true); 369 $content = json_decode($client->getResponse()->getContent(), true);
370 370
371 $this->assertArrayHasKey('tags', $content); 371 $this->assertArrayHasKey('tags', $content);
372 $this->assertEquals($nbTags-1, count($content['tags'])); 372 $this->assertEquals($nbTags - 1, count($content['tags']));
373 } 373 }
374 374
375 public function testGetUserTags() 375 public function testGetUserTags()
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index 493842f7..491c67f9 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -225,7 +225,7 @@ class InstallCommand extends ContainerAwareCommand
225 } 225 }
226 226
227 /** 227 /**
228 * Run a command 228 * Run a command.
229 * 229 *
230 * @param string $command 230 * @param string $command
231 * @param array $parameters Parameters to this command (usually 'force' => true) 231 * @param array $parameters Parameters to this command (usually 'force' => true)
@@ -266,9 +266,9 @@ class InstallCommand extends ContainerAwareCommand
266 } 266 }
267 267
268 /** 268 /**
269 * Check if the database already exists 269 * Check if the database already exists.
270 * 270 *
271 * @return boolean 271 * @return bool
272 */ 272 */
273 private function isDatabasePresent() 273 private function isDatabasePresent()
274 { 274 {
@@ -300,9 +300,9 @@ class InstallCommand extends ContainerAwareCommand
300 300
301 /** 301 /**
302 * Check if the schema is already created. 302 * Check if the schema is already created.
303 * If we found at least oen table, it means the schema exists 303 * If we found at least oen table, it means the schema exists.
304 * 304 *
305 * @return boolean 305 * @return bool
306 */ 306 */
307 private function isSchemaPresent() 307 private function isSchemaPresent()
308 { 308 {
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 8a8f3cd7..7fd982c9 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -50,7 +50,7 @@ class EntryController extends Controller
50 } 50 }
51 51
52 /** 52 /**
53 * Shows unread entries for current user 53 * Shows unread entries for current user.
54 * 54 *
55 * @Route("/unread", name="unread") 55 * @Route("/unread", name="unread")
56 * 56 *
@@ -70,7 +70,7 @@ class EntryController extends Controller
70 } 70 }
71 71
72 /** 72 /**
73 * Shows read entries for current user 73 * Shows read entries for current user.
74 * 74 *
75 * @Route("/archive", name="archive") 75 * @Route("/archive", name="archive")
76 * 76 *
@@ -90,7 +90,7 @@ class EntryController extends Controller
90 } 90 }
91 91
92 /** 92 /**
93 * Shows starred entries for current user 93 * Shows starred entries for current user.
94 * 94 *
95 * @Route("/starred", name="starred") 95 * @Route("/starred", name="starred")
96 * 96 *
@@ -110,7 +110,7 @@ class EntryController extends Controller
110 } 110 }
111 111
112 /** 112 /**
113 * Shows entry content 113 * Shows entry content.
114 * 114 *
115 * @param Entry $entry 115 * @param Entry $entry
116 * 116 *
@@ -129,7 +129,7 @@ class EntryController extends Controller
129 } 129 }
130 130
131 /** 131 /**
132 * Changes read status for an entry 132 * Changes read status for an entry.
133 * 133 *
134 * @param Request $request 134 * @param Request $request
135 * @param Entry $entry 135 * @param Entry $entry
@@ -154,7 +154,7 @@ class EntryController extends Controller
154 } 154 }
155 155
156 /** 156 /**
157 * Changes favorite status for an entry 157 * Changes favorite status for an entry.
158 * 158 *
159 * @param Request $request 159 * @param Request $request
160 * @param Entry $entry 160 * @param Entry $entry
@@ -179,7 +179,7 @@ class EntryController extends Controller
179 } 179 }
180 180
181 /** 181 /**
182 * Deletes entry 182 * Deletes entry.
183 * 183 *
184 * @param Request $request 184 * @param Request $request
185 * @param Entry $entry 185 * @param Entry $entry
@@ -205,7 +205,7 @@ class EntryController extends Controller
205 } 205 }
206 206
207 /** 207 /**
208 * Check if the logged user can manage the given entry 208 * Check if the logged user can manage the given entry.
209 * 209 *
210 * @param Entry $entry 210 * @param Entry $entry
211 */ 211 */
diff --git a/src/Wallabag/CoreBundle/Controller/RssController.php b/src/Wallabag/CoreBundle/Controller/RssController.php
index 14f1dcb2..86754e15 100644
--- a/src/Wallabag/CoreBundle/Controller/RssController.php
+++ b/src/Wallabag/CoreBundle/Controller/RssController.php
@@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Entity\Entry;
11class RssController extends Controller 11class RssController extends Controller
12{ 12{
13 /** 13 /**
14 * Shows unread entries for current user 14 * Shows unread entries for current user.
15 * 15 *
16 * @Route("/{username}/{token}/unread.xml", name="unread_rss", defaults={"_format"="xml"}) 16 * @Route("/{username}/{token}/unread.xml", name="unread_rss", defaults={"_format"="xml"})
17 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter") 17 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
@@ -35,7 +35,7 @@ class RssController extends Controller
35 } 35 }
36 36
37 /** 37 /**
38 * Shows read entries for current user 38 * Shows read entries for current user.
39 * 39 *
40 * @Route("/{username}/{token}/archive.xml", name="archive_rss") 40 * @Route("/{username}/{token}/archive.xml", name="archive_rss")
41 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter") 41 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
@@ -59,7 +59,7 @@ class RssController extends Controller
59 } 59 }
60 60
61 /** 61 /**
62 * Shows starred entries for current user 62 * Shows starred entries for current user.
63 * 63 *
64 * @Route("/{username}/{token}/starred.xml", name="starred_rss") 64 * @Route("/{username}/{token}/starred.xml", name="starred_rss")
65 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter") 65 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
diff --git a/src/Wallabag/CoreBundle/Controller/SecurityController.php b/src/Wallabag/CoreBundle/Controller/SecurityController.php
index fe511db5..a61a898b 100644
--- a/src/Wallabag/CoreBundle/Controller/SecurityController.php
+++ b/src/Wallabag/CoreBundle/Controller/SecurityController.php
@@ -30,9 +30,10 @@ class SecurityController extends Controller
30 } 30 }
31 31
32 /** 32 /**
33 * Request forgot password: show form 33 * Request forgot password: show form.
34 * 34 *
35 * @Route("/forgot-password", name="forgot_password") 35 * @Route("/forgot-password", name="forgot_password")
36 *
36 * @Method({"GET", "POST"}) 37 * @Method({"GET", "POST"})
37 */ 38 */
38 public function forgotPasswordAction(Request $request) 39 public function forgotPasswordAction(Request $request)
@@ -73,9 +74,10 @@ class SecurityController extends Controller
73 } 74 }
74 75
75 /** 76 /**
76 * Tell the user to check his email provider 77 * Tell the user to check his email provider.
77 * 78 *
78 * @Route("/forgot-password/check-email", name="forgot_password_check_email") 79 * @Route("/forgot-password/check-email", name="forgot_password_check_email")
80 *
79 * @Method({"GET"}) 81 * @Method({"GET"})
80 */ 82 */
81 public function checkEmailAction(Request $request) 83 public function checkEmailAction(Request $request)
@@ -93,9 +95,10 @@ class SecurityController extends Controller
93 } 95 }
94 96
95 /** 97 /**
96 * Reset user password 98 * Reset user password.
97 * 99 *
98 * @Route("/forgot-password/{token}", name="forgot_password_reset") 100 * @Route("/forgot-password/{token}", name="forgot_password_reset")
101 *
99 * @Method({"GET", "POST"}) 102 * @Method({"GET", "POST"})
100 */ 103 */
101 public function resetAction(Request $request, $token) 104 public function resetAction(Request $request, $token)
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
index 54d0d6b6..547d6753 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
@@ -39,9 +39,9 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
39 $entry3->setContent('This is my content /o/'); 39 $entry3->setContent('This is my content /o/');
40 40
41 $tag1 = new Tag($this->getReference('bob-user')); 41 $tag1 = new Tag($this->getReference('bob-user'));
42 $tag1->setLabel("foo"); 42 $tag1->setLabel('foo');
43 $tag2 = new Tag($this->getReference('bob-user')); 43 $tag2 = new Tag($this->getReference('bob-user'));
44 $tag2->setLabel("bar"); 44 $tag2->setLabel('bar');
45 45
46 $entry3->addTag($tag1); 46 $entry3->addTag($tag1);
47 $entry3->addTag($tag2); 47 $entry3->addTag($tag2);
@@ -56,9 +56,9 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
56 $entry4->setContent('This is my content /o/'); 56 $entry4->setContent('This is my content /o/');
57 57
58 $tag1 = new Tag($this->getReference('admin-user')); 58 $tag1 = new Tag($this->getReference('admin-user'));
59 $tag1->setLabel("foo"); 59 $tag1->setLabel('foo');
60 $tag2 = new Tag($this->getReference('admin-user')); 60 $tag2 = new Tag($this->getReference('admin-user'));
61 $tag2->setLabel("bar"); 61 $tag2->setLabel('bar');
62 62
63 $entry4->addTag($tag1); 63 $entry4->addTag($tag1);
64 $entry4->addTag($tag2); 64 $entry4->addTag($tag2);
diff --git a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php
index 724812fd..509348db 100644
--- a/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php
+++ b/src/Wallabag/CoreBundle/Doctrine/Mapping/PrefixedNamingStrategy.php
@@ -25,7 +25,7 @@ class PrefixedNamingStrategy implements NamingStrategy
25 */ 25 */
26 public function classToTableName($className) 26 public function classToTableName($className)
27 { 27 {
28 return strtolower($this->prefix . substr($className, strrpos($className, '\\') + 1)); 28 return strtolower($this->prefix.substr($className, strrpos($className, '\\') + 1));
29 } 29 }
30 30
31 /** 31 /**
@@ -49,7 +49,7 @@ class PrefixedNamingStrategy implements NamingStrategy
49 */ 49 */
50 public function joinColumnName($propertyName) 50 public function joinColumnName($propertyName)
51 { 51 {
52 return $propertyName . '_' . $this->referenceColumnName(); 52 return $propertyName.'_'.$this->referenceColumnName();
53 } 53 }
54 54
55 /** 55 /**
@@ -62,7 +62,7 @@ class PrefixedNamingStrategy implements NamingStrategy
62 // ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag" 62 // ie: not "wallabag_entry_wallabag_tag" but "wallabag_entry_tag"
63 $target = substr($targetEntity, strrpos($targetEntity, '\\') + 1); 63 $target = substr($targetEntity, strrpos($targetEntity, '\\') + 1);
64 64
65 return strtolower($this->classToTableName($sourceEntity) . '_' .$target); 65 return strtolower($this->classToTableName($sourceEntity).'_'.$target);
66 } 66 }
67 67
68 /** 68 /**
@@ -70,7 +70,7 @@ class PrefixedNamingStrategy implements NamingStrategy
70 */ 70 */
71 public function joinKeyColumnName($entityName, $referencedColumnName = null) 71 public function joinKeyColumnName($entityName, $referencedColumnName = null)
72 { 72 {
73 return strtolower($this->classToTableName($entityName) . '_' .($referencedColumnName ?: $this->referenceColumnName())); 73 return strtolower($this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName()));
74 } 74 }
75 75
76 /** 76 /**
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php
index 62ea637e..025d94ef 100644
--- a/src/Wallabag/CoreBundle/Entity/Config.php
+++ b/src/Wallabag/CoreBundle/Entity/Config.php
@@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM;
6use Symfony\Component\Validator\Constraints as Assert; 6use Symfony\Component\Validator\Constraints as Assert;
7 7
8/** 8/**
9 * Config 9 * Config.
10 * 10 *
11 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository") 11 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
12 * @ORM\Table 12 * @ORM\Table
@@ -15,7 +15,7 @@ use Symfony\Component\Validator\Constraints as Assert;
15class Config 15class Config
16{ 16{
17 /** 17 /**
18 * @var integer 18 * @var int
19 * 19 *
20 * @ORM\Column(name="id", type="integer") 20 * @ORM\Column(name="id", type="integer")
21 * @ORM\Id 21 * @ORM\Id
@@ -32,7 +32,7 @@ class Config
32 private $theme; 32 private $theme;
33 33
34 /** 34 /**
35 * @var integer 35 * @var int
36 * 36 *
37 * @Assert\NotBlank() 37 * @Assert\NotBlank()
38 * @Assert\Range( 38 * @Assert\Range(
@@ -60,7 +60,7 @@ class Config
60 private $rssToken; 60 private $rssToken;
61 61
62 /** 62 /**
63 * @var integer 63 * @var int
64 * 64 *
65 * @ORM\Column(name="rss_limit", type="integer", nullable=true) 65 * @ORM\Column(name="rss_limit", type="integer", nullable=true)
66 * @Assert\Range( 66 * @Assert\Range(
@@ -85,9 +85,9 @@ class Config
85 } 85 }
86 86
87 /** 87 /**
88 * Get id 88 * Get id.
89 * 89 *
90 * @return integer 90 * @return int
91 */ 91 */
92 public function getId() 92 public function getId()
93 { 93 {
@@ -95,9 +95,10 @@ class Config
95 } 95 }
96 96
97 /** 97 /**
98 * Set theme 98 * Set theme.
99 *
100 * @param string $theme
99 * 101 *
100 * @param string $theme
101 * @return Config 102 * @return Config
102 */ 103 */
103 public function setTheme($theme) 104 public function setTheme($theme)
@@ -108,7 +109,7 @@ class Config
108 } 109 }
109 110
110 /** 111 /**
111 * Get theme 112 * Get theme.
112 * 113 *
113 * @return string 114 * @return string
114 */ 115 */
@@ -118,9 +119,10 @@ class Config
118 } 119 }
119 120
120 /** 121 /**
121 * Set itemsPerPage 122 * Set itemsPerPage.
123 *
124 * @param int $itemsPerPage
122 * 125 *
123 * @param integer $itemsPerPage
124 * @return Config 126 * @return Config
125 */ 127 */
126 public function setItemsPerPage($itemsPerPage) 128 public function setItemsPerPage($itemsPerPage)
@@ -131,9 +133,9 @@ class Config
131 } 133 }
132 134
133 /** 135 /**
134 * Get itemsPerPage 136 * Get itemsPerPage.
135 * 137 *
136 * @return integer 138 * @return int
137 */ 139 */
138 public function getItemsPerPage() 140 public function getItemsPerPage()
139 { 141 {
@@ -141,9 +143,10 @@ class Config
141 } 143 }
142 144
143 /** 145 /**
144 * Set language 146 * Set language.
147 *
148 * @param string $language
145 * 149 *
146 * @param string $language
147 * @return Config 150 * @return Config
148 */ 151 */
149 public function setLanguage($language) 152 public function setLanguage($language)
@@ -154,7 +157,7 @@ class Config
154 } 157 }
155 158
156 /** 159 /**
157 * Get language 160 * Get language.
158 * 161 *
159 * @return string 162 * @return string
160 */ 163 */
@@ -164,9 +167,10 @@ class Config
164 } 167 }
165 168
166 /** 169 /**
167 * Set user 170 * Set user.
171 *
172 * @param \Wallabag\CoreBundle\Entity\User $user
168 * 173 *
169 * @param \Wallabag\CoreBundle\Entity\User $user
170 * @return Config 174 * @return Config
171 */ 175 */
172 public function setUser(\Wallabag\CoreBundle\Entity\User $user = null) 176 public function setUser(\Wallabag\CoreBundle\Entity\User $user = null)
@@ -177,7 +181,7 @@ class Config
177 } 181 }
178 182
179 /** 183 /**
180 * Get user 184 * Get user.
181 * 185 *
182 * @return \Wallabag\CoreBundle\Entity\User 186 * @return \Wallabag\CoreBundle\Entity\User
183 */ 187 */
@@ -187,9 +191,10 @@ class Config
187 } 191 }
188 192
189 /** 193 /**
190 * Set rssToken 194 * Set rssToken.
195 *
196 * @param string $rssToken
191 * 197 *
192 * @param string $rssToken
193 * @return Config 198 * @return Config
194 */ 199 */
195 public function setRssToken($rssToken) 200 public function setRssToken($rssToken)
@@ -200,7 +205,7 @@ class Config
200 } 205 }
201 206
202 /** 207 /**
203 * Get rssToken 208 * Get rssToken.
204 * 209 *
205 * @return string 210 * @return string
206 */ 211 */
@@ -210,9 +215,10 @@ class Config
210 } 215 }
211 216
212 /** 217 /**
213 * Set rssLimit 218 * Set rssLimit.
219 *
220 * @param string $rssLimit
214 * 221 *
215 * @param string $rssLimit
216 * @return Config 222 * @return Config
217 */ 223 */
218 public function setRssLimit($rssLimit) 224 public function setRssLimit($rssLimit)
@@ -223,7 +229,7 @@ class Config
223 } 229 }
224 230
225 /** 231 /**
226 * Get rssLimit 232 * Get rssLimit.
227 * 233 *
228 * @return string 234 * @return string
229 */ 235 */
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 15af105d..b1998ab6 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -9,7 +9,7 @@ use Hateoas\Configuration\Annotation as Hateoas;
9use JMS\Serializer\Annotation\XmlRoot; 9use JMS\Serializer\Annotation\XmlRoot;
10 10
11/** 11/**
12 * Entry 12 * Entry.
13 * 13 *
14 * @XmlRoot("entry") 14 * @XmlRoot("entry")
15 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository") 15 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
@@ -21,7 +21,7 @@ class Entry
21{ 21{
22 /** @Serializer\XmlAttribute */ 22 /** @Serializer\XmlAttribute */
23 /** 23 /**
24 * @var integer 24 * @var int
25 * 25 *
26 * @ORM\Column(name="id", type="integer") 26 * @ORM\Column(name="id", type="integer")
27 * @ORM\Id 27 * @ORM\Id
@@ -45,14 +45,14 @@ class Entry
45 private $url; 45 private $url;
46 46
47 /** 47 /**
48 * @var boolean 48 * @var bool
49 * 49 *
50 * @ORM\Column(name="is_archived", type="boolean") 50 * @ORM\Column(name="is_archived", type="boolean")
51 */ 51 */
52 private $isArchived = false; 52 private $isArchived = false;
53 53
54 /** 54 /**
55 * @var boolean 55 * @var bool
56 * 56 *
57 * @ORM\Column(name="is_starred", type="boolean") 57 * @ORM\Column(name="is_starred", type="boolean")
58 */ 58 */
@@ -94,7 +94,7 @@ class Entry
94 private $mimetype; 94 private $mimetype;
95 95
96 /** 96 /**
97 * @var integer 97 * @var int
98 * 98 *
99 * @ORM\Column(name="reading_type", type="integer", nullable=true) 99 * @ORM\Column(name="reading_type", type="integer", nullable=true)
100 */ 100 */
@@ -108,7 +108,7 @@ class Entry
108 private $domainName; 108 private $domainName;
109 109
110 /** 110 /**
111 * @var boolean 111 * @var bool
112 * 112 *
113 * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false}) 113 * @ORM\Column(name="is_public", type="boolean", nullable=true, options={"default" = false})
114 */ 114 */
@@ -135,9 +135,9 @@ class Entry
135 } 135 }
136 136
137 /** 137 /**
138 * Get id 138 * Get id.
139 * 139 *
140 * @return integer 140 * @return int
141 */ 141 */
142 public function getId() 142 public function getId()
143 { 143 {
@@ -145,9 +145,10 @@ class Entry
145 } 145 }
146 146
147 /** 147 /**
148 * Set title 148 * Set title.
149 *
150 * @param string $title
149 * 151 *
150 * @param string $title
151 * @return Entry 152 * @return Entry
152 */ 153 */
153 public function setTitle($title) 154 public function setTitle($title)
@@ -158,7 +159,7 @@ class Entry
158 } 159 }
159 160
160 /** 161 /**
161 * Get title 162 * Get title.
162 * 163 *
163 * @return string 164 * @return string
164 */ 165 */
@@ -168,9 +169,10 @@ class Entry
168 } 169 }
169 170
170 /** 171 /**
171 * Set url 172 * Set url.
173 *
174 * @param string $url
172 * 175 *
173 * @param string $url
174 * @return Entry 176 * @return Entry
175 */ 177 */
176 public function setUrl($url) 178 public function setUrl($url)
@@ -181,7 +183,7 @@ class Entry
181 } 183 }
182 184
183 /** 185 /**
184 * Get url 186 * Get url.
185 * 187 *
186 * @return string 188 * @return string
187 */ 189 */
@@ -191,9 +193,10 @@ class Entry
191 } 193 }
192 194
193 /** 195 /**
194 * Set isArchived 196 * Set isArchived.
197 *
198 * @param string $isArchived
195 * 199 *
196 * @param string $isArchived
197 * @return Entry 200 * @return Entry
198 */ 201 */
199 public function setArchived($isArchived) 202 public function setArchived($isArchived)
@@ -204,7 +207,7 @@ class Entry
204 } 207 }
205 208
206 /** 209 /**
207 * Get isArchived 210 * Get isArchived.
208 * 211 *
209 * @return string 212 * @return string
210 */ 213 */
@@ -221,9 +224,10 @@ class Entry
221 } 224 }
222 225
223 /** 226 /**
224 * Set isStarred 227 * Set isStarred.
228 *
229 * @param string $isStarred
225 * 230 *
226 * @param string $isStarred
227 * @return Entry 231 * @return Entry
228 */ 232 */
229 public function setStarred($isStarred) 233 public function setStarred($isStarred)
@@ -234,7 +238,7 @@ class Entry
234 } 238 }
235 239
236 /** 240 /**
237 * Get isStarred 241 * Get isStarred.
238 * 242 *
239 * @return string 243 * @return string
240 */ 244 */
@@ -251,9 +255,10 @@ class Entry
251 } 255 }
252 256
253 /** 257 /**
254 * Set content 258 * Set content.
259 *
260 * @param string $content
255 * 261 *
256 * @param string $content
257 * @return Entry 262 * @return Entry
258 */ 263 */
259 public function setContent($content) 264 public function setContent($content)
@@ -264,7 +269,7 @@ class Entry
264 } 269 }
265 270
266 /** 271 /**
267 * Get content 272 * Get content.
268 * 273 *
269 * @return string 274 * @return string
270 */ 275 */
@@ -375,7 +380,7 @@ class Entry
375 } 380 }
376 381
377 /** 382 /**
378 * @return boolean 383 * @return bool
379 */ 384 */
380 public function isPublic() 385 public function isPublic()
381 { 386 {
@@ -383,7 +388,7 @@ class Entry
383 } 388 }
384 389
385 /** 390 /**
386 * @param boolean $isPublic 391 * @param bool $isPublic
387 */ 392 */
388 public function setPublic($isPublic) 393 public function setPublic($isPublic)
389 { 394 {
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php
index 9d3c7a32..afe9e1b9 100644
--- a/src/Wallabag/CoreBundle/Entity/Tag.php
+++ b/src/Wallabag/CoreBundle/Entity/Tag.php
@@ -9,7 +9,7 @@ use JMS\Serializer\Annotation\Expose;
9use Doctrine\Common\Collections\ArrayCollection; 9use Doctrine\Common\Collections\ArrayCollection;
10 10
11/** 11/**
12 * Tag 12 * Tag.
13 * 13 *
14 * @XmlRoot("tag") 14 * @XmlRoot("tag")
15 * @ORM\Table 15 * @ORM\Table
@@ -19,7 +19,7 @@ use Doctrine\Common\Collections\ArrayCollection;
19class Tag 19class Tag
20{ 20{
21 /** 21 /**
22 * @var integer 22 * @var int
23 * 23 *
24 * @Expose 24 * @Expose
25 * @ORM\Column(name="id", type="integer") 25 * @ORM\Column(name="id", type="integer")
@@ -52,9 +52,9 @@ class Tag
52 $this->entries = new ArrayCollection(); 52 $this->entries = new ArrayCollection();
53 } 53 }
54 /** 54 /**
55 * Get id 55 * Get id.
56 * 56 *
57 * @return integer 57 * @return int
58 */ 58 */
59 public function getId() 59 public function getId()
60 { 60 {
@@ -62,9 +62,10 @@ class Tag
62 } 62 }
63 63
64 /** 64 /**
65 * Set label 65 * Set label.
66 *
67 * @param string $label
66 * 68 *
67 * @param string $label
68 * @return Tag 69 * @return Tag
69 */ 70 */
70 public function setLabel($label) 71 public function setLabel($label)
@@ -75,7 +76,7 @@ class Tag
75 } 76 }
76 77
77 /** 78 /**
78 * Get label 79 * Get label.
79 * 80 *
80 * @return string 81 * @return string
81 */ 82 */
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php
index ff08c8fb..00eb808a 100644
--- a/src/Wallabag/CoreBundle/Entity/User.php
+++ b/src/Wallabag/CoreBundle/Entity/User.php
@@ -12,7 +12,7 @@ use JMS\Serializer\Annotation\ExclusionPolicy;
12use JMS\Serializer\Annotation\Expose; 12use JMS\Serializer\Annotation\Expose;
13 13
14/** 14/**
15 * User 15 * User.
16 * 16 *
17 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository") 17 * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository")
18 * @ORM\Table 18 * @ORM\Table
@@ -25,7 +25,7 @@ use JMS\Serializer\Annotation\Expose;
25class User implements AdvancedUserInterface, \Serializable 25class User implements AdvancedUserInterface, \Serializable
26{ 26{
27 /** 27 /**
28 * @var integer 28 * @var int
29 * 29 *
30 * @Expose 30 * @Expose
31 * @ORM\Column(name="id", type="integer") 31 * @ORM\Column(name="id", type="integer")
@@ -142,9 +142,9 @@ class User implements AdvancedUserInterface, \Serializable
142 } 142 }
143 143
144 /** 144 /**
145 * Get id 145 * Get id.
146 * 146 *
147 * @return integer 147 * @return int
148 */ 148 */
149 public function getId() 149 public function getId()
150 { 150 {
@@ -152,9 +152,10 @@ class User implements AdvancedUserInterface, \Serializable
152 } 152 }
153 153
154 /** 154 /**
155 * Set username 155 * Set username.
156 *
157 * @param string $username
156 * 158 *
157 * @param string $username
158 * @return User 159 * @return User
159 */ 160 */
160 public function setUsername($username) 161 public function setUsername($username)
@@ -165,7 +166,7 @@ class User implements AdvancedUserInterface, \Serializable
165 } 166 }
166 167
167 /** 168 /**
168 * Get username 169 * Get username.
169 * 170 *
170 * @return string 171 * @return string
171 */ 172 */
@@ -191,9 +192,10 @@ class User implements AdvancedUserInterface, \Serializable
191 } 192 }
192 193
193 /** 194 /**
194 * Set password 195 * Set password.
196 *
197 * @param string $password
195 * 198 *
196 * @param string $password
197 * @return User 199 * @return User
198 */ 200 */
199 public function setPassword($password) 201 public function setPassword($password)
@@ -208,7 +210,7 @@ class User implements AdvancedUserInterface, \Serializable
208 } 210 }
209 211
210 /** 212 /**
211 * Get password 213 * Get password.
212 * 214 *
213 * @return string 215 * @return string
214 */ 216 */
@@ -218,9 +220,10 @@ class User implements AdvancedUserInterface, \Serializable
218 } 220 }
219 221
220 /** 222 /**
221 * Set name 223 * Set name.
224 *
225 * @param string $name
222 * 226 *
223 * @param string $name
224 * @return User 227 * @return User
225 */ 228 */
226 public function setName($name) 229 public function setName($name)
@@ -231,7 +234,7 @@ class User implements AdvancedUserInterface, \Serializable
231 } 234 }
232 235
233 /** 236 /**
234 * Get name 237 * Get name.
235 * 238 *
236 * @return string 239 * @return string
237 */ 240 */
@@ -241,9 +244,10 @@ class User implements AdvancedUserInterface, \Serializable
241 } 244 }
242 245
243 /** 246 /**
244 * Set email 247 * Set email.
248 *
249 * @param string $email
245 * 250 *
246 * @param string $email
247 * @return User 251 * @return User
248 */ 252 */
249 public function setEmail($email) 253 public function setEmail($email)
@@ -254,7 +258,7 @@ class User implements AdvancedUserInterface, \Serializable
254 } 258 }
255 259
256 /** 260 /**
257 * Get email 261 * Get email.
258 * 262 *
259 * @return string 263 * @return string
260 */ 264 */
@@ -341,8 +345,7 @@ class User implements AdvancedUserInterface, \Serializable
341 public function unserialize($serialized) 345 public function unserialize($serialized)
342 { 346 {
343 list( 347 list(
344 $this->id, 348 $this->id) = unserialize($serialized);
345 ) = unserialize($serialized);
346 } 349 }
347 350
348 public function isEqualTo(UserInterface $user) 351 public function isEqualTo(UserInterface $user)
@@ -370,9 +373,10 @@ class User implements AdvancedUserInterface, \Serializable
370 return $this->isActive; 373 return $this->isActive;
371 } 374 }
372 /** 375 /**
373 * Set config 376 * Set config.
377 *
378 * @param \Wallabag\CoreBundle\Entity\Config $config
374 * 379 *
375 * @param \Wallabag\CoreBundle\Entity\Config $config
376 * @return User 380 * @return User
377 */ 381 */
378 public function setConfig(\Wallabag\CoreBundle\Entity\Config $config = null) 382 public function setConfig(\Wallabag\CoreBundle\Entity\Config $config = null)
@@ -383,7 +387,7 @@ class User implements AdvancedUserInterface, \Serializable
383 } 387 }
384 388
385 /** 389 /**
386 * Get config 390 * Get config.
387 * 391 *
388 * @return \Wallabag\CoreBundle\Entity\Config 392 * @return \Wallabag\CoreBundle\Entity\Config
389 */ 393 */
@@ -393,9 +397,10 @@ class User implements AdvancedUserInterface, \Serializable
393 } 397 }
394 398
395 /** 399 /**
396 * Set confirmationToken 400 * Set confirmationToken.
401 *
402 * @param string $confirmationToken
397 * 403 *
398 * @param string $confirmationToken
399 * @return User 404 * @return User
400 */ 405 */
401 public function setConfirmationToken($confirmationToken) 406 public function setConfirmationToken($confirmationToken)
@@ -406,7 +411,7 @@ class User implements AdvancedUserInterface, \Serializable
406 } 411 }
407 412
408 /** 413 /**
409 * Get confirmationToken 414 * Get confirmationToken.
410 * 415 *
411 * @return string 416 * @return string
412 */ 417 */
@@ -416,9 +421,10 @@ class User implements AdvancedUserInterface, \Serializable
416 } 421 }
417 422
418 /** 423 /**
419 * Set passwordRequestedAt 424 * Set passwordRequestedAt.
425 *
426 * @param \DateTime $passwordRequestedAt
420 * 427 *
421 * @param \DateTime $passwordRequestedAt
422 * @return User 428 * @return User
423 */ 429 */
424 public function setPasswordRequestedAt($passwordRequestedAt) 430 public function setPasswordRequestedAt($passwordRequestedAt)
@@ -429,7 +435,7 @@ class User implements AdvancedUserInterface, \Serializable
429 } 435 }
430 436
431 /** 437 /**
432 * Get passwordRequestedAt 438 * Get passwordRequestedAt.
433 * 439 *
434 * @return \DateTime 440 * @return \DateTime
435 */ 441 */
diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
index e141789f..b4224e3d 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
index 0fcf020a..d5890971 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryType.php b/src/Wallabag/CoreBundle/Form/Type/EntryType.php
index cfd64473..839bc25c 100644
--- a/src/Wallabag/CoreBundle/Form/Type/EntryType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/EntryType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php
index c278b84f..2ee24b8f 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
index 313a9aae..da30ccd9 100644
--- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php
index 50ae800b..a5d683c4 100644
--- a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/RssType.php b/src/Wallabag/CoreBundle/Form/Type/RssType.php
index a1ab990f..e14e84e1 100644
--- a/src/Wallabag/CoreBundle/Form/Type/RssType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/RssType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
index 617722db..c088fdd0 100644
--- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
+++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2
2namespace Wallabag\CoreBundle\Form\Type; 3namespace Wallabag\CoreBundle\Form\Type;
3 4
4use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
diff --git a/src/Wallabag/CoreBundle/Helper/Tools.php b/src/Wallabag/CoreBundle/Helper/Tools.php
index 0fd5f259..be29ab99 100755
--- a/src/Wallabag/CoreBundle/Helper/Tools.php
+++ b/src/Wallabag/CoreBundle/Helper/Tools.php
@@ -5,15 +5,16 @@ namespace Wallabag\CoreBundle\Helper;
5final class Tools 5final class Tools
6{ 6{
7 /** 7 /**
8 * Download a file (typically, for downloading pictures on web server) 8 * Download a file (typically, for downloading pictures on web server).
9 * 9 *
10 * @param $url 10 * @param $url
11 *
11 * @return bool|mixed|string 12 * @return bool|mixed|string
12 */ 13 */
13 public static function getFile($url) 14 public static function getFile($url)
14 { 15 {
15 $timeout = 15; 16 $timeout = 15;
16 $useragent = "Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0"; 17 $useragent = 'Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0';
17 18
18 if (in_array('curl', get_loaded_extensions())) { 19 if (in_array('curl', get_loaded_extensions())) {
19 # Fetch feed from URL 20 # Fetch feed from URL
@@ -32,7 +33,7 @@ final class Tools
32 33
33 # FeedBurner requires a proper USER-AGENT... 34 # FeedBurner requires a proper USER-AGENT...
34 curl_setopt($curl, CURL_HTTP_VERSION_1_1, true); 35 curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
35 curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate"); 36 curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate');
36 curl_setopt($curl, CURLOPT_USERAGENT, $useragent); 37 curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
37 38
38 $data = curl_exec($curl); 39 $data = curl_exec($curl);
@@ -45,7 +46,7 @@ final class Tools
45 array( 46 array(
46 'http' => array( 47 'http' => array(
47 'timeout' => $timeout, 48 'timeout' => $timeout,
48 'header' => "User-Agent: ".$useragent, 49 'header' => 'User-Agent: '.$useragent,
49 'follow_location' => true, 50 'follow_location' => true,
50 ), 51 ),
51 'ssl' => array( 52 'ssl' => array(
@@ -91,9 +92,10 @@ final class Tools
91 } 92 }
92 93
93 /** 94 /**
94 * Encode a URL by using a salt 95 * Encode a URL by using a salt.
95 * 96 *
96 * @param $string 97 * @param $string
98 *
97 * @return string 99 * @return string
98 */ 100 */
99 public static function encodeString($string) 101 public static function encodeString($string)
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index a8c138a9..1335e808 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -10,7 +10,7 @@ use Pagerfanta\Pagerfanta;
10class EntryRepository extends EntityRepository 10class EntryRepository extends EntityRepository
11{ 11{
12 /** 12 /**
13 * Retrieves unread entries for a user 13 * Retrieves unread entries for a user.
14 * 14 *
15 * @param int $userId 15 * @param int $userId
16 * @param int $firstResult 16 * @param int $firstResult
@@ -35,7 +35,7 @@ class EntryRepository extends EntityRepository
35 } 35 }
36 36
37 /** 37 /**
38 * Retrieves read entries for a user 38 * Retrieves read entries for a user.
39 * 39 *
40 * @param int $userId 40 * @param int $userId
41 * @param int $firstResult 41 * @param int $firstResult
@@ -61,7 +61,7 @@ class EntryRepository extends EntityRepository
61 } 61 }
62 62
63 /** 63 /**
64 * Retrieves starred entries for a user 64 * Retrieves starred entries for a user.
65 * 65 *
66 * @param int $userId 66 * @param int $userId
67 * @param int $firstResult 67 * @param int $firstResult
@@ -87,7 +87,7 @@ class EntryRepository extends EntityRepository
87 } 87 }
88 88
89 /** 89 /**
90 * Find Entries 90 * Find Entries.
91 * 91 *
92 * @param int $userId 92 * @param int $userId
93 * @param bool $isArchived 93 * @param bool $isArchived
diff --git a/src/Wallabag/CoreBundle/Repository/UserRepository.php b/src/Wallabag/CoreBundle/Repository/UserRepository.php
index aab3dedc..968d0b49 100644
--- a/src/Wallabag/CoreBundle/Repository/UserRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/UserRepository.php
@@ -7,7 +7,7 @@ use Doctrine\ORM\EntityRepository;
7class UserRepository extends EntityRepository 7class UserRepository extends EntityRepository
8{ 8{
9 /** 9 /**
10 * Find a user by its username and rss roken 10 * Find a user by its username and rss roken.
11 * 11 *
12 * @param string $username 12 * @param string $username
13 * @param string $rssToken 13 * @param string $rssToken
diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php b/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php
index fcfe418b..e7c81fc0 100644
--- a/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php
+++ b/src/Wallabag/CoreBundle/Security/Authentication/Encoder/WallabagPasswordEncoder.php
@@ -7,8 +7,7 @@ use Symfony\Component\Security\Core\Exception\BadCredentialsException;
7 7
8/** 8/**
9 * This override just add en extra variable (username) to be able to salt the password 9 * This override just add en extra variable (username) to be able to salt the password
10 * the way Wallabag v1 does. It will avoid to break compatibility with Wallabag v1 10 * the way Wallabag v1 does. It will avoid to break compatibility with Wallabag v1.
11 *
12 */ 11 */
13class WallabagPasswordEncoder extends BasePasswordEncoder 12class WallabagPasswordEncoder extends BasePasswordEncoder
14{ 13{
diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php
index 1c7c5fae..cf3cb051 100644
--- a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php
+++ b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WallabagAuthenticationProvider.php
@@ -45,7 +45,7 @@ class WallabagAuthenticationProvider extends UserAuthenticationProvider
45 throw new BadCredentialsException('The credentials were changed from another session.'); 45 throw new BadCredentialsException('The credentials were changed from another session.');
46 } 46 }
47 } else { 47 } else {
48 if ("" === ($presentedPassword = $token->getCredentials())) { 48 if ('' === ($presentedPassword = $token->getCredentials())) {
49 throw new BadCredentialsException('The presented password cannot be empty.'); 49 throw new BadCredentialsException('The presented password cannot be empty.');
50 } 50 }
51 51
diff --git a/src/Wallabag/CoreBundle/Service/Extractor.php b/src/Wallabag/CoreBundle/Service/Extractor.php
index e4ec96f6..6d43a1da 100644
--- a/src/Wallabag/CoreBundle/Service/Extractor.php
+++ b/src/Wallabag/CoreBundle/Service/Extractor.php
@@ -9,7 +9,7 @@ final class Extractor
9{ 9{
10 public static function extract($url) 10 public static function extract($url)
11 { 11 {
12 $pageContent = Extractor::getPageContent(new Url(base64_encode($url))); 12 $pageContent = self::getPageContent(new Url(base64_encode($url)));
13 $title = $pageContent['rss']['channel']['item']['title'] ?: 'Untitled'; 13 $title = $pageContent['rss']['channel']['item']['title'] ?: 'Untitled';
14 $body = $pageContent['rss']['channel']['item']['description']; 14 $body = $pageContent['rss']['channel']['item']['description'];
15 15
@@ -21,9 +21,10 @@ final class Extractor
21 } 21 }
22 22
23 /** 23 /**
24 * Get the content for a given URL (by a call to FullTextFeed) 24 * Get the content for a given URL (by a call to FullTextFeed).
25 *
26 * @param Url $url
25 * 27 *
26 * @param Url $url
27 * @return mixed 28 * @return mixed
28 */ 29 */
29 public static function getPageContent(Url $url) 30 public static function getPageContent(Url $url)
@@ -49,12 +50,12 @@ final class Extractor
49 $scope = function () { 50 $scope = function () {
50 extract(func_get_arg(1)); 51 extract(func_get_arg(1));
51 $_GET = $_REQUEST = array( 52 $_GET = $_REQUEST = array(
52 "url" => $url->getUrl(), 53 'url' => $url->getUrl(),
53 "max" => 5, 54 'max' => 5,
54 "links" => "preserve", 55 'links' => 'preserve',
55 "exc" => "", 56 'exc' => '',
56 "format" => "json", 57 'format' => 'json',
57 "submit" => "Create Feed", 58 'submit' => 'Create Feed',
58 ); 59 );
59 ob_start(); 60 ob_start();
60 require func_get_arg(0); 61 require func_get_arg(0);
@@ -67,11 +68,11 @@ final class Extractor
67 // Silence $scope function to avoid 68 // Silence $scope function to avoid
68 // issues with FTRSS when error_reporting is to high 69 // issues with FTRSS when error_reporting is to high
69 // FTRSS generates PHP warnings which break output 70 // FTRSS generates PHP warnings which break output
70 $json = @$scope(__DIR__."/../../../../vendor/wallabag/Fivefilters_Libraries/makefulltextfeed.php", array("url" => $url)); 71 $json = @$scope(__DIR__.'/../../../../vendor/wallabag/Fivefilters_Libraries/makefulltextfeed.php', array('url' => $url));
71 72
72 // Clearing and restoring context 73 // Clearing and restoring context
73 foreach ($GLOBALS as $key => $value) { 74 foreach ($GLOBALS as $key => $value) {
74 if ($key != "GLOBALS" && $key != "_SESSION") { 75 if ($key != 'GLOBALS' && $key != '_SESSION') {
75 unset($GLOBALS[$key]); 76 unset($GLOBALS[$key]);
76 } 77 }
77 } 78 }
diff --git a/src/Wallabag/CoreBundle/Tools/Utils.php b/src/Wallabag/CoreBundle/Tools/Utils.php
index 8fa74491..7e2968e7 100644
--- a/src/Wallabag/CoreBundle/Tools/Utils.php
+++ b/src/Wallabag/CoreBundle/Tools/Utils.php
@@ -5,7 +5,7 @@ namespace Wallabag\CoreBundle\Tools;
5class Utils 5class Utils
6{ 6{
7 /** 7 /**
8 * Generate a token used for RSS 8 * Generate a token used for RSS.
9 * 9 *
10 * @return string 10 * @return string
11 */ 11 */
diff --git a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
index 92406865..18388948 100644
--- a/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
+++ b/src/Wallabag/CoreBundle/Twig/Extension/WallabagExtension.php
@@ -13,9 +13,10 @@ class WallabagExtension extends \Twig_Extension
13 } 13 }
14 14
15 /** 15 /**
16 * Returns the domain name for a URL 16 * Returns the domain name for a URL.
17 * 17 *
18 * @param $url 18 * @param $url
19 *
19 * @return string 20 * @return string
20 */ 21 */
21 public static function getDomainName($url) 22 public static function getDomainName($url)
@@ -24,9 +25,10 @@ class WallabagExtension extends \Twig_Extension
24 } 25 }
25 26
26 /** 27 /**
27 * For a given text, we calculate reading time for an article 28 * For a given text, we calculate reading time for an article.
28 * 29 *
29 * @param $text 30 * @param $text
31 *
30 * @return float 32 * @return float
31 */ 33 */
32 public static function getReadingTime($text) 34 public static function getReadingTime($text)