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

@@ 1012-1029 (lines=18) @@
1009
                    'Y-m-d H:i:s',
1010
                    strtotime($nodeVersion->getUpdated()->format('Y-m-d H:i:s'))
1011
                );
1012
                if ($thresholdDate >= $updatedDate || $nodeVersionIsLocked) {
1013
                    $page = $nodeVersion->getRef($this->em);
1014
                    if ($nodeVersion === $nodeTranslation->getPublicNodeVersion()) {
1015
                        $this->nodePublisher
1016
                            ->createPublicVersion(
1017
                                $page,
1018
                                $nodeTranslation,
1019
                                $nodeVersion,
1020
                                $this->user
1021
                            );
1022
                    } else {
1023
                        $this->createDraftVersion(
1024
                            $page,
1025
                            $nodeTranslation,
1026
                            $nodeVersion
1027
                        );
1028
                    }
1029
                }
1030
            }
1031
            $page = $nodeVersion->getRef($this->em);
1032
        }