Skip to content

Commit

Permalink
PHP 8/php-generator v4 compatibility update (#5)
Browse files Browse the repository at this point in the history
* PHP 8/php-generator v4 compatibility update

PhpGenerator\ClassType.php was refactored in v.4, so $methods-property became private. Fixed by using $class->getMethod('initialize') instead.

* Update HttpAuthExtension.php

tabs instead of spaces
  • Loading branch information
eydun authored Oct 22, 2023
1 parent 4384dc1 commit db4b60a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HttpAuthExtension/HttpAuthExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function afterCompile(ClassType $class): void
$config = $this->config;

if (isset($config->username, $config->password, $config->title)) {
$initialize = $class->methods['initialize'];
$initialize = $class->getMethod('initialize');

$initialize->addBody('$auth = new HttpAuthExtension\HttpAuthenticator( $this->getByType(\'Nette\Http\IResponse\'), ?, ?, ? );',
[$config->username, $config->password, $config->title]);
Expand Down

0 comments on commit db4b60a

Please sign in to comment.