instance() public static method

public static instance ( $filename = null ) : XsdTypes
return XsdTypes
Ejemplo n.º 1
0
 /**
  * See http://php.net/manual/fr/language.oop5.typehinting.php for these cases
  * Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp
  * @param mixed $type
  * @param mixed $fallback
  * @return mixed
  */
 public static function getPhpType($type, $fallback = self::TYPE_STRING)
 {
     return XsdTypes::instance()->isXsd(str_replace('[]', '', $type)) ? XsdTypes::instance()->phpType($type) : $fallback;
 }
Ejemplo n.º 2
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testExceptionForUnexistingFile()
 {
     XsdTypes::instance(__DIR__ . '/../resources/bad_xsd_types');
 }