Code Duplication    Length = 3-3 lines in 2 locations

Entity/Job.php 2 locations

@@ 289-291 (lines=3) @@
286
287
        switch ($this->state) {
288
            case self::STATE_NEW:
289
                if (!in_array($newState, array(self::STATE_PENDING, self::STATE_CANCELED), true)) {
290
                    throw new InvalidStateTransitionException($this, $newState, array(self::STATE_PENDING, self::STATE_CANCELED));
291
                }
292
293
                if (self::STATE_CANCELED === $newState) {
294
                    $this->closedAt = new \DateTime();
@@ 300-302 (lines=3) @@
297
                break;
298
299
            case self::STATE_PENDING:
300
                if (!in_array($newState, array(self::STATE_RUNNING, self::STATE_CANCELED), true)) {
301
                    throw new InvalidStateTransitionException($this, $newState, array(self::STATE_RUNNING, self::STATE_CANCELED));
302
                }
303
304
                if ($newState === self::STATE_RUNNING) {
305
                    $this->startedAt = new \DateTime();