Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"laminas/laminas-http": "^2.15",
"laminas/laminas-modulemanager": "^2.16",
"laminas/laminas-router": "^3.11.1",
"laminas/laminas-servicemanager": "^3.20.0",
"laminas/laminas-servicemanager": "^4.1.0",
"laminas/laminas-stdlib": "^3.19",
"laminas/laminas-view": "^2.18.0"
},
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/ControllerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ class ControllerManager extends AbstractPluginManager
* Injects an initializer for injecting controllers with an
* event manager and plugin manager.
*
* @param ConfigInterface|ContainerInterface $configOrContainerInstance
* @param ConfigInterface|ContainerInterface $configInstanceOrParentLocator
*/
public function __construct($configOrContainerInstance, array $config = [])
public function __construct($configInstanceOrParentLocator = null, array $config = [])
{
$this->addInitializer([$this, 'injectEventManager']);
$this->addInitializer([$this, 'injectPluginManager']);
parent::__construct($configOrContainerInstance, $config);
parent::__construct($configInstanceOrParentLocator, $config);
}

/**
* Validate a plugin
*
* {@inheritDoc}
*/
public function validate($plugin)
public function validate(mixed $plugin)
{
if (! $plugin instanceof $this->instanceOf) {
throw new InvalidServiceException(sprintf(
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function injectController($plugin)
*
* {@inheritDoc}
*/
public function validate($plugin)
public function validate(mixed $plugin)
{
if (! $plugin instanceof $this->instanceOf) {
throw new InvalidServiceException(sprintf(
Expand Down
4 changes: 2 additions & 2 deletions test/Application/AllowsReturningEarlyFromRoutingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testAllowsReturningEarlyFromRouting()
$application->getEventManager()->attach(MvcEvent::EVENT_ROUTE, static fn($e): Response => $response);

$result = $application->run();
$this->assertSame($application, $result);
$this->assertSame($response, $result->getResponse());
self::assertSame($application, $result);
self::assertSame($response, $result->getResponse());
}
}
4 changes: 2 additions & 2 deletions test/Application/ControllerIsDispatchedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function testControllerIsDispatchedDuringRun()
$application = $this->prepareApplication();

$response = $application->run()->getResponse();
$this->assertStringContainsString('PathController', $response->getContent());
$this->assertStringContainsString(MvcEvent::EVENT_DISPATCH, $response->toString());
self::assertStringContainsString('PathController', $response->getContent());
self::assertStringContainsString(MvcEvent::EVENT_DISPATCH, $response->toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public function testExceptionsRaisedInDispatchableShouldRaiseDispatchErrorEvent(
$events = $application->getEventManager();
$events->attach(MvcEvent::EVENT_DISPATCH_ERROR, function ($e) use ($response) {
$exception = $e->getParam('exception');
$this->assertInstanceOf('Exception', $exception);
self::assertInstanceOf('Exception', $exception);
$response->setContent($exception->getMessage());
return $response;
});

$application->run();
$this->assertStringContainsString('Raised an exception', $response->getContent());
self::assertStringContainsString('Raised an exception', $response->getContent());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testInabilityToRetrieveControllerShouldTriggerDispatchError()
});

$application->run();
$this->assertStringContainsString(Application::ERROR_CONTROLLER_NOT_FOUND, $response->getContent());
$this->assertStringContainsString('bad', $response->getContent());
self::assertStringContainsString(Application::ERROR_CONTROLLER_NOT_FOUND, $response->getContent());
self::assertStringContainsString('bad', $response->getContent());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testInabilityToRetrieveControllerShouldTriggerExceptionError()
});

$application->run();
$this->assertStringContainsString(Application::ERROR_CONTROLLER_NOT_FOUND, $response->getContent());
$this->assertStringContainsString('bad', $response->getContent());
self::assertStringContainsString(Application::ERROR_CONTROLLER_NOT_FOUND, $response->getContent());
self::assertStringContainsString('bad', $response->getContent());
}
}
6 changes: 3 additions & 3 deletions test/Application/InitializationIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function testDefaultInitializationWorkflow()
$content = ob_get_clean();

$response = $application->getResponse();
$this->assertStringContainsString(PathController::class, $response->getContent());
$this->assertStringContainsString(PathController::class, $content);
$this->assertStringContainsString(MvcEvent::EVENT_DISPATCH, $response->toString());
self::assertStringContainsString(PathController::class, $response->getContent());
self::assertStringContainsString(PathController::class, $content);
self::assertStringContainsString(MvcEvent::EVENT_DISPATCH, $response->toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testInvalidControllerTypeShouldTriggerDispatchError()
});

$application->run();
$this->assertStringContainsString(Application::ERROR_CONTROLLER_INVALID, $response->getContent());
$this->assertStringContainsString('bad', $response->getContent());
self::assertStringContainsString(Application::ERROR_CONTROLLER_INVALID, $response->getContent());
self::assertStringContainsString('bad', $response->getContent());
}
}
6 changes: 3 additions & 3 deletions test/Application/RoutingSuccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public function testRoutingIsExcecutedDuringRun()

$application->getEventManager()->attach(MvcEvent::EVENT_ROUTE, function ($e) use (&$log): void {
$match = $e->getRouteMatch();
$this->assertInstanceOf(RouteMatch::class, $match, 'Did not receive expected route match');
self::assertInstanceOf(RouteMatch::class, $match, 'Did not receive expected route match');
$log['route-match'] = $match;
}, -100);

$application->run();
$this->assertArrayHasKey('route-match', $log);
$this->assertInstanceOf(RouteMatch::class, $log['route-match']);
self::assertArrayHasKey('route-match', $log);
self::assertInstanceOf(RouteMatch::class, $log['route-match']);
}
}
Loading
Loading