Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Closed
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
29 changes: 20 additions & 9 deletions library/Zend/ModuleManager/Listener/ConfigListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,14 @@ protected function addConfigPaths($paths, $type)

if (!is_array($paths)) {
throw new Exception\InvalidArgumentException(
sprintf('Argument passed to %::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__, __METHOD__, gettype($paths))
sprintf(
'Argument passed to %::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__,
__METHOD__,
gettype($paths)
)
);
}

Expand All @@ -310,8 +314,12 @@ protected function addConfigPath($path, $type)
{
if (!is_string($path)) {
throw new Exception\InvalidArgumentException(
sprintf('Parameter to %s::%s() must be a string; %s given.',
__CLASS__, __METHOD__, gettype($path))
sprintf(
'Parameter to %s::%s() must be a string; %s given.',
__CLASS__,
__METHOD__,
gettype($path)
)
);
}
$this->paths[] = array('type' => $type, 'path' => $path);
Expand All @@ -332,9 +340,12 @@ protected function addConfig($key, $config)

if (!is_array($config)) {
throw new Exception\InvalidArgumentException(
sprintf('Config being merged must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.', gettype($config))
sprintf(
'Config being merged must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
gettype($config)
)
);
}

Expand Down
48 changes: 32 additions & 16 deletions library/Zend/ModuleManager/Listener/ListenerOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ public function setModulePaths($modulePaths)
{
if (!is_array($modulePaths) && !$modulePaths instanceof Traversable) {
throw new Exception\InvalidArgumentException(
sprintf('Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__, __METHOD__, gettype($modulePaths))
sprintf(
'Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__,
__METHOD__,
gettype($modulePaths)
)
);
}

Expand Down Expand Up @@ -130,10 +134,14 @@ public function setConfigGlobPaths($configGlobPaths)
{
if (!is_array($configGlobPaths) && !$configGlobPaths instanceof Traversable) {
throw new Exception\InvalidArgumentException(
sprintf('Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__, __METHOD__, gettype($configGlobPaths))
sprintf(
'Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__,
__METHOD__,
gettype($configGlobPaths)
)
);
}

Expand All @@ -152,10 +160,14 @@ public function setConfigStaticPaths($configStaticPaths)
{
if (!is_array($configStaticPaths) && !$configStaticPaths instanceof Traversable) {
throw new Exception\InvalidArgumentException(
sprintf('Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__, __METHOD__, gettype($configStaticPaths))
sprintf(
'Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__,
__METHOD__,
gettype($configStaticPaths)
)
);
}

Expand Down Expand Up @@ -185,10 +197,14 @@ public function setExtraConfig($extraConfig)
{
if (!is_array($extraConfig) && !$extraConfig instanceof Traversable) {
throw new Exception\InvalidArgumentException(
sprintf('Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__, __METHOD__, gettype($extraConfig))
sprintf(
'Argument passed to %s::%s() must be an array, '
. 'implement the Traversable interface, or be an '
. 'instance of Zend\Config\Config. %s given.',
__CLASS__,
__METHOD__,
gettype($extraConfig)
)
);
}

Expand Down
22 changes: 14 additions & 8 deletions library/Zend/ModuleManager/ModuleEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ public function getModuleName()
public function setModuleName($moduleName)
{
if (!is_string($moduleName)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string as an argument; %s provided'
,__METHOD__, gettype($moduleName)
));
throw new Exception\InvalidArgumentException(
sprintf(
'%s expects a string as an argument; %s provided',
__METHOD__,
gettype($moduleName)
)
);
}
// Performance tweak, don't add it as param.
$this->moduleName = $moduleName;
Expand Down Expand Up @@ -92,10 +95,13 @@ public function getModule()
public function setModule($module)
{
if (!is_object($module)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a module object as an argument; %s provided'
,__METHOD__, gettype($module)
));
throw new Exception\InvalidArgumentException(
sprintf(
'%s expects a module object as an argument; %s provided',
__METHOD__,
gettype($module)
)
);
}
// Performance tweak, don't add it as param.
$this->module = $module;
Expand Down
11 changes: 7 additions & 4 deletions library/Zend/ModuleManager/ModuleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,13 @@ public function setModules($modules)
if (is_array($modules) || $modules instanceof Traversable) {
$this->modules = $modules;
} else {
throw new Exception\InvalidArgumentException(sprintf(
'Parameter to %s\'s %s method must be an array or implement the Traversable interface',
__CLASS__, __METHOD__
));
throw new Exception\InvalidArgumentException(
sprintf(
'Parameter to %s\'s %s method must be an array or implement the Traversable interface',
__CLASS__,
__METHOD__
)
);
}
return $this;
}
Expand Down