Code Duplication    Length = 11-14 lines in 2 locations

src/Http/Controller/AssignmentsController.php 2 locations

@@ 35-48 (lines=14) @@
32
     * @param  StreamRepositoryInterface $streams
33
     * @return \Symfony\Component\HttpFoundation\Response
34
     */
35
    public function index(AssignmentTableBuilder $table, StreamRepositoryInterface $streams)
36
    {
37
        /* @var StreamInterface $stream */
38
        if (!$stream = $streams->find($this->route->parameter('stream'))) {
39
            $stream = $streams->findBySlugAndNamespace(
40
                $this->route->parameter('stream'),
41
                $this->getNamespace()
42
            );
43
        }
44
45
        return $table
46
            ->setStream($stream)
47
            ->render();
48
    }
49
50
    /**
51
     * Choose a field to assign.
@@ 112-122 (lines=11) @@
109
     * @param  StreamRepositoryInterface $streams
110
     * @return \Symfony\Component\HttpFoundation\Response
111
     */
112
    public function edit(AssignmentFormBuilder $builder, StreamRepositoryInterface $streams)
113
    {
114
        /* @var StreamInterface $stream */
115
        if (!$stream = $streams->find($this->route->parameter('stream'))) {
116
            $stream = $streams->findBySlugAndNamespace($this->route->parameter('stream'), $this->getNamespace());
117
        }
118
119
        return $builder
120
            ->setStream($stream)
121
            ->render($this->route->parameter('id'));
122
    }
123
124
    /**
125
     * Get the namespace.