Code Duplication    Length = 7-7 lines in 2 locations

src/AppBundle/Entity/Article.php 1 location

@@ 508-514 (lines=7) @@
505
     * @ORM\PrePersist()
506
     * @ORM\PreUpdate()
507
     */
508
    public function preUpload()
509
    {
510
        if (null !== $this->getFile()) {
511
            $filename = sha1(uniqid(mt_rand(), true));
512
            $this->picture = $filename.'.'.$this->getFile()->guessExtension();
513
        }
514
    }
515
516
    /**
517
     * @ORM\PostPersist()

src/AppBundle/Entity/User.php 1 location

@@ 499-505 (lines=7) @@
496
     * @ORM\PrePersist()
497
     * @ORM\PreUpdate()
498
     */
499
    public function preUpload()
500
    {
501
        if (null !== $this->getFile()) {
502
            $filename = sha1(uniqid(mt_rand(), true));
503
            $this->photo = $filename.'.'.$this->getFile()->guessExtension();
504
        }
505
    }
506
507
    /**
508
     * @ORM\PostPersist()