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

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