@@ -79,8 +79,6 @@ discard block |
||
| 79 | 79 | * Sends email notifications. |
| 80 | 80 | * |
| 81 | 81 | * @param string $code Email message type |
| 82 | - * @param Newscoop\Entity\User $user User object |
|
| 83 | - * @param PaywallBundle\Entity\UserSubscription $userSubscription User's subscription |
|
| 84 | 82 | */ |
| 85 | 83 | public function sendNotification($code, array $recipients = array(), array $data = array()) |
| 86 | 84 | { |
@@ -124,6 +122,9 @@ discard block |
||
| 124 | 122 | ); |
| 125 | 123 | } |
| 126 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $code |
|
| 127 | + */ |
|
| 127 | 128 | private function loadProperMessageTemplateBy($code) |
| 128 | 129 | { |
| 129 | 130 | switch ($code) { |
@@ -192,7 +193,6 @@ discard block |
||
| 192 | 193 | * notifications to users. |
| 193 | 194 | * |
| 194 | 195 | * @param \DateTime $now Current date time |
| 195 | - * @param int $subscriptionsCount Subscriptions count |
|
| 196 | 196 | */ |
| 197 | 197 | public function processExpiringSubscriptions($now, $notify, $count = 0, $days = 7) |
| 198 | 198 | { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * Calculates prices including all discounts. |
| 44 | 44 | * |
| 45 | 45 | * @param array $items array of subscription identifiers and its periods |
| 46 | - * @param string $surrency currency |
|
| 46 | + * @param string $currency currency |
|
| 47 | 47 | * |
| 48 | 48 | * @return OrderInterface |
| 49 | 49 | */ |
@@ -357,7 +357,7 @@ |
||
| 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 | */ |
@@ -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()); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @author Rafał Muszyński <[email protected]> |
|
| 4 | - * @copyright 2015 Sourcefabric z.ú. |
|
| 5 | - * @license http://www.gnu.org/licenses/gpl-3.0.txt |
|
| 6 | - */ |
|
| 3 | + * @author Rafał Muszyński <[email protected]> |
|
| 4 | + * @copyright 2015 Sourcefabric z.ú. |
|
| 5 | + * @license http://www.gnu.org/licenses/gpl-3.0.txt |
|
| 6 | + */ |
|
| 7 | 7 | namespace Newscoop\PaywallBundle\EventListener; |
| 8 | 8 | |
| 9 | 9 | use Newscoop\EventDispatcher\Events\PluginHooksEvent; |
@@ -131,17 +131,17 @@ |
||
| 131 | 131 | private function getClasses() |
| 132 | 132 | { |
| 133 | 133 | return array( |
| 134 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Subscription'), |
|
| 135 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\SubscriptionSpecification'), |
|
| 136 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Settings'), |
|
| 137 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\UserSubscription'), |
|
| 138 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Trial'), |
|
| 139 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Discount'), |
|
| 140 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Duration'), |
|
| 141 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Order'), |
|
| 142 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Modification'), |
|
| 143 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Currency'), |
|
| 144 | - $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\SubscriptionTranslation'), |
|
| 134 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Subscription'), |
|
| 135 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\SubscriptionSpecification'), |
|
| 136 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Settings'), |
|
| 137 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\UserSubscription'), |
|
| 138 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Trial'), |
|
| 139 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Discount'), |
|
| 140 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Duration'), |
|
| 141 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Order'), |
|
| 142 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Modification'), |
|
| 143 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\Currency'), |
|
| 144 | + $this->em->getClassMetadata('Newscoop\PaywallBundle\Entity\SubscriptionTranslation'), |
|
| 145 | 145 | ); |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | ), |
| 57 | 57 | )); |
| 58 | 58 | |
| 59 | - $formModifier = function (FormInterface $form, Subscription $subscription = null) { |
|
| 59 | + $formModifier = function(FormInterface $form, Subscription $subscription = null) { |
|
| 60 | 60 | $periods = null === $subscription ? array() : $subscription->getRanges(); |
| 61 | 61 | |
| 62 | 62 | $form->add('duration', 'entity', array( |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $builder->addEventListener( |
| 75 | 75 | FormEvents::PRE_SET_DATA, |
| 76 | - function (FormEvent $event) use ($formModifier) { |
|
| 76 | + function(FormEvent $event) use ($formModifier) { |
|
| 77 | 77 | $item = $event->getData(); |
| 78 | 78 | $subscription = null; |
| 79 | 79 | if ($item) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $builder->get('subscription')->addEventListener( |
| 87 | 87 | FormEvents::POST_SUBMIT, |
| 88 | - function (FormEvent $event) use ($formModifier) { |
|
| 88 | + function(FormEvent $event) use ($formModifier) { |
|
| 89 | 89 | $subscription = $event->getForm()->getData(); |
| 90 | 90 | $formModifier($event->getForm()->getParent(), $subscription); |
| 91 | 91 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | 'invalid_message' => 'paywall.manage.error.currency', |
| 31 | 31 | 'required' => true, |
| 32 | 32 | )) |
| 33 | - ->add('type', 'choice', array( |
|
| 33 | + ->add('type', 'choice', array( |
|
| 34 | 34 | 'label' => 'paywall.manage.label.paymenttype', |
| 35 | 35 | 'choices' => array( |
| 36 | 36 | 'P' => 'paywall.manage.label.paid', |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | str_replace('%type%', $definition['type'], $optionText) |
| 158 | 158 | ))).'</option>'."\n"; |
| 159 | 159 | } |
| 160 | - $html .= '<select name="subscription_name">'.$options.'</select>'; |
|
| 160 | + $html .= '<select name="subscription_name">'.$options.'</select>'; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | $html .= $p_content; |