pub
logo
Facebook Instagram Youtube
Warning: foreach() argument must be of type array|object, int given (500 Internal Server Error)

Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Warning: foreach() argument must be of type array|object, int given

Exception

ErrorException

  1.             if ($count 3) {
  2.                 $count 3;
  3.             }
  4.             $keys array_rand($recommandations$count);
  5.             $data = [];
  6.             foreach ($keys as $key) {
  7.                 $data[] = $recommandations[$key];
  8.             }
  9.             return $data;
  10.         });
in /home/visitmp/vendor/symfony/cache/LockRegistry.php -> VisitMarche\ThemeTail\Lib\{closure} (line 112)
  1.                 if ($locked || !$wouldBlock) {
  2.                     $logger?->info(sprintf('Lock %s, now computing item "{key}"'$locked 'acquired' 'not supported'), ['key' => $item->getKey()]);
  3.                     self::$lockedFiles[$key] = true;
  4.                     $value $callback($item$save);
  5.                     if ($save) {
  6.                         if ($setMetadata) {
  7.                             $setMetadata($item);
  8.                         }
  1.             }
  2.             try {
  3.                 $value = ($this->callbackWrapper)($callback$item$save$pool, function (CacheItem $item) use ($setMetadata$startTime, &$metadata) {
  4.                     $setMetadata($item$startTime$metadata);
  5.                 }, $this->logger ?? null);
  6.                 $setMetadata($item$startTime$metadata);
  7.                 return $value;
  8.             } finally {
  9.                 unset($this->computing[$key]);
in /home/visitmp/vendor/symfony/cache-contracts/CacheTrait.php -> Symfony\Component\Cache\Traits\{closure} (line 70)
  1.             }
  2.         }
  3.         if ($recompute) {
  4.             $save true;
  5.             $item->set($callback($item$save));
  6.             if ($save) {
  7.                 $pool->save($item);
  8.             }
  9.         }
  1.                 return $value;
  2.             } finally {
  3.                 unset($this->computing[$key]);
  4.             }
  5.         }, $beta$metadata$this->logger ?? null);
  6.     }
  7. }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function get(string $key, callable $callbackfloat $beta null, array &$metadata null): mixed
  5.     {
  6.         return $this->doGet($this$key$callback$beta$metadata);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      */
AbstractAdapter->get('see_also_offre-ald-01-08h4-0key-9', object(Closure)) in /home/visitmp/www/wp-content/themes/visittail/Lib/WpRepository.php (line 366)
  1.             foreach ($keys as $key) {
  2.                 $data[] = $recommandations[$key];
  3.             }
  4.             return $data;
  5.         });
  6.     }
  7.     public function getEvents(bool $removeObsolete trueTypeOffre $typeOffre null): array
  8.     {
  9.         $pivotRepository PivotContainer::getPivotRepository(WP_DEBUG);
WpRepository->recommandationsByOffre(object(Offre), object(WP_Term), 'fr') in /home/visitmp/www/wp-content/themes/visittail/single-offre.php (line 56)
  1. $postUtils = new PostUtils();
  2. $postUtils->tagsOffre($offre$language$urlcurrentCategory);
  3. //todo heberg pas de categories
  4. //$offre->categories;
  5. $recommandations $wpRepository->recommandationsByOffre($offre$currentCategory$language);
  6. foreach ($offre->pois as $poi) {
  7.     $poi->url RouterPivot::getUrlOffre($poi$currentCategory->cat_ID);
  8.     $poi->image $poi->firstImage();
  9.     $postUtils->tagsOffre($poi$language$urlcurrentCategory);
include('/home/visitmp/www/wp-content/themes/visittail/single-offre.php') in /home/visitmp/www/wp-includes/template-loader.php (line 106)
  1.      *
  2.      * @param string $template The path of the template to include.
  3.      */
  4.     $template apply_filters'template_include'$template );
  5.     if ( $template ) {
  6.         include $template;
  7.     } elseif ( current_user_can'switch_themes' ) ) {
  8.         $theme wp_get_theme();
  9.         if ( $theme->errors() ) {
  10.             wp_die$theme->errors() );
  11.         }
require_once('/home/visitmp/www/wp-includes/template-loader.php') in /home/visitmp/www/wp-blog-header.php (line 19)
  1.     // Set up the WordPress query.
  2.     wp();
  3.     // Load the theme template.
  4.     require_once ABSPATH WPINC '/template-loader.php';
  5. }
require('/home/visitmp/www/wp-blog-header.php') in /home/visitmp/www/index.php (line 17)
  1.  * @var bool
  2.  */
  3. define'WP_USE_THEMES'true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ '/wp-blog-header.php';

Stack Trace

ErrorException
ErrorException:
Warning: foreach() argument must be of type array|object, int given

  at /home/visitmp/www/wp-content/themes/visittail/Lib/WpRepository.php:361
  at VisitMarche\ThemeTail\Lib\WpRepository->VisitMarche\ThemeTail\Lib\{closure}(object(CacheItem), true)
     (/home/visitmp/vendor/symfony/cache/LockRegistry.php:112)
  at Symfony\Component\Cache\LockRegistry::compute(object(Closure), object(CacheItem), true, object(FilesystemAdapter), object(Closure), null)
     (/home/visitmp/vendor/symfony/cache/Traits/ContractsTrait.php:106)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->Symfony\Component\Cache\Traits\{closure}(object(CacheItem), true)
     (/home/visitmp/vendor/symfony/cache-contracts/CacheTrait.php:70)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->contractsGet(object(FilesystemAdapter), 'see_also_offre-ald-01-08h4-0key-9', object(Closure), 1.0, array(), null)
     (/home/visitmp/vendor/symfony/cache/Traits/ContractsTrait.php:113)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->doGet(object(FilesystemAdapter), 'see_also_offre-ald-01-08h4-0key-9', object(Closure), 1.0, array())
     (/home/visitmp/vendor/symfony/cache-contracts/CacheTrait.php:33)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->get('see_also_offre-ald-01-08h4-0key-9', object(Closure))
     (/home/visitmp/www/wp-content/themes/visittail/Lib/WpRepository.php:366)
  at VisitMarche\ThemeTail\Lib\WpRepository->recommandationsByOffre(object(Offre), object(WP_Term), 'fr')
     (/home/visitmp/www/wp-content/themes/visittail/single-offre.php:56)
  at include('/home/visitmp/www/wp-content/themes/visittail/single-offre.php')
     (/home/visitmp/www/wp-includes/template-loader.php:106)
  at require_once('/home/visitmp/www/wp-includes/template-loader.php')
     (/home/visitmp/www/wp-blog-header.php:19)
  at require('/home/visitmp/www/wp-blog-header.php')
     (/home/visitmp/www/index.php:17)