Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Sep 10, 2012
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/AutoloaderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Zend\Loader;

use ReflectionClass;
use Traversable;

require_once __DIR__ . '/SplAutoloader.php';

Expand Down Expand Up @@ -74,7 +75,7 @@ public static function factory($options = null)
return;
}

if (!is_array($options) && !($options instanceof \Traversable)) {
if (!is_array($options) && !($options instanceof Traversable)) {
require_once __DIR__ . '/Exception/InvalidArgumentException.php';
throw new Exception\InvalidArgumentException(
'Options provided must be an array or Traversable'
Expand Down
8 changes: 6 additions & 2 deletions src/ClassMapAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

namespace Zend\Loader;

use Traversable;

// Grab SplAutoloader interface
require_once __DIR__ . '/SplAutoloader.php';

Expand Down Expand Up @@ -40,7 +42,7 @@ class ClassMapAutoloader implements SplAutoloader
*
* Create a new instance, and optionally configure the autoloader.
*
* @param null|array|\Traversable $options
* @param null|array|Traversable $options
*/
public function __construct($options = null)
{
Expand Down Expand Up @@ -73,6 +75,7 @@ public function setOptions($options)
* classname/file pairs.
*
* @param string|array $map
* @throws Exception\InvalidArgumentException
* @return ClassMapAutoloader
*/
public function registerAutoloadMap($map)
Expand Down Expand Up @@ -105,11 +108,12 @@ public function registerAutoloadMap($map)
* Register many autoload maps at once
*
* @param array $locations
* @throws Exception\InvalidArgumentException
* @return ClassMapAutoloader
*/
public function registerAutoloadMaps($locations)
{
if (!is_array($locations) && !($locations instanceof \Traversable)) {
if (!is_array($locations) && !($locations instanceof Traversable)) {
require_once __DIR__ . '/Exception/InvalidArgumentException.php';
throw new Exception\InvalidArgumentException('Map list must be an array or implement Traversable');
}
Expand Down
9 changes: 6 additions & 3 deletions src/ModuleAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ public function unregister()
* registerPaths
*
* @param array|Traversable $paths
* @return ModuleLoader
* @throws \InvalidArgumentException
* @return ModuleAutoloader
*/
public function registerPaths($paths)
{
Expand All @@ -289,8 +290,9 @@ public function registerPaths($paths)
* registerPath
*
* @param string $path
* @param string $moduleName
* @return ModuleLoader
* @param bool|string $moduleName
* @throws \InvalidArgumentException
* @return ModuleAutoloader
*/
public function registerPath($path, $moduleName = false)
{
Expand Down Expand Up @@ -339,6 +341,7 @@ protected function pharFileToModuleName($pharPath)
* Normalize a path for insertion in the stack
*
* @param string $path
* @param bool $trailingSlash Whether trailing slash should be included
* @return string
*/
public static function normalizePath($path, $trailingSlash = true)
Expand Down
3 changes: 2 additions & 1 deletion src/PluginClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function __construct($map = null)
* A null value will clear the static map.
*
* @param null|array|Traversable $map
* @throws Exception\InvalidArgumentException
* @return void
*/
public static function addStaticMap($map)
Expand Down Expand Up @@ -211,7 +212,7 @@ public function load($name)
* Returns an instance of ArrayIterator, containing a map of
* all plugins
*
* @return Iterator
* @return ArrayIterator
*/
public function getIterator()
{
Expand Down
2 changes: 2 additions & 0 deletions src/PluginClassLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

namespace Zend\Loader;

use Traversable;

/**
* Plugin class locator interface
*
Expand Down
4 changes: 3 additions & 1 deletion src/SplAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

namespace Zend\Loader;

use Traversable;

if (interface_exists('Zend\Loader\SplAutoloader')) return;

/**
Expand All @@ -25,7 +27,7 @@ interface SplAutoloader
*
* Allow configuration of the autoloader via the constructor.
*
* @param null|array|\Traversable $options
* @param null|array|Traversable $options
*/
public function __construct($options = null);

Expand Down
3 changes: 3 additions & 0 deletions src/StandardAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function __construct($options = null)
* </code>
*
* @param array|\Traversable $options
* @throws Exception\InvalidArgumentException
* @return StandardAutoloader
*/
public function setOptions($options)
Expand Down Expand Up @@ -153,6 +154,7 @@ public function registerNamespace($namespace, $directory)
* Register many namespace/directory pairs at once
*
* @param array $namespaces
* @throws Exception\InvalidArgumentException
* @return StandardAutoloader
*/
public function registerNamespaces($namespaces)
Expand Down Expand Up @@ -186,6 +188,7 @@ public function registerPrefix($prefix, $directory)
* Register many namespace/directory pairs at once
*
* @param array $prefixes
* @throws Exception\InvalidArgumentException
* @return StandardAutoloader
*/
public function registerPrefixes($prefixes)
Expand Down

0 comments on commit 8243aea

Please sign in to comment.