Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 12, 2024
1 parent 6b9910c commit ee04330
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/DI/Extensions/ParametersExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
namespace Nette\DI\Extensions;

use Nette;
use Nette\DI\Container;
use Nette\DI\DynamicParameter;
use Nette\DI\Helpers;
use Nette\PhpGenerator\Method;


/**
Expand Down Expand Up @@ -63,9 +61,8 @@ public function afterCompile(Nette\PhpGenerator\ClassType $class): void
});
}

$method = Method::from([Container::class, 'getStaticParameters'])
$class->inheritMethod('getStaticParameters')
->addBody('return ?;', [array_diff_key($builder->parameters, $dynamicParams)]);
$class->addMember($method);

if (!$dynamicParams) {
return;
Expand Down

0 comments on commit ee04330

Please sign in to comment.