public static function applyMaskPenaltyRule1(ByteMatrix $matrix) : int
    {
        return (
            self::applyMaskPenaltyRule1Internal($matrix, true)
            + self::applyMaskPenaltyRule1Internal($matrix, false)
        );
    }
public static function applyMaskPenaltyRule1(ByteMatrix $matrix) : int
    {
        return (
            self::applyMaskPenaltyRule1Internal($matrix, true)
            + self::applyMaskPenaltyRule1Internal($matrix, false)
        );
    }
public static function applyMaskPenaltyRule1 ( ByteMatrix $ matrix ) : int { return ( self :: applyMaskPenaltyRule1Internal ( $ matrix , true ) + self :: applyMaskPenaltyRule1Internal ( $ matrix , false ) ) ; }
Applies mask penalty rule 1 and returns the penalty.

Finds repetitive cells with the same color and gives penalty to them.
Example: 00000 or 11111.
Applies mask penalty rule 1 and returns the penalty .