Code Duplication    Length = 18-18 lines in 2 locations

src/Kunstmaan/NodeBundle/Helper/NodeHelper.php 1 location

@@ 125-142 (lines=18) @@
122
        $thresholdDate = date('Y-m-d H:i:s', time() - $nodeVersionTimeout);
123
        $updatedDate = date('Y-m-d H:i:s', strtotime($nodeVersion->getUpdated()->format('Y-m-d H:i:s')));
124
125
        if ($thresholdDate >= $updatedDate || $nodeVersionIsLocked) {
126
            $page = $nodeVersion->getRef($this->em);
127
            if ($nodeVersion === $nodeTranslation->getPublicNodeVersion()) {
128
                $this->nodeAdminPublisher
129
                    ->createPublicVersion(
130
                        $page,
131
                        $nodeTranslation,
132
                        $nodeVersion,
133
                        $user
134
                    );
135
            } else {
136
                $this->createDraftVersion(
137
                    $page,
138
                    $nodeTranslation,
139
                    $nodeVersion
140
                );
141
            }
142
        }
143
    }
144
145
    /**

src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php 1 location

@@ 866-883 (lines=18) @@
863
                    'Y-m-d H:i:s',
864
                    strtotime($nodeVersion->getUpdated()->format('Y-m-d H:i:s'))
865
                );
866
                if ($thresholdDate >= $updatedDate || $nodeVersionIsLocked) {
867
                    $page = $nodeVersion->getRef($this->em);
868
                    if ($nodeVersion === $nodeTranslation->getPublicNodeVersion()) {
869
                        $this->nodePublisher
870
                            ->createPublicVersion(
871
                                $page,
872
                                $nodeTranslation,
873
                                $nodeVersion,
874
                                $this->user
875
                            );
876
                    } else {
877
                        $this->createDraftVersion(
878
                            $page,
879
                            $nodeTranslation,
880
                            $nodeVersion
881
                        );
882
                    }
883
                }
884
            }
885
            $page = $nodeVersion->getRef($this->em);
886
        }