diff options
author | Thomas Lange <code@nerdmind.de> | 2018-01-26 00:58:15 +0100 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2018-01-26 14:00:00 +0100 |
commit | aa8b6c982673f3c2ffcb27cdada534c7acdf302b (patch) | |
tree | 38775e3c8502e402c244848836c6dfdac2553292 /include/classes | |
parent | 061f6f9e1a3c038b6fe7ff9f9de14afd0962894b (diff) | |
download | bigpipe-aa8b6c982673f3c2ffcb27cdada534c7acdf302b.tar.gz bigpipe-aa8b6c982673f3c2ffcb27cdada534c7acdf302b.tar.xz bigpipe-aa8b6c982673f3c2ffcb27cdada534c7acdf302b.zip |
Remove static $count property and use spl_object_hash() instead
Diffstat (limited to 'include/classes')
-rw-r--r-- | include/classes/BigPipe/Pagelet.php | 3 | ||||
-rw-r--r-- | include/classes/BigPipe/Resource.php | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/include/classes/BigPipe/Pagelet.php b/include/classes/BigPipe/Pagelet.php index 101ec34..441c520 100644 --- a/include/classes/BigPipe/Pagelet.php +++ b/include/classes/BigPipe/Pagelet.php @@ -16,7 +16,6 @@ class Pagelet extends Item { private $dependencies = []; private $tagname = 'div'; private $tagHTML = ''; - private static $count = 0; #=============================================================================== # Priorities for pagelet sorting @@ -37,7 +36,7 @@ class Pagelet extends Item { const PHASE_DONE = 4; # After the static JS code has been executed public function __construct($customID = NULL, $priority = self::PRIORITY_NORMAL) { - $this->ID = $customID ?? 'P'.++self::$count; + $this->ID = $customID ?? spl_object_hash($this); $this->priority = $priority; $this->resources = array_pad($this->resources, 2, []); diff --git a/include/classes/BigPipe/Resource.php b/include/classes/BigPipe/Resource.php index 4711d48..2ba216d 100644 --- a/include/classes/BigPipe/Resource.php +++ b/include/classes/BigPipe/Resource.php @@ -11,7 +11,6 @@ namespace BigPipe; abstract class Resource extends Item { private $type = ''; private $resourceURL = ''; - private static $count = 0; #=============================================================================== # Render resource HTML for disabled pipeline @@ -35,7 +34,7 @@ abstract class Resource extends Item { # Build resource #=============================================================================== public function __construct($customID = NULL, $type, $resourceURL) { - $this->ID = $customID ?? 'R'.++self::$count; + $this->ID = $customID ?? spl_object_hash($this); $this->type = $type; $this->resourceURL = $resourceURL; |