<?php
namespace nur\ldap\syntaxes;

use nur\data\types\Metadata;
use nur\php\Autogen;

class cvalues {
  static function autogen_properties(array $schema): array {
    $md = Metadata::with($schema);
    $properties = [];
    foreach ($md->getKeys() as $key) {
      $type = $md->getType($key);
      [$phpType, $returnType] = Autogen::fix_type($type->getPhpType());
      $properties[] = "$returnType \$$key";
    }
    return $properties;
  }
}