• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 10618078048

29 Aug 2024 03:28PM UTC coverage: 7.687% (-0.003%) from 7.69%
10618078048

push

github

web-flow
fix(laravel): cache metadata, add trace on debug mode (#6555)

0 of 143 new or added lines in 8 files covered. (0.0%)

3 existing lines in 1 file now uncovered.

12488 of 162451 relevant lines covered (7.69%)

22.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Laravel/Metadata/CacheResourceCollectionMetadataFactory.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Laravel\Metadata;
15

16
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
17
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;
18
use Illuminate\Support\Facades\Cache;
19

20
final readonly class CacheResourceCollectionMetadataFactory implements ResourceMetadataCollectionFactoryInterface
21
{
22
    public function __construct(
23
        private ResourceMetadataCollectionFactoryInterface $decorated,
24
        private string $cacheStore
25
    ) {
NEW
26
    }
×
27

28
    public function create(string $resourceClass): ResourceMetadataCollection
29
    {
NEW
30
        return Cache::store($this->cacheStore)->rememberForever($resourceClass, function () use ($resourceClass) {
×
NEW
31
            return $this->decorated->create($resourceClass);
×
NEW
32
        });
×
33
    }
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc