Skip to content

Commit

Permalink
Require codeigniter 4.5 ad interim
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalandan committed Feb 25, 2024
1 parent 0087056 commit 19ba680
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
26 changes: 20 additions & 6 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,27 @@
* the LICENSE file that was distributed with this source code.
*/

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

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

/** @var SplFileInfo $helper */
foreach ($iterator as $helper) {
if ($helper->isFile()) {
require_once $helper->getRealPath();
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
__DIR__ . '/vendor/' . $framework . '/system/Helpers'
)
);

/** @var SplFileInfo $helper */
foreach ($iterator as $helper) {
if ($helper->isFile()) {
require_once $helper->getRealPath();
}
}

return;
}
}

throw new RuntimeException('There is no CodeIgniter4 framework installed.');
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
},
"require": {
"php": "^8.1",
"codeigniter4/framework": "^4.4",
"composer-runtime-api": "^2.2",
"codeigniter4/codeigniter4": "4.5.x-dev",
"phpstan/phpstan": "^1.10"
},
"require-dev": {
Expand All @@ -39,6 +40,12 @@
"phpunit/phpunit": "^10.2",
"rector/rector": "^1.0.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codeigniter4/codeigniter4"
}
],
"conflict": {
"codeigniter/framework": "*"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/Type/data/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

use CodeIgniter\Autoloader\Autoloader;
use CodeIgniter\Autoloader\FileLocator;
use CodeIgniter\Autoloader\FileLocatorInterface;
use CodeIgniter\Cache\CacheInterface;
use CodeIgniter\CLI\Commands;
use CodeIgniter\Debug\Exceptions;
Expand Down Expand Up @@ -52,7 +52,7 @@

// from CodeIgniter\Config\BaseService
assertType(Autoloader::class, single_service('autoloader'));
assertType(FileLocator::class, service('locator'));
assertType(FileLocatorInterface::class, service('locator'));
assertType('null', service('__callStatic'));
assertType('null', service('serviceExists'));
assertType('null', service('reset'));
Expand Down

0 comments on commit 19ba680

Please sign in to comment.