Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix undefined classes, constants and methods #6094

Closed
wants to merge 3 commits into from

3 participants

@micheh

This pull request fixes undefined classes in phpDoc and one undefined class constant. In addition, the visibility for some methods was increased to protected as those methods were called with static.

Michel Hunziker added some commits
library/Zend/Ldap/Attribute.php
@@ -179,7 +179,7 @@ public static function removeFromAttribute(array &$data, $attribName, $value)
* @param mixed $value
* @return string|null
*/
- private static function valueToLdap($value)
+ protected static function valueToLdap($value)
@Ocramius Collaborator
Ocramius added a note

Are these methods called statically only from within the class? Because I'd simply change the static:: calls to self:: calls instead of increasing visibility

@micheh
micheh added a note

Yes. But in my opinion these methods would be useful in possible subclasses anyway (e.g. if you want to change the conversion). Therefore I preferred the increased visibility.

@Ocramius Collaborator
Ocramius added a note

I'd personally disallow inheritance usage here unless there's a very strong use-case for it - if you don't have it, then changing static:: to self:: is preferable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Ocramius Ocramius self-assigned this
@Ocramius Ocramius added this to the 2.3.1 milestone
@micheh

Pull request updated to use self, although I don't think its a good idea to keep those methods private.

@samsonasik samsonasik commented on the diff
library/Zend/Di/Di.php
@@ -551,7 +551,7 @@ protected function resolveAndCallInjectionMethodForInstance($instance, $method,
* @param string $method
* @param array $callTimeUserParams
* @param string $alias
- * @param int|bolean $methodRequirementType
+ * @param int|boolean $methodRequirementType

use bool instead. see #3342

@Ocramius Collaborator

@Ocramius thank you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Ocramius
Collaborator

@micheh thanks for changing the visibility as requested. I will merge as-is: if you feel like changing visibility of the discussed methods is required, then I'd still want to see a good use-case before accepting such a change ;-)

@Ocramius Ocramius closed this in d4c42f4
@micheh micheh deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 7, 2014
  1. Fix undefined classes in phpDoc

    Michel Hunziker authored
  2. Fix undefined class constant

    Michel Hunziker authored
Commits on Apr 12, 2014
  1. Fix possible undefined methods in inherited classes

    Michel Hunziker authored
This page is out of date. Refresh to see the latest.
Showing with 51 additions and 46 deletions.
  1. +1 −1  library/Zend/Barcode/Object/Identcode.php
  2. +1 −1  library/Zend/Cache/Storage/Adapter/Filesystem.php
  3. +1 −1  library/Zend/Cache/Storage/Adapter/MemcacheOptions.php
  4. +1 −0  library/Zend/Cache/Storage/Adapter/MemcacheResourceManager.php
  5. +1 −0  library/Zend/Cache/Storage/Adapter/Redis.php
  6. +1 −1  library/Zend/Code/Reflection/FileReflection.php
  7. +1 −1  library/Zend/Db/Adapter/Driver/Pdo/Feature/OracleRowCounter.php
  8. +1 −1  library/Zend/Db/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php
  9. +1 −1  library/Zend/Db/TableGateway/AbstractTableGateway.php
  10. +1 −1  library/Zend/Di/Definition/Builder/InjectionMethod.php
  11. +1 −1  library/Zend/Di/Di.php
  12. +1 −1  library/Zend/Dom/DOMXPath.php
  13. +1 −1  library/Zend/Dom/Query.php
  14. +1 −1  library/Zend/Feed/Reader/Reader.php
  15. +1 −1  library/Zend/Feed/Writer/ExtensionManager.php
  16. +1 −1  library/Zend/Filter/DateTimeFormatter.php
  17. +2 −1  library/Zend/Filter/FilterChain.php
  18. +1 −1  library/Zend/Filter/Inflector.php
  19. +2 −1  library/Zend/Form/FormElementManager.php
  20. +1 −0  library/Zend/Form/InputFilterProviderFieldset.php
  21. +1 −1  library/Zend/Form/LabelAwareInterface.php
  22. +1 −1  library/Zend/Http/Headers.php
  23. +8 −8 library/Zend/Ldap/Attribute.php
  24. +0 −1  library/Zend/Log/Writer/AbstractWriter.php
  25. +1 −1  library/Zend/Mail/Storage/Writable/Maildir.php
  26. +1 −1  library/Zend/Mime/Part.php
  27. +1 −1  library/Zend/ModuleManager/ModuleManager.php
  28. +2 −2 library/Zend/Mvc/I18n/Translator.php
  29. +1 −0  library/Zend/Mvc/Router/Http/TranslatorAwareTreeRouteStack.php
  30. +1 −1  library/Zend/Navigation/Page/AbstractPage.php
  31. +1 −1  library/Zend/Navigation/Page/Uri.php
  32. +1 −1  library/Zend/Permissions/Acl/Assertion/AssertionAggregate.php
  33. +1 −1  library/Zend/Serializer/Serializer.php
  34. +1 −1  library/Zend/Session/SaveHandler/MongoDB.php
  35. +1 −1  library/Zend/Session/Service/StorageFactory.php
  36. +3 −3 library/Zend/Soap/Server.php
  37. +1 −1  library/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php
  38. +1 −1  library/Zend/Stdlib/PriorityList.php
  39. +1 −1  library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php
  40. +1 −1  library/Zend/View/Helper/Placeholder/Container/AbstractStandalone.php
View
2  library/Zend/Barcode/Object/Identcode.php
@@ -40,7 +40,7 @@ public function getTextToDisplay()
* Check allowed characters
* @param string $value
* @return string
- * @throws Exception
+ * @throws Exception\BarcodeValidationException
*/
public function validateText($value)
{
View
2  library/Zend/Cache/Storage/Adapter/Filesystem.php
@@ -1599,7 +1599,7 @@ protected function putFileContent($file, $data, $nonBlocking = false, & $wouldbl
*
* @param string $file
* @return void
- * @throws RuntimeException
+ * @throws Exception\RuntimeException
*/
protected function unlink($file)
{
View
2  library/Zend/Cache/Storage/Adapter/MemcacheOptions.php
@@ -197,7 +197,7 @@ public function getServers()
/**
* Set compress threshold
*
- * @param int|string|array|ArrayAccess|null $threshold
+ * @param int|string|array|\ArrayAccess|null $threshold
* @return MemcacheOptions
*/
public function setAutoCompressThreshold($threshold)
View
1  library/Zend/Cache/Storage/Adapter/MemcacheResourceManager.php
@@ -9,6 +9,7 @@
namespace Zend\Cache\Storage\Adapter;
+use ArrayAccess;
use Memcache as MemcacheResource;
use Traversable;
use Zend\Cache\Exception;
View
1  library/Zend/Cache/Storage/Adapter/Redis.php
@@ -12,6 +12,7 @@
use Redis as RedisResource;
use RedisException as RedisResourceException;
use stdClass;
+use Traversable;
use Zend\Cache\Exception;
use Zend\Cache\Storage\Capabilities;
use Zend\Cache\Storage\FlushableInterface;
View
2  library/Zend/Code/Reflection/FileReflection.php
@@ -49,7 +49,7 @@ class FileReflection implements ReflectionInterface
protected $requiredFiles = array();
/**
- * @var ReflectionClass[]
+ * @var ClassReflection[]
*/
protected $classes = array();
View
2  library/Zend/Db/Adapter/Driver/Pdo/Feature/OracleRowCounter.php
@@ -64,7 +64,7 @@ public function getCountForSql($sql)
/**
* @param $context
- * @return closure
+ * @return \Closure
*/
public function getRowCountClosure($context)
{
View
2  library/Zend/Db/Adapter/Driver/Pdo/Feature/SqliteRowCounter.php
@@ -64,7 +64,7 @@ public function getCountForSql($sql)
/**
* @param $context
- * @return closure
+ * @return \Closure
*/
public function getRowCountClosure($context)
{
View
2  library/Zend/Db/TableGateway/AbstractTableGateway.php
@@ -301,7 +301,7 @@ protected function executeInsert(Insert $insert)
* Update
*
* @param array $set
- * @param string|array|closure $where
+ * @param string|array|\Closure $where
* @return int
*/
public function update($set, $where = null)
View
2  library/Zend/Di/Definition/Builder/InjectionMethod.php
@@ -106,7 +106,7 @@ public static function detectMethodRequirement($requirement)
return Di::METHOD_IS_OPTIONAL;
break;
case "constructor":
- return Di::MEHTOD_IS_CONSTRUCTOR;
+ return Di::METHOD_IS_CONSTRUCTOR;
break;
case "instantiator":
return Di::METHOD_IS_INSTANTIATOR;
View
2  library/Zend/Di/Di.php
@@ -551,7 +551,7 @@ protected function resolveAndCallInjectionMethodForInstance($instance, $method,
* @param string $method
* @param array $callTimeUserParams
* @param string $alias
- * @param int|bolean $methodRequirementType
+ * @param int|boolean $methodRequirementType

use bool instead. see #3342

@Ocramius Collaborator

@Ocramius thank you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
* @param bool $isInstantiator
* @throws Exception\MissingPropertyException
* @throws Exception\CircularDependencyException
View
2  library/Zend/Dom/DOMXPath.php
@@ -27,7 +27,7 @@ class DOMXPath extends \DOMXPath
* raising an error
*
* @param string $expression The XPath expression to evaluate.
- * @return DOMNodeList
+ * @return \DOMNodeList
* @throws ErrorException
*/
public function queryWithErrorException($expression)
View
2  library/Zend/Dom/Query.php
@@ -298,7 +298,7 @@ public function registerXpathPhpFunctions($xpathPhpFunctions = true)
* @param DOMDocument $document
* @param string|array $xpathQuery
* @return array
- * @throws ErrorException If query cannot be executed
+ * @throws \ErrorException If query cannot be executed
*/
protected function getNodeList($document, $xpathQuery)
{
View
2  library/Zend/Feed/Reader/Reader.php
@@ -266,7 +266,7 @@ public static function import($uri, $etag = null, $lastModified = null)
* HTTP client implementations.
*
* @param string $uri
- * @param Http\Client $client
+ * @param Http\ClientInterface $client
* @return self
* @throws Exception\RuntimeException if response is not an Http\ResponseInterface
*/
View
2  library/Zend/Feed/Writer/ExtensionManager.php
@@ -60,7 +60,7 @@ public function __call($method, $args)
* Get the named extension
*
* @param string $name
- * @return Extension\AbstractEntry|Extension\AbstractFeed
+ * @return Extension\AbstractRenderer
*/
public function get($name)
{
View
2  library/Zend/Filter/DateTimeFormatter.php
@@ -23,7 +23,7 @@ class DateTimeFormatter extends AbstractFilter
/**
* Sets filter options
*
- * @param array|Traversable $options
+ * @param array|\Traversable $options
*/
public function __construct($options = null)
{
View
3  library/Zend/Filter/FilterChain.php
@@ -10,6 +10,7 @@
namespace Zend\Filter;
use Countable;
+use Traversable;
use Zend\Stdlib\PriorityQueue;
class FilterChain extends AbstractFilter implements Countable
@@ -52,7 +53,7 @@ public function __construct($options = null)
*/
public function setOptions($options)
{
- if (!is_array($options) && !$options instanceof \Traversable) {
+ if (!is_array($options) && !$options instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or Traversable; received "%s"',
(is_object($options) ? get_class($options) : gettype($options))
View
2  library/Zend/Filter/Inflector.php
@@ -217,7 +217,7 @@ public function getTarget()
/**
* Set Target Reference
*
- * @param reference $target
+ * @param string $target
* @return self
*/
public function setTargetReference(&$target)
View
3  library/Zend/Form/FormElementManager.php
@@ -11,6 +11,7 @@
use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\ConfigInterface;
+use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\Stdlib\InitializableInterface;
@@ -153,7 +154,7 @@ public function get($name, $options = array(), $usePeeringServiceManagers = true
* @param string $canonicalName
* @param string $requestedName
* @return null|\stdClass
- * @throws Exception\ServiceNotCreatedException If resolved class does not exist
+ * @throws ServiceNotCreatedException If resolved class does not exist
*/
protected function createFromInvokable($canonicalName, $requestedName)
{
View
1  library/Zend/Form/InputFilterProviderFieldset.php
@@ -9,6 +9,7 @@
namespace Zend\Form;
+use Traversable;
use Zend\InputFilter\InputFilterProviderInterface;
class InputFilterProviderFieldset extends Fieldset implements InputFilterProviderInterface
View
2  library/Zend/Form/LabelAwareInterface.php
@@ -46,7 +46,7 @@ public function getLabelAttributes();
*
* Implementation will decide if this will overwrite or merge.
*
- * @param array|Traversable $arrayOrTraversable
+ * @param array|\Traversable $arrayOrTraversable
* @return self
*/
public function setLabelOptions($arrayOrTraversable);
View
2  library/Zend/Http/Headers.php
@@ -24,7 +24,7 @@
class Headers implements Countable, Iterator
{
/**
- * @var PluginClassLoader
+ * @var PluginClassLocator
*/
protected $pluginClassLoader = null;
View
16 library/Zend/Ldap/Attribute.php
@@ -37,13 +37,13 @@ public static function setAttribute(array &$data, $attribName, $value, $append =
$valArray = array();
if (is_array($value) || ($value instanceof \Traversable)) {
foreach ($value as $v) {
- $v = static::valueToLdap($v);
+ $v = self::valueToLdap($v);
if ($v !== null) {
$valArray[] = $v;
}
}
} elseif ($value !== null) {
- $value = static::valueToLdap($value);
+ $value = self::valueToLdap($value);
if ($value !== null) {
$valArray[] = $value;
}
@@ -76,14 +76,14 @@ public static function getAttribute(array $data, $attribName, $index = null)
}
$retArray = array();
foreach ($data[$attribName] as $v) {
- $retArray[] = static::valueFromLdap($v);
+ $retArray[] = self::valueFromLdap($v);
}
return $retArray;
} elseif (is_int($index)) {
if (!isset($data[$attribName])) {
return null;
} elseif ($index >= 0 && $index < count($data[$attribName])) {
- return static::valueFromLdap($data[$attribName][$index]);
+ return self::valueFromLdap($data[$attribName][$index]);
} else {
return null;
}
@@ -295,13 +295,13 @@ public static function setDateTimeAttribute(
$convertedValues = array();
if (is_array($value) || ($value instanceof \Traversable)) {
foreach ($value as $v) {
- $v = static::valueToLdapDateTime($v, $utc);
+ $v = self::valueToLdapDateTime($v, $utc);
if ($v !== null) {
$convertedValues[] = $v;
}
}
} elseif ($value !== null) {
- $value = static::valueToLdapDateTime($value, $utc);
+ $value = self::valueToLdapDateTime($value, $utc);
if ($value !== null) {
$convertedValues[] = $value;
}
@@ -336,13 +336,13 @@ public static function getDateTimeAttribute(array $data, $attribName, $index = n
$values = static::getAttribute($data, $attribName, $index);
if (is_array($values)) {
for ($i = 0, $count = count($values); $i < $count; $i++) {
- $newVal = static::valueFromLdapDateTime($values[$i]);
+ $newVal = self::valueFromLdapDateTime($values[$i]);
if ($newVal !== null) {
$values[$i] = $newVal;
}
}
} else {
- $newVal = static::valueFromLdapDateTime($values);
+ $newVal = self::valueFromLdapDateTime($values);
if ($newVal !== null) {
$values = $newVal;
}
View
1  library/Zend/Log/Writer/AbstractWriter.php
@@ -67,7 +67,6 @@
* - formatter: formatter for this writer
*
* @param array|Traversable $options
- * @return Logger
* @throws Exception\InvalidArgumentException
*/
public function __construct($options = null)
View
2  library/Zend/Mail/Storage/Writable/Maildir.php
@@ -426,7 +426,7 @@ protected function _getInfoString(&$flags)
/**
* append a new message to mail storage
*
- * @param string|stream $message message as string or stream resource
+ * @param string|resource $message message as string or stream resource
* @param null|string|\Zend\Mail\Storage\Folder $folder folder for new message, else current folder is taken
* @param null|array $flags set flags for new message, else a default set is used
* @param bool $recent handle this mail as if recent flag has been set,
View
2  library/Zend/Mime/Part.php
@@ -68,7 +68,7 @@ public function isStream()
* reading the content. very useful for large file attachments.
*
* @param string $EOL
- * @return stream
+ * @return resource
* @throws Exception\RuntimeException if not a stream or unable to append filter
*/
public function getEncodedStream($EOL = Mime::LINEEND)
View
2  library/Zend/ModuleManager/ModuleManager.php
@@ -174,7 +174,7 @@ public function loadModule($module)
/**
* Load a module with the name
- * @param Zend\EventManager\EventInterface $event
+ * @param \Zend\EventManager\EventInterface $event
* @return mixed module instance
* @throws Exception\RuntimeException
*/
View
4 library/Zend/Mvc/I18n/Translator.php
@@ -18,12 +18,12 @@ class Translator implements
ValidatorTranslatorInterface
{
/**
- * @var I18nTranslator
+ * @var I18nTranslatorInterface
*/
protected $translator;
/**
- * @param I18nTranslator $translator
+ * @param I18nTranslatorInterface $translator
*/
public function __construct(I18nTranslatorInterface $translator)
{
View
1  library/Zend/Mvc/Router/Http/TranslatorAwareTreeRouteStack.php
@@ -11,6 +11,7 @@
use Zend\I18n\Translator\TranslatorInterface as Translator;
use Zend\I18n\Translator\TranslatorAwareInterface;
+use Zend\Mvc\Router\Exception;
use Zend\Stdlib\RequestInterface as Request;
/**
View
2  library/Zend/Navigation/Page/AbstractPage.php
@@ -260,7 +260,7 @@ public static function factory($options)
/**
* Add static factory for self::factory function
*
- * @param type $callback Any callable variable
+ * @param callable $callback Any callable variable
*/
public static function addFactory($callback)
{
View
2  library/Zend/Navigation/Page/Uri.php
@@ -123,7 +123,7 @@ public function getRequest()
* Sets request for assembling URLs
*
* @param Request $request
- * @return Fluent interface, returns self
+ * @return self Fluent interface, returns self
*/
public function setRequest(Request $request = null)
{
View
2  library/Zend/Permissions/Acl/Assertion/AssertionAggregate.php
@@ -95,7 +95,7 @@ public function getAssertionManager()
*
* @param string $mode
* indicates how assertion chain result should interpreted (either 'all' or 'at_least_one')
- * @throws Exception
+ * @throws InvalidArgumentException
*
* @return self
*/
View
2  library/Zend/Serializer/Serializer.php
@@ -18,7 +18,7 @@
*
* @var null|AdapterPluginManager
*/
- private static $adapters = null;
+ protected static $adapters = null;
/**
* The default adapter.
View
2  library/Zend/Session/SaveHandler/MongoDB.php
@@ -51,7 +51,7 @@ class MongoDB implements SaveHandlerInterface
*
* @param Mongo|MongoClient $mongo
* @param MongoDBOptions $options
- * @throws Zend\Session\Exception\InvalidArgumentException
+ * @throws InvalidArgumentException
*/
public function __construct($mongo, MongoDBOptions $options)
{
View
2  library/Zend/Session/Service/StorageFactory.php
@@ -12,7 +12,7 @@
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
-use Zend\Session\Storage\Exception as SessionException;
+use Zend\Session\Exception\ExceptionInterface as SessionException;
use Zend\Session\Storage\Factory;
use Zend\Session\Storage\StorageInterface;
View
6 library/Zend/Soap/Server.php
@@ -720,7 +720,7 @@ public function getPersistence()
* - stdClass; if so, calls __toString() and verifies XML
* - string; if so, verifies XML
*
- * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request
+ * @param DOMDocument|DOMNode|SimpleXMLElement|\stdClass|string $request
* @return self
* @throws Exception\InvalidArgumentException
*/
@@ -880,7 +880,7 @@ public function getSoap()
* If no request is passed, pulls request using php:://input (for
* cross-platform compatibility purposes).
*
- * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request Optional request
+ * @param DOMDocument|DOMNode|SimpleXMLElement|\stdClass|string $request Optional request
* @return void|string
*/
public function handle($request = null)
@@ -999,7 +999,7 @@ public function registerFaultException($class)
/**
* Checks if provided fault name is registered as valid in this server.
*
- * @param $fault Name of a fault class
+ * @param string $fault Name of a fault class
* @return bool
*/
public function isRegisteredAsFaultException($fault)
View
2  library/Zend/Stdlib/Hydrator/Filter/OptionalParametersFilter.php
@@ -25,7 +25,7 @@ class OptionalParametersFilter implements FilterInterface
*
* @var bool[]
*/
- private static $propertiesCache = array();
+ protected static $propertiesCache = array();
/**
* {@inheritDoc}
View
2  library/Zend/Stdlib/PriorityList.php
@@ -244,7 +244,7 @@ public function count()
/**
* Return list as array
*
- * @param type $raw
+ * @param int $flag
* @return array
*/
public function toArray($flag = self::EXTR_DATA)
View
2  library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php
@@ -707,7 +707,7 @@ public function assertNotTemplateName($templateName)
/**
* Recursively search a view model and it's children for the given templateName
*
- * @param ViewModel $viewModel
+ * @param \Zend\View\Model\ModelInterface $viewModel
* @param string $templateName
* @return boolean
*/
View
2  library/Zend/View/Helper/Placeholder/Container/AbstractStandalone.php
@@ -365,7 +365,7 @@ public function offsetUnset($offset)
/**
* IteratorAggregate: get Iterator
*
- * @return Iterator
+ * @return \Iterator
*/
public function getIterator()
{
Something went wrong with that request. Please try again.