Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions template/core/class_autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ abstract class <?php echo $coreFile; ?>
public static function register(): bool
{
if (!self::$_registered) {
self::$_registered = spl_autoload_register(__CLASS__ . '::loadClass');
self::$_registered = spl_autoload_register(self::class . '::loadClass');
}
return self::$_registered;
}

public static function unregister(): bool
{
if (self::$_registered) {
if (spl_autoload_unregister(__CLASS__ . '::loadClass')) {
if (spl_autoload_unregister(self::class . '::loadClass')) {
self::$_registered = false;
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions template/core/encoding/trait_xml_serialization_options.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function _setXMLFieldValueLocation(string $field, <?php echo $valueXMLLoc
throw new \DomainException(sprintf(
'Field "%s" on Type "%s" does not contain a value that is serializable as an attribute',
$field,
ltrim(substr(__CLASS__, (int)strrpos(__CLASS__, '\\')), '\\'),
ltrim(substr(self::class, (int)strrpos(self::class, '\\')), '\\'),
));
}
$this->_valueXMLLocations[$field] = $valueXMLLocation;
Expand All @@ -81,7 +81,7 @@ public function _getXMLFieldValueLocation(string $field): <?php echo $valueXMLLo
throw new \DomainException(sprintf(
'Field "%s" on Type "%s" does not contain a value that is serializable as an attribute',
$field,
ltrim(substr(__CLASS__, (int)strrpos(__CLASS__, '\\')), '\\'),
ltrim(substr(self::class, (int)strrpos(self::class, '\\')), '\\'),
));
}
return $this->_valueXMLLocations[$field];
Expand Down
4 changes: 2 additions & 2 deletions template/tests/core/class_test_autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ abstract class <?php echo $coreFile; ?>
public static function register(): bool
{
if (!self::$_registered) {
self::$_registered = spl_autoload_register(__CLASS__ . '::loadClass');
self::$_registered = spl_autoload_register(self::class . '::loadClass');
}
return self::$_registered;
}

public static function unregister(): bool
{
if (self::$_registered) {
if (spl_autoload_unregister(__CLASS__ . '::loadClass')) {
if (spl_autoload_unregister(self::class . '::loadClass')) {
self::$_registered = false;
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions template/versions/core/class_autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract class <?php echo PHPFHIR_CLASSNAME_AUTOLOADER; ?>
public static function register(): bool
{
if (!self::$_registered) {
self::$_registered = spl_autoload_register(__CLASS__ . '::loadClass', true);
self::$_registered = spl_autoload_register(self::class . '::loadClass', true);
}
return self::$_registered;
}
Expand All @@ -74,7 +74,7 @@ public static function register(): bool
public static function unregister(): bool
{
if (self::$_registered) {
if (spl_autoload_unregister(__CLASS__ . '::loadClass')) {
if (spl_autoload_unregister(self::class . '::loadClass')) {
self::$_registered = false;
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion template/versions/core/class_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function __construct(null|array|<?php echo $versionConfigInterface ?> $co
throw new \InvalidArgumentException(sprintf(
'$config must be an instance of \\%s, %s given',
<?php echo $versionConfigClass; ?>::class,
get_class($config)
$config::class
));
}
$this->_config = $config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ public static function jsonUnserialize(<?php if ($isResource) : ?>string|<?php e
if (isset($decoded-><?php echo PHPFHIR_JSON_FIELD_RESOURCE_TYPE; ?>) && $decoded-><?php echo PHPFHIR_JSON_FIELD_RESOURCE_TYPE; ?> !== static::FHIR_TYPE_NAME) {
throw new \DomainException(sprintf(
'%s::jsonUnserialize - Cannot unmarshal data for resource type "%s" into this type.',
ltrim(substr(__CLASS__, (int)strrpos(__CLASS__, '\\')), '\\'),
ltrim(substr(self::class, (int)strrpos(self::class, '\\')), '\\'),
$decoded-><?php echo PHPFHIR_JSON_FIELD_RESOURCE_TYPE; ?>,
));
}
$type = new static();
}<?php endif; ?> else if (!($type instanceof <?php echo $type->getClassName(); ?>)) {
throw new \RuntimeException(sprintf(
'%s::jsonUnserialize - $type must be instance of \\%s or null, %s seen.',
ltrim(substr(__CLASS__, (int)strrpos(__CLASS__, '\\')), '\\'),
ltrim(substr(self::class, (int)strrpos(self::class, '\\')), '\\'),
static::class,
get_class($type)
$type::class
));
}
<?php if ($isResource) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public static function xmlUnserialize(<?php if ($isResource) : ?>string|<?php en
}<?php endif; ?> else if (!($type instanceof <?php echo $type->getClassName(); ?>)) {
throw new \RuntimeException(sprintf(
'%s::xmlUnserialize - $type must be instance of \\%s or null, %s seen.',
ltrim(substr(__CLASS__, (int)strrpos(__CLASS__, '\\')), '\\'),
ltrim(substr(self::class, (int)strrpos(self::class, '\\')), '\\'),
static::class,
get_class($type)
$type::class
));
}
<?php if ($isResource) : ?>
Expand Down