Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed nette reflection #189

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"nette/http": "^3.0",
"nette/neon": "^3.0",
"nette/php-generator": "^3.0.1@dev",
"nette/reflection": "^2.4.2@dev",
"nette/utils": "^3.0",
"psr/log": "^1.0",
"symfony/translation": "^3.4 || ^4.0",
Expand Down
4 changes: 2 additions & 2 deletions src/DI/TranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
use Nette\DI\Statement;
use Nette\PhpGenerator\ClassType as ClassTypeGenerator;
use Nette\PhpGenerator\PhpLiteral;
use Nette\Reflection\ClassType as ReflectionClassType;
use Nette\Schema\Expect;
use Nette\Schema\Schema;
use Nette\Utils\Finder;
use Nette\Utils\Validators;
use ReflectionClass;
use Symfony\Component\Translation\Extractor\ChainExtractor;
use Symfony\Component\Translation\Formatter\IntlFormatter;
use Symfony\Component\Translation\Formatter\IntlFormatterInterface;
Expand Down Expand Up @@ -451,7 +451,7 @@ protected function validateResource($format, $file, $locale, $domain)
try {
/** @var \Nette\DI\Definitions\ServiceDefinition $def */
$def = $builder->getDefinition($this->loaders[$format]);
$refl = ReflectionClassType::from($def->getEntity() ?: $def->getClass());
$refl = new ReflectionClass($def->getEntity() ?: $def->getClass());
$method = $refl->getConstructor();
if ($method !== NULL && $method->getNumberOfRequiredParameters() > 1) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Diagnostics/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use Kdyby\Translation\Translator;
use Nette\Application\Application;
use Nette\Application\Request;
use Nette\Reflection\ClassType;
use Nette\Utils\Arrays;
use Nette\Utils\Html;
use Nette\Utils\Strings;
use ReflectionClass;
use Symfony\Component\Translation\Loader\YamlFileLoader;
use Tracy\BlueScreen;
use Tracy\Debugger;
Expand Down Expand Up @@ -275,7 +275,7 @@ public function setLocaleResolvers(array $resolvers)
{
$this->localeResolvers = [];
foreach ($resolvers as $resolver) {
$this->localeResolvers[ClassType::from($resolver)->getShortName()] = $resolver;
$this->localeResolvers[(new ReflectionClass($resolver))->getShortName()] = $resolver;
}
}

Expand Down