@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function filterRanges(Subscription $subscription, $periodId) |
| 39 | 39 | { |
| 40 | - $ranges = $subscription->getRanges()->filter(function (Duration $duration) use ($periodId) { |
|
| 40 | + $ranges = $subscription->getRanges()->filter(function(Duration $duration) use ($periodId) { |
|
| 41 | 41 | return $duration->getId() == $periodId; |
| 42 | 42 | }); |
| 43 | 43 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | foreach ($orderItems as $value) { |
| 97 | 97 | $parent = $item->getParent(); |
| 98 | 98 | if ($item->getSubscription()->getId() == $value->getSubscription()->getId() && |
| 99 | - $parent == $value |
|
| 99 | + $parent == $value |
|
| 100 | 100 | ) { |
| 101 | 101 | $value->setProlonged(true); |
| 102 | 102 | $value->setToPay($parent->getToPay()); |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | /** |
| 358 | 358 | * Gets all available sections by given language Id. |
| 359 | 359 | * |
| 360 | - * @param int $language Language Id to search for |
|
| 360 | + * @param int $languageId Language Id to search for |
|
| 361 | 361 | * |
| 362 | 362 | * @return array |
| 363 | 363 | */ |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | * |
| 531 | 531 | * @param UserSubscription $userSubscription User subscription |
| 532 | 532 | * |
| 533 | - * @return DateTime |
|
| 533 | + * @return null|\DateTime |
|
| 534 | 534 | */ |
| 535 | 535 | public function getExpirationDate(UserSubscription $userSubscription) |
| 536 | 536 | { |
@@ -211,6 +211,9 @@ |
||
| 211 | 211 | return $em->getRepository('Newscoop\PaywallBundle\Entity\Order'); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | + /** |
|
| 215 | + * @param string $locale |
|
| 216 | + */ |
|
| 214 | 217 | private function getActiveSubscriptions($locale) |
| 215 | 218 | { |
| 216 | 219 | $em = $this->get('em'); |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($options !== '') { |
| 101 | - $html .= '<select name="batchorder['.$subscription['id'].']"><option value="">'.$p_params['choose_text'].'</option>'.$options.'</select><br>'; |
|
| 101 | + $html .= '<select name="batchorder['.$subscription['id'].']"><option value="">'.$p_params['choose_text'].'</option>'.$options.'</select><br>'; |
|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -7,10 +7,8 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Function to check if user has access to content. |
| 9 | 9 | * |
| 10 | - * @param array $params |
|
| 11 | - * @param object $smarty |
|
| 12 | 10 | * |
| 13 | - * @return string |
|
| 11 | + * @return boolean |
|
| 14 | 12 | */ |
| 15 | 13 | function smarty_modifier_has_subscription($user) |
| 16 | 14 | { |
@@ -15,30 +15,30 @@ discard block |
||
| 15 | 15 | class PermissionsListener |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * TranslatorInterface. |
|
| 19 | - * |
|
| 20 | - * @var Translator |
|
| 21 | - */ |
|
| 22 | - protected $translator; |
|
| 18 | + * TranslatorInterface. |
|
| 19 | + * |
|
| 20 | + * @var Translator |
|
| 21 | + */ |
|
| 22 | + protected $translator; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Construct. |
|
| 26 | - * |
|
| 27 | - * @param TranslatorInterface $translator Translator object |
|
| 28 | - */ |
|
| 29 | - public function __construct(TranslatorInterface $translator) |
|
| 30 | - { |
|
| 31 | - $this->translator = $translator; |
|
| 32 | - } |
|
| 24 | + /** |
|
| 25 | + * Construct. |
|
| 26 | + * |
|
| 27 | + * @param TranslatorInterface $translator Translator object |
|
| 28 | + */ |
|
| 29 | + public function __construct(TranslatorInterface $translator) |
|
| 30 | + { |
|
| 31 | + $this->translator = $translator; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Register plugin permissions in Newscoop ACL. |
|
| 36 | - * |
|
| 37 | - * @param PluginPermissionsEvent $event |
|
| 38 | - */ |
|
| 39 | - public function registerPermissions(PluginPermissionsEvent $event) |
|
| 40 | - { |
|
| 41 | - $event->registerPermissions($this->translator->trans('paywall.title'), array( |
|
| 34 | + /** |
|
| 35 | + * Register plugin permissions in Newscoop ACL. |
|
| 36 | + * |
|
| 37 | + * @param PluginPermissionsEvent $event |
|
| 38 | + */ |
|
| 39 | + public function registerPermissions(PluginPermissionsEvent $event) |
|
| 40 | + { |
|
| 41 | + $event->registerPermissions($this->translator->trans('paywall.title'), array( |
|
| 42 | 42 | Permissions::SUBSCRIPTION_ADD => $this->translator->trans('paywall.permissions.add'), |
| 43 | 43 | Permissions::SUBSCRIPTIONS_MANAGE => $this->translator->trans('paywall.permissions.manage'), |
| 44 | 44 | Permissions::SUBSCRIPTIONS_VIEW => $this->translator->trans('paywall.permissions.list'), |
@@ -52,6 +52,6 @@ discard block |
||
| 52 | 52 | Permissions::PAYMENTS_VIEW => $this->translator->trans('paywall.permissions.payments.main'), |
| 53 | 53 | Permissions::PAYMENTS_MANAGE => $this->translator->trans('paywall.permissions.payments.manage'), |
| 54 | 54 | Permissions::SIDEBAR => $this->translator->trans('paywall.permissions.sidebar'), |
| 55 | - )); |
|
| 56 | - } |
|
| 55 | + )); |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | /** |
| 482 | 482 | * Gets the payments. |
| 483 | 483 | * |
| 484 | - * @return Payment |
|
| 484 | + * @return Collection |
|
| 485 | 485 | */ |
| 486 | 486 | public function getPayments() |
| 487 | 487 | { |
@@ -493,6 +493,9 @@ discard block |
||
| 493 | 493 | return $this->paymentState; |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | + /** |
|
| 497 | + * @param string $paymentState |
|
| 498 | + */ |
|
| 496 | 499 | public function setPaymentState($paymentState) |
| 497 | 500 | { |
| 498 | 501 | $this->paymentState = $paymentState; |