Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 507-529 (lines=23) @@
504
    /**
505
     * @return array
506
     */
507
    public static function getPasswordConstraints()
508
    {
509
        return
510
            array(
511
                new Assert\Length(array('min' => 5)),
512
                // Alpha numeric + "_" or "-"
513
                new Assert\Regex(array(
514
                        'pattern' => '/^[a-z\-_0-9]+$/i',
515
                        'htmlPattern' => '/^[a-z\-_0-9]+$/i')
516
                ),
517
                // Min 3 letters - not needed
518
                /*new Assert\Regex(array(
519
                    'pattern' => '/[a-z]{3}/i',
520
                    'htmlPattern' => '/[a-z]{3}/i')
521
                ),*/
522
                // Min 2 numbers
523
                new Assert\Regex(array(
524
                        'pattern' => '/[0-9]{2}/',
525
                        'htmlPattern' => '/[0-9]{2}/')
526
                ),
527
            )
528
            ;
529
    }
530
531
    /**
532
     * @param ClassMetadata $metadata

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

@@ 569-591 (lines=23) @@
566
    /**
567
     * @return array
568
     */
569
    public static function getPasswordConstraints()
570
    {
571
        return
572
            array(
573
                new Assert\Length(array('min' => 5)),
574
                // Alpha numeric + "_" or "-"
575
                new Assert\Regex(array(
576
                        'pattern' => '/^[a-z\-_0-9]+$/i',
577
                        'htmlPattern' => '/^[a-z\-_0-9]+$/i')
578
                ),
579
                // Min 3 letters - not needed
580
                /*new Assert\Regex(array(
581
                    'pattern' => '/[a-z]{3}/i',
582
                    'htmlPattern' => '/[a-z]{3}/i')
583
                ),*/
584
                // Min 2 numbers
585
                new Assert\Regex(array(
586
                        'pattern' => '/[0-9]{2}/',
587
                        'htmlPattern' => '/[0-9]{2}/')
588
                ),
589
            )
590
            ;
591
    }
592
593
    /**
594
     * @param ClassMetadata $metadata