Skip to content

Commit

Permalink
[Slim] Fix AbstractAuthenticator constructor TypeError (#2641)
Browse files Browse the repository at this point in the history
* Fix AbstractAuthenticator  constructor TypeError

* Refresh samples

* Remove container argument reassign

* Refresh samples
  • Loading branch information
ybelenko authored and wing328 committed Apr 13, 2019
1 parent 687b5aa commit c88b0a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,17 @@ class SlimRouter
/**
* Class constructor
*
* @param ContainerInterface|array $container Either a ContainerInterface or an associative array of app settings
* @param ContainerInterface|array $settings Either a ContainerInterface or an associative array of app settings
*
* @throws InvalidArgumentException When no container is provided that implements ContainerInterface
* @throws Exception When implementation class doesn't exists
*/
public function __construct($container = [])
public function __construct($settings = [])
{
$this->slimApp = new App($container);
$this->slimApp = new App($settings);
// middlewares requires Psr\Container\ContainerInterface
$container = $this->slimApp->getContainer();
{{#hasAuthMethods}}
$authPackage = '{{authPackage}}';
Expand Down
9 changes: 6 additions & 3 deletions samples/server/petstore/php-slim/lib/SlimRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,17 @@ class SlimRouter
/**
* Class constructor
*
* @param ContainerInterface|array $container Either a ContainerInterface or an associative array of app settings
* @param ContainerInterface|array $settings Either a ContainerInterface or an associative array of app settings
*
* @throws InvalidArgumentException When no container is provided that implements ContainerInterface
* @throws Exception When implementation class doesn't exists
*/
public function __construct($container = [])
public function __construct($settings = [])
{
$this->slimApp = new App($container);
$this->slimApp = new App($settings);

// middlewares requires Psr\Container\ContainerInterface
$container = $this->slimApp->getContainer();

$authPackage = 'OpenAPIServer\Auth';
$basicAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) {
Expand Down

0 comments on commit c88b0a1

Please sign in to comment.