Code Duplication    Length = 18-18 lines in 2 locations

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

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

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

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