Code Duplication    Length = 23-23 lines in 2 locations

src/Chamilo/PageBundle/Entity/User.php 1 location

@@ 485-507 (lines=23) @@
482
    /**
483
     * @return array
484
     */
485
    public static function getPasswordConstraints()
486
    {
487
        return
488
            array(
489
                new Assert\Length(array('min' => 5)),
490
                // Alpha numeric + "_" or "-"
491
                new Assert\Regex(array(
492
                        'pattern' => '/^[a-z\-_0-9]+$/i',
493
                        'htmlPattern' => '/^[a-z\-_0-9]+$/i')
494
                ),
495
                // Min 3 letters - not needed
496
                /*new Assert\Regex(array(
497
                    'pattern' => '/[a-z]{3}/i',
498
                    'htmlPattern' => '/[a-z]{3}/i')
499
                ),*/
500
                // Min 2 numbers
501
                new Assert\Regex(array(
502
                        'pattern' => '/[0-9]{2}/',
503
                        'htmlPattern' => '/[0-9]{2}/')
504
                ),
505
            )
506
            ;
507
    }
508
509
    /**
510
     * @param ClassMetadata $metadata

src/Chamilo/UserBundle/Entity/User.php 1 location

@@ 610-632 (lines=23) @@
607
    /**
608
     * @return array
609
     */
610
    public static function getPasswordConstraints()
611
    {
612
        return
613
            array(
614
                new Assert\Length(array('min' => 5)),
615
                // Alpha numeric + "_" or "-"
616
                new Assert\Regex(array(
617
                        'pattern' => '/^[a-z\-_0-9]+$/i',
618
                        'htmlPattern' => '/^[a-z\-_0-9]+$/i')
619
                ),
620
                // Min 3 letters - not needed
621
                /*new Assert\Regex(array(
622
                    'pattern' => '/[a-z]{3}/i',
623
                    'htmlPattern' => '/[a-z]{3}/i')
624
                ),*/
625
                // Min 2 numbers
626
                new Assert\Regex(array(
627
                        'pattern' => '/[0-9]{2}/',
628
                        'htmlPattern' => '/[0-9]{2}/')
629
                ),
630
            )
631
            ;
632
    }
633
634
    /**
635
     * @param ClassMetadata $metadata