Page MenuHomeCode

ValueRepresentation.php
No OneTemporary

ValueRepresentation.php

<?php
declare(strict_types=1);
namespace Zed\Engines\API\Format;
enum ValueRepresentation {
///
/// Possible values
///
/**
* Representation as XML tags with generic key
*/
case List;
/**
* Representation as XML tags matching keys
*/
case Object;
/**
* Direct representation as string
*/
case Scalar;
///
/// Helper methods
///
public static function from (mixed $value) : self {
if (is_object($value)) {
return self::Object;
}
if (is_array($value)) {
if (array_is_list($value)) {
return self::List;
}
return self::Object;
}
return self::Scalar;
}
}

File Metadata

Mime Type
text/x-php
Expires
Thu, Jul 10, 23:27 (4 w, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
21314
Default Alt Text
ValueRepresentation.php (751 B)

Event Timeline