Skip to content

Conversation

@zlodes
Copy link
Contributor

@zlodes zlodes commented Jan 24, 2020

if (!$this->container) {
    $this->container = $this->factory->createExtendedContainer($this->resolver);
}

return $this->container;

Factory::createExtendedContainer() always returns Container instance:

/**
 * @inheritdoc
 */
public function createExtendedContainer(ResolverInterface $resolver)
{
    return new Container($this->container, $resolver);
}

This generates phpstan errors:

-------------------------------------------------------------------------
 Line   Base/Schema.php
-------------------------------------------------------------------------
  48     Cannot call method getAdapterByResourceType() on
         CloudCreativity\LaravelJsonApi\Contracts\ContainerInterface|null.
-------------------------------------------------------------------------

On this code:

/** @var Adapter $adapter */
$adapter = json_api()->getContainer()->getAdapterByResourceType(
    $this->resourceType
);

@zlodes zlodes requested a review from lindyhopchris January 24, 2020 12:44
@lindyhopchris lindyhopchris changed the base branch from master to develop January 29, 2020 09:14
@lindyhopchris lindyhopchris changed the base branch from develop to master January 29, 2020 09:15
@lindyhopchris lindyhopchris merged commit 47a9170 into cloudcreativity:master Jan 29, 2020
@lindyhopchris
Copy link
Member

Thanks!

@zlodes zlodes deleted the patch-1 branch January 29, 2020 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants