Closed filippodicostanzo closed 4 years ago
Hello @filippodicostanzo
This error Fatal error: Uncaught TypeError: Argument 1 passed to Instagram\Api::__construct() must be an instance of Instagram\Storage\CacheManager
seems to be linked to old library ^5.x.
https://github.com/pgrimaud/instagram-user-feed/blob/5.6/src/Instagram/Api.php#L44
Could you :
😄
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Fatal error: Uncaught TypeError: Argument 1 passed to Instagram\Api::construct() must be an instance of Instagram\Storage\CacheManager or null, instance of Symfony\Component\Cache\Adapter\FilesystemAdapter given, called in C:\xamppp\htdocs\test.php on line 16 and defined in C:\xamppp\htdocs\vendor\pgrimaud\instagram-user-feed\src\Instagram\Api.php:44 Stack trace: #0 C:\xamppp\htdocs\test.php(16): Instagram\Api->construct(Object(Symfony\Component\Cache\Adapter\FilesystemAdapter)) #1 {main} thrown in C:\xamppp\htdocs\vendor\pgrimaud\instagram-user-feed\src\Instagram\Api.php on line 44
test.php `
declare(strict_types=1);
use Instagram\Api; use Instagram\Exception\InstagramException;
use Instagram\Model\User; use Psr\Cache\CacheException; use Symfony\Component\Cache\Adapter\FilesystemAdapter;
require './vendor/autoload.php';
$cachePool = new FilesystemAdapter('Instagram', 0, './cache');
try { $api = new Api($cachePool); $api->login("xxx", "cccc"); ... ... ... `
Version(s) affected: 6.3.1
Description
Fatal error: Uncaught TypeError: Argument 1 passed to Instagram\Api::__construct() must be an instance of Instagram\Storage\CacheManager, instance of Symfony\Component\Cache\Adapter\FilesystemAdapter given, called in Y:\php.localidautore.it\instagram-user-feed\index.php on line 29 and defined in Y:\php.localidautore.it\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Api.php:44
How to reproduce