Skip to content

Commit 2d7cc0f

Browse files
authored
Merge pull request #297 from alexpott/task/remove-nette-dependency
Use a dependency that is already present and doesn't add new dependency
2 parents c034337 + 9d92887 commit 2d7cc0f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^7.4 || ^8.0",
14-
"nette/finder": "^2.5",
14+
"symfony/finder": "~3.4.5|^4.2",
1515
"phpstan/phpstan": "^1.0",
1616
"symfony/yaml": "~3.4.5|^4.2",
1717
"webflo/drupal-finder": "^1.2"

src/Drupal/DrupalAutoloader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
66
use DrupalFinder\DrupalFinder;
7-
use Nette\Utils\Finder;
87
use PHPStan\DependencyInjection\Container;
8+
use Symfony\Component\Finder\Finder;
99
use Symfony\Component\Yaml\Yaml;
1010

1111
class DrupalAutoloader
@@ -143,7 +143,7 @@ public function register(Container $container): void
143143
}
144144
$drushDir = dirname($reflect->getFileName(), $levels);
145145
/** @var \SplFileInfo $file */
146-
foreach (Finder::findFiles('*.inc')->in($drushDir . '/includes') as $file) {
146+
foreach (Finder::create()->files()->name('*.inc')->in($drushDir . '/includes') as $file) {
147147
require_once $file->getPathname();
148148
}
149149
}
@@ -204,7 +204,7 @@ class: Drupal\jsonapi\Routing\JsonApiParamEnhancer
204204
protected function loadLegacyIncludes(): void
205205
{
206206
/** @var \SplFileInfo $file */
207-
foreach (Finder::findFiles('*.inc')->in($this->drupalRoot . '/core/includes') as $file) {
207+
foreach (Finder::create()->files()->name('*.inc')->in($this->drupalRoot . '/core/includes') as $file) {
208208
require_once $file->getPathname();
209209
}
210210
}

0 commit comments

Comments
 (0)