private function checkConformity(&$content, $id, $realNameId) {
        switch ($this->identifiersAi[$realNameId][self::KIND_OF_DATA]) {
            case self::NUMERIC:
                $content = str_replace(',', '.', $content);
                if (!preg_match("/^[0-9.]+$/", $content)) {
                    throw new CINParseException('gs1128', 'The value of "' . $id . '" must be numerical.');
                }

                break;
            case self::DATE_YYMMDD:
                $valid_date = true;
                if (preg_match("/^[0-9]{6}$/", $content)) {
                    $year = substr($content, 0, 2);
                    $month = substr($content, 2, 2);
                    $day = substr($content, 4, 2);

                    /* day can be 00 if we only need month and year */
                    if (intval($month) < 1 || intval($month) > 12 || intval($day) < 0 || intval($day) > 31) {
                        $valid_date = false;
                    }
                } else {
                    $valid_date = false;
                }

                if (!$valid_date) {
                    throw new CINParseException('gs1128', 'The value of "' . $id . '" must be in YYMMDD format.');
                }

                break;
        }

        // We check the length of the content
        $nbCharContent = strlen($content);
        $checksumChar = 0;
        $minlengthContent = $this->identifiersAi[$realNameId][self::MINLENGTH];
        $maxlengthContent = $this->identifiersAi[$realNameId][self::MAXLENGTH];

        if ($this->identifiersAi[$realNameId][self::CHECKSUM]) {
            $checksumChar++;
        }

        if ($nbCharContent < ($minlengthContent - $checksumChar)) {
            if ($minlengthContent === $maxlengthContent) {
                throw new CINParseException('gs1128', 'The value of "' . $id . '" must contain ' . $minlengthContent . ' character(s).');
            } else {
                throw new CINParseException('gs1128', 'The value of "' . $id . '" must contain between ' . $minlengthContent . ' and ' . $maxlengthContent . ' character(s).');
            }
        }

        return true;
    }
private function checkConformity(&$content, $id, $realNameId) {
        switch ($this->identifiersAi[$realNameId][self::KIND_OF_DATA]) {
            case self::NUMERIC:
                $content = str_replace(',', '.', $content);
                if (!preg_match("/^[0-9.]+$/", $content)) {
                    throw new CINParseException('gs1128', 'The value of "' . $id . '" must be numerical.');
                }

                break;
            case self::DATE_YYMMDD:
                $valid_date = true;
                if (preg_match("/^[0-9]{6}$/", $content)) {
                    $year = substr($content, 0, 2);
                    $month = substr($content, 2, 2);
                    $day = substr($content, 4, 2);

                    /* day can be 00 if we only need month and year */
                    if (intval($month) < 1 || intval($month) > 12 || intval($day) < 0 || intval($day) > 31) {
                        $valid_date = false;
                    }
                } else {
                    $valid_date = false;
                }

                if (!$valid_date) {
                    throw new CINParseException('gs1128', 'The value of "' . $id . '" must be in YYMMDD format.');
                }

                break;
        }

        // We check the length of the content
        $nbCharContent = strlen($content);
        $checksumChar = 0;
        $minlengthContent = $this->identifiersAi[$realNameId][self::MINLENGTH];
        $maxlengthContent = $this->identifiersAi[$realNameId][self::MAXLENGTH];

        if ($this->identifiersAi[$realNameId][self::CHECKSUM]) {
            $checksumChar++;
        }

        if ($nbCharContent < ($minlengthContent - $checksumChar)) {
            if ($minlengthContent === $maxlengthContent) {
                throw new CINParseException('gs1128', 'The value of "' . $id . '" must contain ' . $minlengthContent . ' character(s).');
            } else {
                throw new CINParseException('gs1128', 'The value of "' . $id . '" must contain between ' . $minlengthContent . ' and ' . $maxlengthContent . ' character(s).');
            }
        }

        return true;
    }
private function checkConformity ( & $ content , $ id , $ realNameId ) { switch ( $ this -> identifiersAi [ $ realNameId ] [ self :: KIND_OF_DATA ] ) { case self :: NUMERIC : $ content = str_replace ( ',' , '.' , $ content ) ; if ( ! preg_match ( "/^[0-9.]+$/" , $ content ) ) { throw new CINParseException ( 'gs1128' , 'The value of "' . $ id . '" must be numerical.' ) ; } break ; case self :: DATE_YYMMDD : $ valid_date = true ; if ( preg_match ( "/^[0-9]{6}$/" , $ content ) ) { $ year = substr ( $ content , 0 , 2 ) ; $ month = substr ( $ content , 2 , 2 ) ; $ day = substr ( $ content , 4 , 2 ) ; /* day can be 00 if we only need month and year */ if ( intval ( $ month ) < 1 || intval ( $ month ) > 12 || intval ( $ day ) < 0 || intval ( $ day ) > 31 ) { $ valid_date = false ; } } else { $ valid_date = false ; } if ( ! $ valid_date ) { throw new CINParseException ( 'gs1128' , 'The value of "' . $ id . '" must be in YYMMDD format.' ) ; } break ; } // We check the length of the content
 $ nbCharContent = strlen ( $ content ) ; $ checksumChar = 0 ; $ minlengthContent = $ this -> identifiersAi [ $ realNameId ] [ self :: MINLENGTH ] ; $ maxlengthContent = $ this -> identifiersAi [ $ realNameId ] [ self :: MAXLENGTH ] ; if ( $ this -> identifiersAi [ $ realNameId ] [ self :: CHECKSUM ] ) { $ checksumChar ++ ; } if ( $ nbCharContent < ( $ minlengthContent - $ checksumChar ) ) { if ( $ minlengthContent === $ maxlengthContent ) { throw new CINParseException ( 'gs1128' , 'The value of "' . $ id . '" must contain ' . $ minlengthContent . ' character(s).' ) ; } else { throw new CINParseException ( 'gs1128' , 'The value of "' . $ id . '" must contain between ' . $ minlengthContent . ' and ' . $ maxlengthContent . ' character(s).' ) ; } } return true ; }
Checks confirmity of the content.

@param string $content
@param string $id
@param string $realNameId
@return bool
Checks confirmity of the content .