Code Duplication    Length = 14-15 lines in 2 locations

src/Entity/Capture.php 2 locations

@@ 145-158 (lines=14) @@
142
     *
143
     * @return \Acquia\LiftClient\Entity\Capture
144
     */
145
    public function setEventDate(DateTime $eventDate)
146
    {
147
        // Lift Profile Manager is currently accepting this ISO 8601 format:
148
        // "2017-02-07T19:59:53.123Z" (or "2017-02-07T19:59:53.000Z" pre 7.0 ).
149
        // todo: the above comment needs updating
150
        // todo: works for all but hhvm-3.18.5
151
        $format = 'Y-m-d\TH:i:s.v\Z';
152
        if (version_compare(phpversion(), '7.0', '<')) {
153
            $format = 'Y-m-d\TH:i:s.000\Z';
154
        }
155
        $this['event_date'] = $eventDate->format($format);
156
157
        return $this;
158
    }
159
160
    /**
161
     * Sets the 'identities' parameter.
@@ 934-948 (lines=15) @@
931
     *
932
     * @return \Acquia\LiftClient\Entity\Capture
933
     */
934
    public function setPublishedDate(DateTime $publishedDate)
935
    {
936
        // Lift Profile Manager is currently accepting this ISO 8601 format:
937
        // "2017-02-07T19:59:53.123456Z".
938
        // "2017-02-07T19:59:53.123Z" (or "2017-02-07T19:59:53.000Z" pre 7.0 ).
939
        // todo: the above comment needs updating
940
        // todo: works for all but hhvm-3.18.5
941
        $format = 'Y-m-d\TH:i:s.v\Z';
942
        if (version_compare(phpversion(), '7.0', '<')) {
943
            $format = 'Y-m-d\TH:i:s.000\Z';
944
        }
945
        $this['published_date'] = $publishedDate->format($format);
946
947
        return $this;
948
    }
949
}
950