HTMLPurifier_ConfigSchema::postProcess PHP Method

postProcess() public method

Replaces any stdclass that only has the type property with type integer.
public postProcess ( )
    public function postProcess()
    {
        foreach ($this->info as $key => $v) {
            if (count((array) $v) == 1) {
                $this->info[$key] = $v->type;
            } elseif (count((array) $v) == 2 && isset($v->allow_null)) {
                $this->info[$key] = -$v->type;
            }
        }
    }

Usage Example

コード例 #1
0
ファイル: ConfigSchema.php プロジェクト: gitanton/cono-rest
 public function build($interchange)
 {
     $schema = new HTMLPurifier_ConfigSchema();
     foreach ($interchange->directives as $d) {
         $schema->add($d->id->key, $d->default, $d->type, $d->typeAllowsNull);
         if ($d->allowed !== NULL) {
             $schema->addAllowedValues($d->id->key, $d->allowed);
         }
         foreach ($d->aliases as $alias) {
             $schema->addAlias($alias->key, $d->id->key);
         }
         if ($d->valueAliases !== NULL) {
             $schema->addValueAliases($d->id->key, $d->valueAliases);
         }
     }
     $schema->postProcess();
     return $schema;
 }