Skip to content

Commit 19ba680

Browse files
committed
Require codeigniter 4.5 ad interim
1 parent 0087056 commit 19ba680

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

bootstrap.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,27 @@
1111
* the LICENSE file that was distributed with this source code.
1212
*/
1313

14-
require_once __DIR__ . '/vendor/codeigniter4/framework/system/Test/bootstrap.php';
14+
use Composer\InstalledVersions;
1515

16-
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/vendor/codeigniter4/framework/system/Helpers'));
16+
foreach (['codeigniter4/codeigniter4', 'codeigniter4/framework'] as $framework) {
17+
if (InstalledVersions::isInstalled($framework)) {
18+
require_once __DIR__ . '/vendor/' . $framework . '/system/Test/bootstrap.php';
1719

18-
/** @var SplFileInfo $helper */
19-
foreach ($iterator as $helper) {
20-
if ($helper->isFile()) {
21-
require_once $helper->getRealPath();
20+
$iterator = new RecursiveIteratorIterator(
21+
new RecursiveDirectoryIterator(
22+
__DIR__ . '/vendor/' . $framework . '/system/Helpers'
23+
)
24+
);
25+
26+
/** @var SplFileInfo $helper */
27+
foreach ($iterator as $helper) {
28+
if ($helper->isFile()) {
29+
require_once $helper->getRealPath();
30+
}
31+
}
32+
33+
return;
2234
}
2335
}
36+
37+
throw new RuntimeException('There is no CodeIgniter4 framework installed.');

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"require": {
2525
"php": "^8.1",
26-
"codeigniter4/framework": "^4.4",
26+
"composer-runtime-api": "^2.2",
27+
"codeigniter4/codeigniter4": "4.5.x-dev",
2728
"phpstan/phpstan": "^1.10"
2829
},
2930
"require-dev": {
@@ -39,6 +40,12 @@
3940
"phpunit/phpunit": "^10.2",
4041
"rector/rector": "^1.0.0"
4142
},
43+
"repositories": [
44+
{
45+
"type": "vcs",
46+
"url": "https://github.com/codeigniter4/codeigniter4"
47+
}
48+
],
4249
"conflict": {
4350
"codeigniter/framework": "*"
4451
},

tests/Type/data/services.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
use CodeIgniter\Autoloader\Autoloader;
15-
use CodeIgniter\Autoloader\FileLocator;
15+
use CodeIgniter\Autoloader\FileLocatorInterface;
1616
use CodeIgniter\Cache\CacheInterface;
1717
use CodeIgniter\CLI\Commands;
1818
use CodeIgniter\Debug\Exceptions;
@@ -52,7 +52,7 @@
5252

5353
// from CodeIgniter\Config\BaseService
5454
assertType(Autoloader::class, single_service('autoloader'));
55-
assertType(FileLocator::class, service('locator'));
55+
assertType(FileLocatorInterface::class, service('locator'));
5656
assertType('null', service('__callStatic'));
5757
assertType('null', service('serviceExists'));
5858
assertType('null', service('reset'));

0 commit comments

Comments
 (0)