Code Duplication    Length = 14-14 lines in 2 locations

src/Core/Component/Blog/Application/Repository/DQL/PostRepository.php 1 location

@@ 67-80 (lines=14) @@
64
    /**
65
     * @return Post[]
66
     */
67
    public function findAll(array $orderByList = ['id' => 'DESC'], int $maxResults = null): ResultCollectionInterface
68
    {
69
        $this->dqlQueryBuilder->create(Post::class);
70
71
        foreach ($orderByList as $property => $direction) {
72
            $this->dqlQueryBuilder->orderBy('Post.' . $property, $direction);
73
        }
74
75
        if ($maxResults) {
76
            $this->dqlQueryBuilder->setMaxResults($maxResults);
77
        }
78
79
        return $this->queryService->query($this->dqlQueryBuilder->build());
80
    }
81
82
    /**
83
     * @return Post[]

src/Core/Component/User/Application/Repository/DQL/UserRepository.php 1 location

@@ 76-89 (lines=14) @@
73
    /**
74
     * @return User[]
75
     */
76
    public function findAll(array $orderByList = ['id' => 'DESC'], int $maxResults = null): ResultCollectionInterface
77
    {
78
        $this->dqlQueryBuilder->create(User::class);
79
80
        foreach ($orderByList as $property => $direction) {
81
            $this->dqlQueryBuilder->orderBy('User.' . $property, $direction);
82
        }
83
84
        if ($maxResults) {
85
            $this->dqlQueryBuilder->setMaxResults($maxResults);
86
        }
87
88
        return $this->queryService->query($this->dqlQueryBuilder->build());
89
    }
90
91
    public function findOneByUsername(string $username): User
92
    {