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

@@ 897-914 (lines=18) @@
894
                    'Y-m-d H:i:s',
895
                    strtotime($nodeVersion->getUpdated()->format('Y-m-d H:i:s'))
896
                );
897
                if ($thresholdDate >= $updatedDate || $nodeVersionIsLocked) {
898
                    $page = $nodeVersion->getRef($this->em);
899
                    if ($nodeVersion === $nodeTranslation->getPublicNodeVersion()) {
900
                        $this->nodePublisher
901
                            ->createPublicVersion(
902
                                $page,
903
                                $nodeTranslation,
904
                                $nodeVersion,
905
                                $this->user
906
                            );
907
                    } else {
908
                        $this->createDraftVersion(
909
                            $page,
910
                            $nodeTranslation,
911
                            $nodeVersion
912
                        );
913
                    }
914
                }
915
            }
916
            $page = $nodeVersion->getRef($this->em);
917
        }