Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding namespace prep to new JData package

  • Loading branch information...
commit c1e796893008ee70f69a0f577614384890b534d9 1 parent 21387e7
@dongilbert authored
View
16 libraries/joomla/data/data.php
@@ -17,7 +17,7 @@
* @subpackage Data
* @since 12.3
*/
-class JData implements JDataDumpable, IteratorAggregate, JsonSerializable, Countable
+class JData implements \JDataDumpable, \IteratorAggregate, \JsonSerializable, \Countable
{
/**
* The data properties.
@@ -130,11 +130,11 @@ public function bind($properties, $updateNulls = true)
// Check the properties data type.
if (!is_array($properties) && !is_object($properties))
{
- throw new InvalidArgumentException(sprintf('%s(%s)', __METHOD__, gettype($properties)));
+ throw new \InvalidArgumentException(sprintf('%s(%s)', __METHOD__, gettype($properties)));
}
// Check if the object is traversable.
- if ($properties instanceof Traversable)
+ if ($properties instanceof \Traversable)
{
// Convert iterator to array.
$properties = iterator_to_array($properties);
@@ -174,19 +174,19 @@ public function bind($properties, $updateNulls = true)
*
* @since 12.3
*/
- public function dump($depth = 3, SplObjectStorage $dumped = null)
+ public function dump($depth = 3, \SplObjectStorage $dumped = null)
{
// Check if we should initialise the recursion tracker.
if ($dumped === null)
{
- $dumped = new SplObjectStorage;
+ $dumped = new \SplObjectStorage;
}
// Add this object to the dumped stack.
$dumped->attach($this);
// Setup a container.
- $dump = new stdClass;
+ $dump = new \stdClass;
// Dump all object properties.
foreach (array_keys($this->_properties) as $property)
@@ -210,7 +210,7 @@ public function dump($depth = 3, SplObjectStorage $dumped = null)
*/
public function getIterator()
{
- return new ArrayIterator($this->dump(0));
+ return new \ArrayIterator($this->dump(0));
}
/**
@@ -239,7 +239,7 @@ public function jsonSerialize()
*
* @since 12.3
*/
- protected function dumpProperty($property, $depth, SplObjectStorage $dumped)
+ protected function dumpProperty($property, $depth, \SplObjectStorage $dumped)
{
$value = $this->getProperty($property);
View
2  libraries/joomla/data/dumpable.php
@@ -30,5 +30,5 @@
*
* @since 12.3
*/
- public function dump($depth = 3, SplObjectStorage $dumped = null);
+ public function dump($depth = 3, \SplObjectStorage $dumped = null);
}
View
8 libraries/joomla/data/set.php
@@ -17,7 +17,7 @@
* @subpackage Data
* @since 12.3
*/
-class JDataSet implements JDataDumpable, ArrayAccess, Countable, Iterator
+class JDataSet implements JDataDumpable, \ArrayAccess, \Countable, \Iterator
{
/**
* The current position of the iterator.
@@ -226,12 +226,12 @@ public function current()
* @see JData::dump()
* @since 12.3
*/
- public function dump($depth = 3, SplObjectStorage $dumped = null)
+ public function dump($depth = 3, \SplObjectStorage $dumped = null)
{
// Check if we should initialise the recursion tracker.
if ($dumped === null)
{
- $dumped = new SplObjectStorage;
+ $dumped = new \SplObjectStorage;
}
// Add this object to the dumped stack.
@@ -371,7 +371,7 @@ public function offsetSet($offset, $object)
// Check if the object is a JData object.
if (!($object instanceof JData))
{
- throw new InvalidArgumentException(sprintf('%s("%s", *%s*)', __METHOD__, $offset, gettype($object)));
+ throw new \InvalidArgumentException(sprintf('%s("%s", *%s*)', __METHOD__, $offset, gettype($object)));
}
// Set the offset.
Please sign in to comment.
Something went wrong with that request. Please try again.