Welcome Guest, Not a member yet? Register   Sign In
after updating composer to 4.4 .0 i got the issue
#1

TypeError
CodeIgniter\Router\RouteCollection::__construct(): Argument #3 ($routing) must be of type Config\Routing, null given, called in C:\xampp\htdocs\GPMS\vendor\codeigniter4\framework\system\Config\Services.php on line 617
SYSTEMPATH\Router\RouteCollection.php at line 283

276      * Flag to limit or not the routes with {locale} placeholder to App::$supportedLocales
277      */
278    protected bool $useSupportedLocalesOnly = false;
279
280    /**
281      * Constructor
282      */
283    public function __construct(FileLocator $locator, Modules $moduleConfig, Routing $routing)
284    {
285        $this->fileLocator  = $locator;
286        $this->moduleConfig = $moduleConfig;
287
288        $this->httpHost = Services::request()->getServer('HTTP_HOST');
289
290        // Setup based on config file. Let routes file override.
Backtrace Server Request Response Files Memory
SYSTEMPATH\Config\Services.php : 617  —  CodeIgniter\Router\RouteCollection->__construct ( arguments )

610      */
611    public static function routes(bool $getShared = true)
612    {
613        if ($getShared) {
614            return static::getSharedInstance('routes');
615        }
616
617        return new RouteCollection(AppServices::locator(), config(Modules::class), config(Routing::class));
618    }
619
620    /**
621      * The Router class uses a RouteCollection's array of routes, and determines
622      * the correct Controller and Method to execute.
623      *
624      * @return Router
SYSTEMPATH\Config\BaseService.php : 258  —  CodeIgniter\Config\Services::routes ( arguments )

251    {
252        $service = static:ConfusederviceExists($name);
253
254        if ($service === null) {
255            return null;
256        }
257
258        return $service::$name(...$arguments);
259    }
260
261    /**
262      * Check if the requested service is defined and return the declaring
263      * class. Return null if not found.
264      */
265    public static function serviceExists(string $name): ?string
SYSTEMPATH\Config\BaseService.php : 199  —  CodeIgniter\Config\BaseService::__callStatic ( arguments )

192            return static::$mocks[$key];
193        }
194
195        if (! isset(static::$instances[$key])) {
196            // Make sure $getShared is false
197            $params[] = false;
198
199            static::$instances[$key] = AppServices::$key(...$params);
200        }
201
202        return static::$instances[$key];
203    }
204
205    /**
206      * The Autoloader class is the central class that handles our
SYSTEMPATH\Config\Services.php : 614  —  CodeIgniter\Config\BaseService::getSharedInstance ( arguments )

607      * a collection of routes.
608      *
609      * @return RouteCollection
610      */
611    public static function routes(bool $getShared = true)
612    {
613        if ($getShared) {
614            return static::getSharedInstance('routes');
615        }
616
617        return new RouteCollection(AppServices::locator(), config(Modules::class), config(Routing::class));
618    }
619
620    /**
621      * The Router class uses a RouteCollection's array of routes, and determines
SYSTEMPATH\Config\BaseService.php : 258  —  CodeIgniter\Config\Services::routes ()

251    {
252        $service = static:ConfusederviceExists($name);
253
254        if ($service === null) {
255            return null;
256        }
257
258        return $service::$name(...$arguments);
259    }
260
261    /**
262      * Check if the requested service is defined and return the declaring
263      * class. Return null if not found.
264      */
265    public static function serviceExists(string $name): ?string
SYSTEMPATH\CodeIgniter.php : 783  —  CodeIgniter\Config\BaseService::__callStatic ( arguments )

776      * @return string|string[]|null Route filters, that is, the filters specified in the routes file
777      *
778      * @throws RedirectException
779      */
780    protected function tryToRouteIt(?RouteCollectionInterface $routes = null)
781    {
782        if ($routes === null) {
783            $routes = Services::routes()->loadRoutes();
784        }
785
786        // $routes is defined in Config/Routes.php
787        $this->router = Services::router($routes, $this->request);
788
789        $path = $this->determinePath();
790
SYSTEMPATH\CodeIgniter.php : 442  —  CodeIgniter\CodeIgniter->tryToRouteIt ( arguments )

435
436        // Check for a cached page. Execution will stop
437        // if the page has been cached.
438        if (($response = $this->displayCache($cacheConfig)) instanceof ResponseInterface) {
439            return $response;
440        }
441
442        $routeFilter = $this->tryToRouteIt($routes);
443
444        $uri = $this->determinePath();
445
446        if ($this->enableFilters) {
447            // Start up the filters
448            $filters = Services::filters();
449
SYSTEMPATH\CodeIgniter.php : 353  —  CodeIgniter\CodeIgniter->handleRequest ( arguments )

346
347        $this->getRequestObject();
348        $this->getResponseObject();
349
350        $this->spoofRequestMethod();
351
352        try {
353            $this->response = $this->handleRequest($routes, config(Cache::class), $returnResponse);
354        } catch (ResponsableInterface|DeprecatedRedirectException $e) {
355            $this->outputBufferingEnd();
356            if ($e instanceof DeprecatedRedirectException) {
357                $e = new RedirectException($e->getMessage(), $e->getCode(), $e);
358            }
359
360            $this->response = $e->getResponse();
FCPATH\index.php : 79  —  CodeIgniter\CodeIgniter->run ()

72  *---------------------------------------------------------------
73  * LAUNCH THE APPLICATION
74  *---------------------------------------------------------------
75  * Now that everything is set up, it's time to actually fire
76  * up the engines and make this app do its thang.
77  */
78
79 $app->run();
80
81 // Save Config Cache
82 // $factoriesCache->save('config');
83 // ^^^ Uncomment this line if you want to use Config Caching.
84
85 // Exits the application, setting the exit code for CLI-based applications
86 // that might be watching.
Reply
#2

Read https://forum.codeigniter.com/showthread.php?tid=88338
Reply




Theme © iAndrew 2016 - Forum software by © MyBB