Skip to content

Commit

Permalink
Fixed wrong typehint and method usage [resolves #12] (thx @xificurk)
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtech-dobes committed Jul 22, 2014
1 parent 0928d5b commit d87824f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Gopay/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Markette\Gopay;

use Nette\DI\CompilerExtension;
use Nette\PhpGenerator;
use Nette\Reflection\ClassType;


Expand Down Expand Up @@ -64,7 +65,7 @@ public function loadConfiguration()



public function afterCompile(ClassType $class)
public function afterCompile(PhpGenerator\ClassType $class)
{
$initialize = $class->methods['initialize'];
$initialize->addBody('Markette\Gopay\Service::registerAddPaymentButtons($this->getService(?));', array(
Expand Down
4 changes: 2 additions & 2 deletions Gopay/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,10 @@ private function createSignature($paymentSessionId)
*/
public static function registerAddPaymentButtons(Service $service)
{
Nette\Forms\Container::registerMethod('addPaymentButtons', function ($container, $callbacks) use ($service) {
Nette\Forms\Container::extensionMethod('addPaymentButtons', function ($container, $callbacks) use ($service) {
$service->bindPaymentButtons($container, $callbacks);
});
Nette\Forms\Container::registerMethod('addPaymentButton', function ($container, $channel) use ($service) {
Nette\Forms\Container::extensionMethod('addPaymentButton', function ($container, $channel) use ($service) {
return $service->bindPaymentButton($channel, $container);
});
}
Expand Down

0 comments on commit d87824f

Please sign in to comment.