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

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