Code Duplication    Length = 17-17 lines in 2 locations

src/Hypermedia/ContextBuilder.php 1 location

@@ 82-98 (lines=17) @@
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function getEntrypointContext(int $referenceType = UrlGeneratorInterface::ABS_PATH) : array
83
    {
84
        $context = $this->getBaseContext($referenceType);
85
86
        foreach ($this->resourceNameCollectionFactory->create() as $resourceClass) {
87
            $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
88
89
            $resourceName = lcfirst($resourceMetadata->getShortName());
90
91
            $context[$resourceName] = [
92
                '@id' => 'Entrypoint/'.$resourceName,
93
                '@type' => '@id',
94
            ];
95
        }
96
97
        return $context;
98
    }
99
100
    /**
101
     * {@inheritdoc}

src/JsonLd/ContextBuilder.php 1 location

@@ 66-82 (lines=17) @@
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function getEntrypointContext(int $referenceType = UrlGeneratorInterface::ABS_PATH) : array
67
    {
68
        $context = $this->getBaseContext($referenceType);
69
70
        foreach ($this->resourceNameCollectionFactory->create() as $resourceClass) {
71
            $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
72
73
            $resourceName = lcfirst($resourceMetadata->getShortName());
74
75
            $context[$resourceName] = [
76
                '@id' => 'Entrypoint/'.$resourceName,
77
                '@type' => '@id',
78
            ];
79
        }
80
81
        return $context;
82
    }
83
84
    /**
85
     * {@inheritdoc}