Update core 8.3.0

This commit is contained in:
Rob Davies 2017-04-13 15:53:35 +01:00
parent da7a7918f8
commit cd7a898e66
6144 changed files with 132297 additions and 87747 deletions

View file

@ -2,6 +2,112 @@
All notable changes to this project will be documented in this file, in reverse chronological order by release.
## 3.1.0 - 2016-09-13
### Added
- [#63](https://github.com/zendframework/zend-stdlib/pull/63) adds a new
`Zend\Stdlib\ConsoleHelper` class, providing minimal support for writing
output to `STDOUT` and `STDERR`, with optional colorization, when the console
supports that feature.
### Deprecated
- [#38](https://github.com/zendframework/zend-stdlib/pull/38) deprecates
`Zend\Stdlib\JsonSerializable`, as all supported version of PHP now support
it.
### Removed
- Nothing.
### Fixed
- Nothing.
## 3.0.1 - 2016-04-12
### Added
- Nothing.
### Deprecated
- Nothing.
### Removed
- Nothing.
### Fixed
- [#59](https://github.com/zendframework/zend-stdlib/pull/59) fixes a notice
when defining the `Zend\Json\Json::GLOB_BRACE` constant on systems using
non-gcc glob implementations.
## 3.0.0 - 2016-02-03
### Added
- [#51](https://github.com/zendframework/zend-stdlib/pull/51) adds PHP 7 as a
supported PHP version.
- [#51](https://github.com/zendframework/zend-stdlib/pull/51) adds a migration
document from v2 to v3. Hint: if you use hydrators, you need to be using
zend-hydrator instead!
- [#51](https://github.com/zendframework/zend-stdlib/pull/51) adds automated
documentation builds to gh-pages.
### Deprecated
- Nothing.
### Removed
- [#33](https://github.com/zendframework/zend-stdlib/pull/33) - removed
deprecated classes
- *All Hydrator classes* see #22.
- `Zend\Stdlib\CallbackHandler` see #35
- [#37](https://github.com/zendframework/zend-stdlib/pull/37) - removed
deprecated classes and polyfills:
- `Zend\Stdlib\DateTime`; this had been deprecated since 2.5, and only
existed as a polyfill for the `createFromISO8601()` support, now standard
in all PHP versions we support.
- `Zend\Stdlib\Exception\InvalidCallbackException`, which was unused since #33.
- `Zend\Stdlib\Guard\GuardUtils`, which duplicated `Zend\Stdlib\Guard\AllGuardsTrait`
to allow usage with pre-PHP 5.4 versions.
- `src/compatibility/autoload.php`, which has been dprecated since 2.5.
- [#37](https://github.com/zendframework/zend-stdlib/pull/37) - removed
unneeded dependencies:
- zend-config (used only in testing ArrayUtils, and the test was redundant)
- zend-serializer (no longer used)
- [#51](https://github.com/zendframework/zend-stdlib/pull/51) removes the
documentation for hydrators, as those are part of the zend-hydrator
component.
### Fixed
- Nothing.
## 2.7.4 - 2015-10-15
### Added
- Nothing.
### Deprecated
- [#35](https://github.com/zendframework/zend-stdlib/pull/35) deprecates
`Zend\Stdlib\CallbackHandler`, as the one component that used it,
zend-eventmanager, will no longer depend on it starting in v3.
### Removed
- Nothing.
### Fixed
- Nothing.
## 2.7.3 - 2015-09-24
### Added

View file

@ -0,0 +1,43 @@
# Contributor Code of Conduct
The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com)
as its guidelines for contributor interactions.
## The Code Manifesto
We want to work in an ecosystem that empowers developers to reach their
potential — one that encourages growth and effective collaboration. A space that
is safe for all.
A space such as this benefits everyone that participates in it. It encourages
new developers to enter our field. It is through discussion and collaboration
that we grow, and through growth that we improve.
In the effort to create such a place, we hold to these values:
1. **Discrimination limits us.** This includes discrimination on the basis of
race, gender, sexual orientation, gender identity, age, nationality, technology
and any other arbitrary exclusion of a group of people.
2. **Boundaries honor us.** Your comfort levels are not everyones comfort
levels. Remember that, and if brought to your attention, heed it.
3. **We are our biggest assets.** None of us were born masters of our trade.
Each of us has been helped along the way. Return that favor, when and where
you can.
4. **We are resources for the future.** As an extension of #3, share what you
know. Make yourself a resource to help those that come after you.
5. **Respect defines us.** Treat others as you wish to be treated. Make your
discussions, criticisms and debates from a position of respectfulness. Ask
yourself, is it true? Is it necessary? Is it constructive? Anything less is
unacceptable.
6. **Reactions require grace.** Angry responses are valid, but abusive language
and vindictive actions are toxic. When something happens that offends you,
handle it assertively, but be respectful. Escalate reasonably, and try to
allow the offender an opportunity to explain themselves, and possibly correct
the issue.
7. **Opinions are just that: opinions.** Each and every one of us, due to our
background and upbringing, have varying opinions. The fact of the matter, is
that is perfectly acceptable. Remember this: if you respect your own
opinions, you should respect the opinions of others.
8. **To err is human.** You might not intend it, but mistakes do happen and
contribute to build experience. Tolerate honest mistakes, and don't hesitate
to apologize if you make one yourself.

View file

@ -237,3 +237,8 @@ repository, we suggest doing some cleanup of these branches.
```console
$ git push {username} :<branchname>
```
## Conduct
Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project.

View file

@ -7,8 +7,6 @@
class for different scopes like:
- array utilities functions;
- hydrators;
- json serializable interfaces;
- general messaging systems;
- string wrappers;
- etc.
@ -16,4 +14,4 @@ class for different scopes like:
---
- File issues at https://github.com/zendframework/zend-stdlib/issues
- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-stdlib
- Documentation is at https://docs.zendframework.com/zend-stdlib/

View file

@ -13,32 +13,17 @@
}
},
"require": {
"php": ">=5.5",
"zendframework/zend-hydrator": "~1.0"
"php": "^5.6 || ^7.0"
},
"require-dev": {
"zendframework/zend-config": "~2.5",
"zendframework/zend-eventmanager": "~2.5",
"zendframework/zend-inputfilter": "~2.5",
"zendframework/zend-serializer": "~2.5",
"zendframework/zend-servicemanager": "~2.5",
"zendframework/zend-filter": "~2.5",
"fabpot/php-cs-fixer": "1.7.*",
"athletic/athletic": "~0.1",
"phpunit/PHPUnit": "~4.0",
"athletic/athletic": "~0.1"
"squizlabs/php_codesniffer": "^2.6.2"
},
"suggest": {
"zendframework/zend-eventmanager": "To support aggregate hydrator usage",
"zendframework/zend-serializer": "Zend\\Serializer component",
"zendframework/zend-servicemanager": "To support hydrator plugin manager usage",
"zendframework/zend-filter": "To support naming strategy hydrator usage"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "2.7-dev",
"dev-develop": "2.8-dev"
"dev-master": "3.1-dev",
"dev-develop": "3.2-dev"
}
},
"autoload-dev": {
@ -46,5 +31,12 @@
"ZendTest\\Stdlib\\": "test/",
"ZendBench\\Stdlib\\": "benchmark/"
}
},
"scripts": {
"cs-check": "phpcs --colors",
"cs-fix": "phpcbf --colors",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
"upload-coverage": "coveralls -v"
}
}

View file

@ -0,0 +1,126 @@
# Console Helper
Writing one-off scripts or vendor binaries for a package is often problematic:
- You need to parse arguments manually.
- You need to send output to the console in a meaningful fashion:
- Using `STDOUT` for meaningful, expected output
- Using `STDERR` for error messages
- Ensuring any line breaks are converted to `PHP_EOL`
- Optionally, using console colors to provide context, which means:
- Detecting whether or not the console supports colors in the first place
- Providing appropriate escape sequences to produce color
`Zend\Stdlib\ConsoleHelper` helps to address the second major bullet point and
all beneath it in a minimal fashion.
## Usage
Typical usage is to instantiate a `ConsoleHelper`, and call one of its methods:
```php
use Zend\Stdlib\ConsoleHelper;
$helper = new ConsoleHelper();
$helper->writeLine('This is output');
```
You can optionally pass a PHP stream resource to the constructor, which will be
used to determine whether or not color support is available:
```php
$helper = new ConsoleHelper($stream);
```
By default, it assumes `STDOUT`, and tests against that.
## Available methods
`ConsoleHelper` provides the following methods.
### colorize
- `colorize(string $string) : string`
`colorize()` accepts a formatted string, and will then apply ANSI color
sequences to them, if color support is detected.
The following sequences are currently supported:
- `<info>...</info>` will apply a green color sequence around the provided text.
- `<error>...</error>` will apply a red color sequence around the provided text.
You may mix multiple sequences within the same stream.
### write
- `write(string $string, bool $colorize = true, resource $stream = STDOUT) : void`
Emits the provided `$string` to the provided `$stream` (which defaults to
`STDOUT` if not provided). Any EOL sequences are convered to `PHP_EOL`. If
`$colorize` is `true`, the string is first passed to `colorize()` as well.
### writeline
- `writeLine(string $string, bool $colorize = true, resource $stream = STDOUT) : void`
Same as `write()`, except it also appends a `PHP_EOL` sequence to the `$string`.
### writeErrorMessage
- `writeErrorMessage(string $message)`
Wraps `$message` in an `<error></error>` sequence, and passes it to
`writeLine()`, using `STDERR` as the `$stream`.
## Example
Below is an example class that accepts an argument list, and determines how and
what to emit.
```php
namespace Foo;
use Zend\Stdlib\ConsoleHelper;
class HelloWorld
{
private $helper;
public function __construct(ConsoleHelper $helper = null)
{
$this->helper = $helper ?: new ConsoleHelper();
}
public function __invoke(array $args)
{
if (! count($args)) {
$this->helper->writeErrorMessage('Missing arguments!');
return;
}
if (count($args) > 1) {
$this->helper->writeErrorMessage('Too many arguments!');
return;
}
$target = array_shift($args);
$this->helper->writeLine(sprintf(
'<info>Hello</info> %s',
$target
));
}
}
```
## When to upgrade
`ConsoleHelper` is deliberately simple, and assumes that your primary need for
console tooling is for output considerations.
If you need to parse complex argument strings, we recommend using
[zend-console](https://docs.zendframework.com/zend-console/)/[zf-console](https://github.com/zfcampus/zf-console)
or [symfony/console](http://symfony.com/doc/current/components/console.html),
as these packages provide those capabilities, as well as far more colorization
and console feature detection facilities.

View file

@ -0,0 +1,10 @@
<div class="container">
<div class="jumbotron">
<h1>zend-stdlib</h1>
<p>SPL extensions, array utilities, error handlers, and more.</p>
<pre><code class="language-bash">$ composer require zendframework/zend-stdlib</code></pre>
</div>
</div>

View file

@ -0,0 +1 @@
../../README.md

View file

@ -0,0 +1,60 @@
# Migration Guide
## From v2 to v3
The changes made going from v2 to v3 were:
- Removal of the Hydrator subcomponent.
- Removal of the `CallbackHandler` class.
- Removal of `Zend\Stdlib\Guard\GuardUtils`.
### Hydrators
The biggest single change from version 2 to version 3 is that the hydrator
subcomponent, which was deprecated in v2.7.0, is now removed. This means that if
you were using zend-stdlib principally for the hydrators, you need to convert
your code to use [zend-hydrator](https://github.com/zendframework/zend-hydrator).
This will also mean a multi-step migration. zend-stdlib v3 pre-dates
zend-hydrator v2.1, which will be the first version that supports zend-stdlib v3
and zend-servicemanager v3. If you are using Composer, the migration should be
seamless:
- Remove your zend-stdlib dependency:
```bash
$ composer remove zendframework/zend-stdlib
```
- Update to use zend-hydrator:
```bash
$ composer require zendframework/zend-hydrator
```
When zend-hydrator updates to newer versions of zend-stdlib and
zend-servicemanager, you will either automatically get those versions, or you
can tell composer to use those specific versions:
```bash
$ composer require "zendframework/zend-stdlib:^3.0"
```
### CallbackHandler
`Zend\Stdlib\CallbackHandler` primarily existed for legacy purposes; it was
created before the `callable` typehint existed, so that we could typehint PHP
callables. It also provided some minimal features around lazy-loading callables
from instantiable classes, but these features were rarely used, and better
approaches already exist for handling such functinality in zend-servicemanager
and zend-expressive.
As such, the class was marked deprecated in v2.7.0, and removed for v3.0.0.
### GuardUtils
Version 3 removes `Zend\Stdlib\Guard\GuardUtils`. This abstract class existed to
provide the functionality of the various traits also present in that
subcomponent, for consumers on versions of PHP earlier than 5.4. Since the
minimum required version is now PHP 5.5, the class is unnecessary. If you were
using it previously, compose the related traits instead.

View file

@ -0,0 +1,14 @@
{
"title": "Zend\\Stdlib",
"target": "html/",
"content": [
"book/zend.stdlib.hydrator.md",
"book/zend.stdlib.hydrator.filter.md",
"book/zend.stdlib.hydrator.strategy.md",
"book/zend.stdlib.hydrator.aggregate.md",
"book/zend.stdlib.hydrator.namingstrategy.compositenamingstrategy.md",
"book/zend.stdlib.hydrator.namingstrategy.identitynamingstrategy.md",
"book/zend.stdlib.hydrator.namingstrategy.mapnamingstrategy.md",
"book/zend.stdlib.hydrator.namingstrategy.underscorenamingstrategy.md"
]
}

View file

@ -0,0 +1,11 @@
docs_dir: doc/book
site_dir: doc/html
pages:
- index.md
- Reference:
- "Console Helper": console-helper.md
- Migration: migration.md
site_name: zend-stdlib
site_description: Zend\Stdlib
repo_url: 'https://github.com/zendframework/zend-stdlib'
copyright: 'Copyright (c) 2016 <a href="http://www.zend.com/">Zend Technologies USA Inc.</a>'

View file

@ -0,0 +1,27 @@
<?xml version="1.0"?>
<ruleset name="Zend Framework coding standard">
<description>Zend Framework coding standard</description>
<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>
<!-- inherit rules from: -->
<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<!-- Paths to check -->
<file>src</file>
<file>test</file>
</ruleset>

View file

@ -13,6 +13,7 @@ use Traversable;
abstract class AbstractOptions implements ParameterObjectInterface
{
// @codingStandardsIgnoreStart
/**
* We use the __ prefix to avoid collisions with properties in
* user-implementations.
@ -20,6 +21,7 @@ abstract class AbstractOptions implements ParameterObjectInterface
* @var bool
*/
protected $__strictMode__ = true;
// @codingStandardsIgnoreEnd
/**
* Constructor
@ -46,7 +48,7 @@ abstract class AbstractOptions implements ParameterObjectInterface
$options = $options->toArray();
}
if (!is_array($options) && !$options instanceof Traversable) {
if (! is_array($options) && ! $options instanceof Traversable) {
throw new Exception\InvalidArgumentException(
sprintf(
'Parameter provided to %s must be an %s, %s or %s',

View file

@ -180,14 +180,16 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
*/
public function exchangeArray($data)
{
if (!is_array($data) && !is_object($data)) {
throw new Exception\InvalidArgumentException('Passed variable is not an array or object, using empty array instead');
if (! is_array($data) && ! is_object($data)) {
throw new Exception\InvalidArgumentException(
'Passed variable is not an array or object, using empty array instead'
);
}
if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) {
$data = $data->getArrayCopy();
}
if (!is_array($data)) {
if (! is_array($data)) {
$data = (array) $data;
}
@ -290,7 +292,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
public function &offsetGet($key)
{
$ret = null;
if (!$this->offsetExists($key)) {
if (! $this->offsetExists($key)) {
return $ret;
}
$ret =& $this->storage[$key];

View file

@ -39,11 +39,11 @@ abstract class ArrayUtils
*/
public static function hasStringKeys($value, $allowEmpty = false)
{
if (!is_array($value)) {
if (! is_array($value)) {
return false;
}
if (!$value) {
if (! $value) {
return $allowEmpty;
}
@ -59,11 +59,11 @@ abstract class ArrayUtils
*/
public static function hasIntegerKeys($value, $allowEmpty = false)
{
if (!is_array($value)) {
if (! is_array($value)) {
return false;
}
if (!$value) {
if (! $value) {
return $allowEmpty;
}
@ -86,11 +86,11 @@ abstract class ArrayUtils
*/
public static function hasNumericKeys($value, $allowEmpty = false)
{
if (!is_array($value)) {
if (! is_array($value)) {
return false;
}
if (!$value) {
if (! $value) {
return $allowEmpty;
}
@ -119,11 +119,11 @@ abstract class ArrayUtils
*/
public static function isList($value, $allowEmpty = false)
{
if (!is_array($value)) {
if (! is_array($value)) {
return false;
}
if (!$value) {
if (! $value) {
return $allowEmpty;
}
@ -161,11 +161,11 @@ abstract class ArrayUtils
*/
public static function isHashTable($value, $allowEmpty = false)
{
if (!is_array($value)) {
if (! is_array($value)) {
return false;
}
if (!$value) {
if (! $value) {
return $allowEmpty;
}
@ -187,7 +187,7 @@ abstract class ArrayUtils
*/
public static function inArray($needle, array $haystack, $strict = false)
{
if (!$strict) {
if (! $strict) {
if (is_int($needle) || is_float($needle)) {
$needle = (string) $needle;
}
@ -215,11 +215,11 @@ abstract class ArrayUtils
*/
public static function iteratorToArray($iterator, $recursive = true)
{
if (!is_array($iterator) && !$iterator instanceof Traversable) {
if (! is_array($iterator) && ! $iterator instanceof Traversable) {
throw new Exception\InvalidArgumentException(__METHOD__ . ' expects an array or Traversable object');
}
if (!$recursive) {
if (! $recursive) {
if (is_array($iterator)) {
return $iterator;
}
@ -274,7 +274,7 @@ abstract class ArrayUtils
} elseif (isset($a[$key]) || array_key_exists($key, $a)) {
if ($value instanceof MergeRemoveKey) {
unset($a[$key]);
} elseif (!$preserveNumericKeys && is_int($key)) {
} elseif (! $preserveNumericKeys && is_int($key)) {
$a[] = $value;
} elseif (is_array($value) && is_array($a[$key])) {
$a[$key] = static::merge($a[$key], $value, $preserveNumericKeys);
@ -282,7 +282,7 @@ abstract class ArrayUtils
$a[$key] = $value;
}
} else {
if (!$value instanceof MergeRemoveKey) {
if (! $value instanceof MergeRemoveKey) {
$a[$key] = $value;
}
}

View file

@ -1,192 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib;
use ReflectionClass;
/**
* CallbackHandler
*
* A handler for an event, event, filterchain, etc. Abstracts PHP callbacks,
* primarily to allow for lazy-loading and ensuring availability of default
* arguments (currying).
*/
class CallbackHandler
{
/**
* @var string|array|callable PHP callback to invoke
*/
protected $callback;
/**
* Callback metadata, if any
* @var array
*/
protected $metadata;
/**
* Constructor
*
* @param string|array|object|callable $callback PHP callback
* @param array $metadata Callback metadata
*/
public function __construct($callback, array $metadata = [])
{
$this->metadata = $metadata;
$this->registerCallback($callback);
}
/**
* Registers the callback provided in the constructor
*
* @param callable $callback
* @throws Exception\InvalidCallbackException
* @return void
*/
protected function registerCallback($callback)
{
if (!is_callable($callback)) {
throw new Exception\InvalidCallbackException('Invalid callback provided; not callable');
}
$this->callback = $callback;
}
/**
* Retrieve registered callback
*
* @return callable
*/
public function getCallback()
{
return $this->callback;
}
/**
* Invoke handler
*
* @param array $args Arguments to pass to callback
* @return mixed
*/
public function call(array $args = [])
{
$callback = $this->getCallback();
$argCount = count($args);
if (is_string($callback)) {
$result = $this->validateStringCallbackFor54($callback);
if ($result !== true && $argCount <= 3) {
$callback = $result;
// Minor performance tweak, if the callback gets called more
// than once
$this->callback = $result;
}
}
// Minor performance tweak; use call_user_func() until > 3 arguments
// reached
switch ($argCount) {
case 0:
return $callback();
case 1:
return $callback(array_shift($args));
case 2:
$arg1 = array_shift($args);
$arg2 = array_shift($args);
return $callback($arg1, $arg2);
case 3:
$arg1 = array_shift($args);
$arg2 = array_shift($args);
$arg3 = array_shift($args);
return $callback($arg1, $arg2, $arg3);
default:
return call_user_func_array($callback, $args);
}
}
/**
* Invoke as functor
*
* @return mixed
*/
public function __invoke()
{
return $this->call(func_get_args());
}
/**
* Get all callback metadata
*
* @return array
*/
public function getMetadata()
{
return $this->metadata;
}
/**
* Retrieve a single metadatum
*
* @param string $name
* @return mixed
*/
public function getMetadatum($name)
{
if (array_key_exists($name, $this->metadata)) {
return $this->metadata[$name];
}
return;
}
/**
* Validate a static method call
*
*
* @param string $callback
* @return true|array
* @throws Exception\InvalidCallbackException if invalid
*/
protected function validateStringCallbackFor54($callback)
{
if (!strstr($callback, '::')) {
return true;
}
list($class, $method) = explode('::', $callback, 2);
if (!class_exists($class)) {
throw new Exception\InvalidCallbackException(sprintf(
'Static method call "%s" refers to a class that does not exist',
$callback
));
}
$r = new ReflectionClass($class);
if (!$r->hasMethod($method)) {
throw new Exception\InvalidCallbackException(sprintf(
'Static method call "%s" refers to a method that does not exist',
$callback
));
}
$m = $r->getMethod($method);
if (!$m->isStatic()) {
throw new Exception\InvalidCallbackException(sprintf(
'Static method call "%s" refers to a method that is not static',
$callback
));
}
// returning a non boolean value may not be nice for a validate method,
// but that allows the usage of a static string callback without using
// the call_user_func function.
return [$class, $method];
}
}

View file

@ -0,0 +1,158 @@
<?php
/**
* @link http://github.com/zendframework/zend-stdlib for the canonical source repository
* @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib;
/**
* Utilities for console tooling.
*
* Provides the following facilities:
*
* - Colorize strings using markup (e.g., `<info>message</info>`,
* `<error>message</error>`)
* - Write output to a specified stream, optionally with colorization.
* - Write a line of output to a specified stream, optionally with
* colorization, using the system EOL sequence..
* - Write an error message to STDERR.
*
* Colorization will only occur when expected sequences are discovered, and
* then, only if the console terminal allows it.
*
* Essentially, provides the bare minimum to allow you to provide messages to
* the current console.
*/
class ConsoleHelper
{
const COLOR_GREEN = "\033[32m";
const COLOR_RED = "\033[31m";
const COLOR_RESET = "\033[0m";
const HIGHLIGHT_INFO = 'info';
const HIGHLIGHT_ERROR = 'error';
private $highlightMap = [
self::HIGHLIGHT_INFO => self::COLOR_GREEN,
self::HIGHLIGHT_ERROR => self::COLOR_RED,
];
/**
* @var string Exists only for testing.
*/
private $eol = PHP_EOL;
/**
* @var resource Exists only for testing.
*/
private $stderr = STDERR;
/**
* @var bool
*/
private $supportsColor;
/**
* @param resource $resource
*/
public function __construct($resource = STDOUT)
{
$this->supportsColor = $this->detectColorCapabilities($resource);
}
/**
* Colorize a string for use with the terminal.
*
* Takes strings formatted as `<key>string</key>` and formats them per the
* $highlightMap; if color support is disabled, simply removes the formatting
* tags.
*
* @param string $string
* @return string
*/
public function colorize($string)
{
$reset = $this->supportsColor ? self::COLOR_RESET : '';
foreach ($this->highlightMap as $key => $color) {
$pattern = sprintf('#<%s>(.*?)</%s>#s', $key, $key);
$color = $this->supportsColor ? $color : '';
$string = preg_replace($pattern, $color . '$1' . $reset, $string);
}
return $string;
}
/**
* @param string $string
* @param bool $colorize Whether or not to colorize the string
* @param resource $resource Defaults to STDOUT
* @return void
*/
public function write($string, $colorize = true, $resource = STDOUT)
{
if ($colorize) {
$string = $this->colorize($string);
}
$string = $this->formatNewlines($string);
fwrite($resource, $string);
}
/**
* @param string $string
* @param bool $colorize Whether or not to colorize the line
* @param resource $resource Defaults to STDOUT
* @return void
*/
public function writeLine($string, $colorize = true, $resource = STDOUT)
{
$this->write($string . $this->eol, $colorize, $resource);
}
/**
* Emit an error message.
*
* Wraps the message in `<error></error>`, and passes it to `writeLine()`,
* using STDERR as the resource; emits an additional empty line when done,
* also to STDERR.
*
* @param string $message
* @return void
*/
public function writeErrorMessage($message)
{
$this->writeLine(sprintf('<error>%s</error>', $message), true, $this->stderr);
$this->writeLine('', false, $this->stderr);
}
/**
* @param resource $resource
* @return bool
*/
private function detectColorCapabilities($resource = STDOUT)
{
if ('\\' === DIRECTORY_SEPARATOR) {
// Windows
return false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
}
return function_exists('posix_isatty') && posix_isatty($resource);
}
/**
* Ensure newlines are appropriate for the current terminal.
*
* @param string
* @return string
*/
private function formatNewlines($string)
{
$string = str_replace($this->eol, "\0PHP_EOL\0", $string);
$string = preg_replace("/(\r\n|\n|\r)/", $this->eol, $string);
return str_replace("\0PHP_EOL\0", $this->eol, $string);
}
}

View file

@ -1,47 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib;
use DateTimeZone;
trigger_error('DateTime extension deprecated as of ZF 2.1.4; use the \DateTime constructor to parse extended ISO8601 dates instead', E_USER_DEPRECATED);
/**
* DateTime
*
* An extension of the \DateTime object.
*
* @deprecated
*/
class DateTime extends \DateTime
{
/**
* The DateTime::ISO8601 constant used by php's native DateTime object does
* not allow for fractions of a second. This function better handles ISO8601
* formatted date strings.
*
* @param string $time
* @param DateTimeZone $timezone
* @return mixed
*/
public static function createFromISO8601($time, DateTimeZone $timezone = null)
{
$format = self::ISO8601;
if (isset($time[19]) && $time[19] === '.') {
$format = 'Y-m-d\TH:i:s.uO';
}
if ($timezone !== null) {
return self::createFromFormat($format, $time, $timezone);
}
return self::createFromFormat($format, $time);
}
}

View file

@ -51,7 +51,7 @@ abstract class ErrorHandler
*/
public static function start($errorLevel = \E_WARNING)
{
if (!static::$stack) {
if (! static::$stack) {
set_error_handler([get_called_class(), 'addError'], $errorLevel);
}
@ -72,7 +72,7 @@ abstract class ErrorHandler
if (static::$stack) {
$errorException = array_pop(static::$stack);
if (!static::$stack) {
if (! static::$stack) {
restore_error_handler();
}

View file

@ -1,17 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Exception;
/**
* Invalid callback exception
*/
class InvalidCallbackException extends DomainException implements ExceptionInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Extractor;
use Zend\Hydrator\ExtractionInterface as BaseExtractionInterface;
/**
* @deprecated Use Zend\Hydrator\ExtractionInterface from zendframework/zend-hydrator instead.
*/
interface ExtractionInterface extends BaseExtractionInterface
{
}

View file

@ -38,7 +38,7 @@ abstract class Glob
*/
public static function glob($pattern, $flags = 0, $forceFallback = false)
{
if (!defined('GLOB_BRACE') || $forceFallback) {
if (! defined('GLOB_BRACE') || $forceFallback) {
return static::fallbackGlob($pattern, $flags);
}
@ -61,7 +61,7 @@ abstract class Glob
self::GLOB_NOSORT => GLOB_NOSORT,
self::GLOB_NOCHECK => GLOB_NOCHECK,
self::GLOB_NOESCAPE => GLOB_NOESCAPE,
self::GLOB_BRACE => GLOB_BRACE,
self::GLOB_BRACE => defined('GLOB_BRACE') ? GLOB_BRACE : 0,
self::GLOB_ONLYDIR => GLOB_ONLYDIR,
self::GLOB_ERR => GLOB_ERR,
];
@ -96,7 +96,7 @@ abstract class Glob
*/
protected static function fallbackGlob($pattern, $flags)
{
if (!$flags & self::GLOB_BRACE) {
if (! $flags & self::GLOB_BRACE) {
return static::systemGlob($pattern, $flags);
}
@ -182,7 +182,7 @@ abstract class Glob
$current = $begin;
while ($current < $length) {
if (!$flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') {
if (! $flags & self::GLOB_NOESCAPE && $pattern[$current] === '\\') {
if (++$current === $length) {
break;
}

View file

@ -29,7 +29,7 @@ trait ArrayOrTraversableGuardTrait
$dataName = 'Argument',
$exceptionClass = 'Zend\Stdlib\Exception\InvalidArgumentException'
) {
if (!is_array($data) && !($data instanceof Traversable)) {
if (! is_array($data) && ! ($data instanceof Traversable)) {
$message = sprintf(
"%s must be an array or Traversable, [%s] given",
$dataName,

View file

@ -1,85 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Guard;
use Traversable;
/**
* Static guard helper class
*
* Bridges the gap for allowing refactoring until traits can be used by default.
*
* @deprecated
*/
abstract class GuardUtils
{
const DEFAULT_EXCEPTION_CLASS = 'Zend\Stdlib\Exception\InvalidArgumentException';
/**
* Verifies that the data is an array or Traversable
*
* @param mixed $data the data to verify
* @param string $dataName the data name
* @param string $exceptionClass FQCN for the exception
* @throws \Exception
*/
public static function guardForArrayOrTraversable(
$data,
$dataName = 'Argument',
$exceptionClass = self::DEFAULT_EXCEPTION_CLASS
) {
if (!is_array($data) && !($data instanceof Traversable)) {
$message = sprintf(
'%s must be an array or Traversable, [%s] given',
$dataName,
is_object($data) ? get_class($data) : gettype($data)
);
throw new $exceptionClass($message);
}
}
/**
* Verify that the data is not empty
*
* @param mixed $data the data to verify
* @param string $dataName the data name
* @param string $exceptionClass FQCN for the exception
* @throws \Exception
*/
public static function guardAgainstEmpty(
$data,
$dataName = 'Argument',
$exceptionClass = self::DEFAULT_EXCEPTION_CLASS
) {
if (empty($data)) {
$message = sprintf('%s cannot be empty', $dataName);
throw new $exceptionClass($message);
}
}
/**
* Verify that the data is not null
*
* @param mixed $data the data to verify
* @param string $dataName the data name
* @param string $exceptionClass FQCN for the exception
* @throws \Exception
*/
public static function guardAgainstNull(
$data,
$dataName = 'Argument',
$exceptionClass = self::DEFAULT_EXCEPTION_CLASS
) {
if (null === $data) {
$message = sprintf('%s cannot be null', $dataName);
throw new $exceptionClass($message);
}
}
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\AbstractHydrator as BaseAbstractHydrator;
/**
* @deprecated Use Zend\Hydrator\AbstractHydrator from zendframework/zend-hydrator instead.
*/
abstract class AbstractHydrator extends BaseAbstractHydrator implements HydratorInterface
{
}

View file

@ -1,22 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Aggregate;
use Zend\Hydrator\Aggregate\AggregateHydrator as BaseAggregateHydrator;
use Zend\Stdlib\Hydrator\HydratorInterface;
/**
* Aggregate hydrator that composes multiple hydrators via events
*
* @deprecated Use Zend\Hydrator\Aggregate\AggregateHydrator from zendframework/zend-hydrator instead.
*/
class AggregateHydrator extends BaseAggregateHydrator implements HydratorInterface
{
}

View file

@ -1,22 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Aggregate;
use Zend\Hydrator\Aggregate\ExtractEvent as BaseExtractEvent;
/**
* Event triggered when the {@see \Zend\Stdlib\Hydrator\Aggregate\AggregateHydrator} extracts
* data from an object
*
* @deprecated Use Zend\Hydrator\Aggregate\ExtractEvent from zendframework/zend-hydrator instead.
*/
class ExtractEvent extends BaseExtractEvent
{
}

View file

@ -1,22 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Aggregate;
use Zend\Hydrator\Aggregate\HydrateEvent as BaseHydrateEvent;
/**
* Event triggered when the {@see \Zend\Stdlib\Hydrator\Aggregate\AggregateHydrator} hydrates
* data into an object
*
* @deprecated Use Zend\Hydrator\Aggregate\HydrateEvent from zendframework/zend-hydrator instead.
*/
class HydrateEvent extends BaseHydrateEvent
{
}

View file

@ -1,23 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Aggregate;
use Zend\Hydrator\Aggregate\HydratorListener as BaseHydratorListener;
/**
* Aggregate listener wrapping around a hydrator. Listens
* to {@see \Zend\Stdlib\Hydrator\Aggregate::EVENT_HYDRATE} and
* {@see \Zend\Stdlib\Hydrator\Aggregate::EVENT_EXTRACT}
*
* @deprecated Use Zend\Hydrator\Aggregate\HydratorListener from zendframework/zend-hydrator instead.
*/
class HydratorListener extends BaseHydratorListener
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\ArraySerializable as BaseArraySerializable;
/**
* @deprecated Use Zend\Hydrator\ArraySerializable from zendframework/zend-hydrator instead.
*/
class ArraySerializable extends BaseArraySerializable implements HydratorInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\ClassMethods as BaseClassMethods;
/**
* @deprecated Use Zend\Hydrator\ClassMethods from zendframework/zend-hydrator instead.
*/
class ClassMethods extends BaseClassMethods implements HydratorInterface, HydratorOptionsInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\DelegatingHydrator as BaseDelegatingHydrator;
/**
* @deprecated Use Zend\Hydrator\DelegatingHydrator from zendframework/zend-hydrator instead.
*/
class DelegatingHydrator extends BaseDelegatingHydrator implements HydratorInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\DelegatingHydratorFactory as BaseDelegatingHydratorFactory;
/**
* @deprecated Use Zend\Hydrator\DelegatingHydratorFactory from zendframework/zend-hydrator instead.
*/
class DelegatingHydratorFactory extends BaseDelegatingHydratorFactory
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\FilterComposite as BaseFilterComposite;
/**
* @deprecated Use Zend\Hydrator\Filter\FilterComposite from zendframework/zend-hydrator instead.
*/
class FilterComposite extends BaseFilterComposite implements FilterInterface
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\FilterInterface as BaseFilterInterface;
/**
* @deprecated Use Zend\Hydrator\Filter\FilterInterface from zendframework/zend-hydrator instead.
*/
interface FilterInterface extends BaseFilterInterface
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\FilterProviderInterface as BaseFilterProviderInterface;
/**
* @deprecated Use Zend\Hydrator\Filter\FilterProviderInterface from zendframework/zend-hydrator instead.
*/
interface FilterProviderInterface extends BaseFilterProviderInterface
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\GetFilter as BaseGetFilter;
/**
* @deprecated Use Zend\Hydrator\Filter\GetFilter from zendframework/zend-hydrator instead.
*/
class GetFilter extends BaseGetFilter implements FilterInterface
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\HasFilter as BaseHasFilter;
/**
* @deprecated Use Zend\Hydrator\Filter\HasFilter from zendframework/zend-hydrator instead.
*/
class HasFilter extends BaseHasFilter implements FilterInterface
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\IsFilter as BaseIsFilter;
/**
* @deprecated Use Zend\Hydrator\Filter\IsFilter from zendframework/zend-hydrator instead.
*/
class IsFilter extends BaseIsFilter implements FilterInterface
{
}

View file

@ -1,18 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\MethodMatchFilter as BaseMethodMatchFilter;
/**
* @deprecated Use Zend\Hydrator\Filter\MethodMatchFilter from zendframework/zend-hydrator instead.
*/
class MethodMatchFilter extends BaseMethodMatchFilter implements FilterInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\NumberOfParameterFilter as BaseNumberOfParameterFilter;
/**
* @deprecated Use Zend\Hydrator\Filter\NumberOfParameterFilter from zendframework/zend-hydrator instead.
*/
class NumberOfParameterFilter extends BaseNumberOfParameterFilter implements FilterInterface
{
}

View file

@ -1,20 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Filter;
use Zend\Hydrator\Filter\OptionalParametersFilter as BaseOptionalParametersFilter;
/**
* Filter that includes methods which have no parameters or only optional parameters
*
* @deprecated Use Zend\Hydrator\Filter\OptionalParametersFilter from zendframework/zend-hydrator instead.
*/
class OptionalParametersFilter extends BaseOptionalParametersFilter implements FilterInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\FilterEnabledInterface as BaseFilterEnabledInterface;
/**
* @deprecated Use Zend\Hydrator\FilterEnabledInterface from zendframework/zend-hydrator instead.
*/
interface FilterEnabledInterface extends BaseFilterEnabledInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\HydrationInterface as BaseHydrationInterface;
/**
* @deprecated Use Zend\Hydrator\HydrationInterface from zendframework/zend-hydrator instead.
*/
interface HydrationInterface extends BaseHydrationInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\HydratorAwareInterface as BaseHydratorAwareInterface;
/**
* @deprecated Use Zend\Hydrator\HydratorAwareInterface from zendframework/zend-hydrator instead.
*/
interface HydratorAwareInterface extends BaseHydratorAwareInterface
{
}

View file

@ -1,20 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\HydratorAwareTrait as BaseHydratorAwareTrait;
/**
* @deprecated Use Zend\Hydrator\HydratorAwareTrait from zendframework/zend-hydrator instead.
*/
trait HydratorAwareTrait
{
use BaseHydratorAwareTrait;
}

View file

@ -1,20 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Stdlib\Extractor\ExtractionInterface;
use Zend\Hydrator\HydratorInterface as BaseHydratorInterface;
/**
* @deprecated Use Zend\Hydrator\HydratorInterface from zendframework/zend-hydrator instead.
*/
interface HydratorInterface extends BaseHydratorInterface, HydrationInterface, ExtractionInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\HydratorOptionsInterface as BaseHydratorOptionsInterface;
/**
* @deprecated Use Zend\Hydrator\HydratorOptionsInterface from zendframework/zend-hydrator instead.
*/
interface HydratorOptionsInterface extends BaseHydratorOptionsInterface
{
}

View file

@ -1,23 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\HydratorPluginManager as BaseHydratorPluginManager;
/**
* Plugin manager implementation for hydrators.
*
* Enforces that adapters retrieved are instances of HydratorInterface
*
* @deprecated Use Zend\Hydrator\HydratorPluginManager from zendframework/zend-hydrator instead.
*/
class HydratorPluginManager extends BaseHydratorPluginManager
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Iterator;
use Zend\Hydrator\Iterator\HydratingArrayIterator as BaseHydratingArrayIterator;
/**
* @deprecated Use Zend\Hydrator\Iterator\HydratingArrayIterator from zendframework/zend-hydrator instead.
*/
class HydratingArrayIterator extends BaseHydratingArrayIterator implements HydratingIteratorInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Iterator;
use Zend\Hydrator\Iterator\HydratingIteratorInterface as BaseHydratingIteratorInterface;
/**
* @deprecated Use Zend\Hydrator\Iterator\HydratingIteratorInterface from zendframework/zend-hydrator instead.
*/
interface HydratingIteratorInterface extends BaseHydratingIteratorInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Iterator;
use Zend\Hydrator\Iterator\HydratingIteratorIterator as BaseHydratingIteratorIterator;
/**
* @deprecated Use Zend\Hydrator\Iterator\HydratingIteratorIterator from zendframework/zend-hydrator instead.
*/
class HydratingIteratorIterator extends BaseHydratingIteratorIterator implements HydratingIteratorInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\NamingStrategy;
use Zend\Hydrator\NamingStrategy\ArrayMapNamingStrategy as BaseArrayMapNamingStrategy;
/**
* @deprecated Use Zend\Hydrator\NamingStrategy\ArrayMapNamingStrategy from zendframework/zend-hydrator instead.
*/
class ArrayMapNamingStrategy extends BaseArrayMapNamingStrategy implements NamingStrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\NamingStrategy;
use Zend\Hydrator\NamingStrategy\CompositeNamingStrategy as BaseCompositeNamingStrategy;
/**
* @deprecated Use Zend\Hydrator\NamingStrategy\CompositeNamingStrategy from zendframework/zend-hydrator instead.
*/
class CompositeNamingStrategy extends BaseCompositeNamingStrategy implements NamingStrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\NamingStrategy;
use Zend\Hydrator\NamingStrategy\IdentityNamingStrategy as BaseIdentityNamingStrategy;
/**
* @deprecated Use Zend\Hydrator\NamingStrategy\IdentityNamingStrategy from zendframework/zend-hydrator instead.
*/
class IdentityNamingStrategy extends BaseIdentityNamingStrategy implements NamingStrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\NamingStrategy;
use Zend\Hydrator\NamingStrategy\MapNamingStrategy as BaseMapNamingStrategy;
/**
* @deprecated Use Zend\Hydrator\NamingStrategy\MapNamingStrategy from zendframework/zend-hydrator instead.
*/
class MapNamingStrategy extends BaseMapNamingStrategy implements NamingStrategyInterface
{
}

View file

@ -1,21 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\NamingStrategy;
use Zend\Hydrator\NamingStrategy\NamingStrategyInterface as BaseNamingStrategyInterface;
/**
* Allow property extraction / hydration for hydrator
*
* @deprecated Use Zend\Hydrator\NamingStrategy\NamingStrategyInterface from zendframework/zend-hydrator instead.
*/
interface NamingStrategyInterface extends BaseNamingStrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\NamingStrategy;
use Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy as BaseUnderscoreNamingStrategy;
/**
* @deprecated Use Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy from zendframework/zend-hydrator instead.
*/
class UnderscoreNamingStrategy extends BaseUnderscoreNamingStrategy implements NamingStrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\NamingStrategyEnabledInterface as BaseNamingStrategyEnabledInterface;
/**
* @deprecated Use Zend\Hydrator\NamingStrategy\NamingStrategyEnabledInterface from zendframework/zend-hydrator instead.
*/
interface NamingStrategyEnabledInterface extends BaseNamingStrategyEnabledInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\ObjectProperty as BaseObjectProperty;
/**
* @deprecated Use Zend\Hydrator\ObjectProperty from zendframework/zend-hydrator instead.
*/
class ObjectProperty extends BaseObjectProperty implements HydratorInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\Reflection as BaseReflection;
/**
* @deprecated Use Zend\Hydrator\Reflection from zendframework/zend-hydrator instead.
*/
class Reflection extends BaseReflection implements HydratorInterface
{
}

View file

@ -1,21 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\BooleanStrategy as BaseBooleanStrategy;
/**
* This Strategy extracts and hydrates int and string values to Boolean values
*
* @deprecated Use Zend\Hydrator\Strategy\BooleanStrategy from zendframework/zend-hydrator instead.
*/
class BooleanStrategy extends BaseBooleanStrategy implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\ClosureStrategy as BaseClosureStrategy;
/**
* @deprecated Use Zend\Hydrator\Strategy\ClosureStrategy from zendframework/zend-hydrator instead.
*/
class ClosureStrategy extends BaseClosureStrategy implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\DateTimeFormatterStrategy as BaseDateTimeFormatterStrategy;
/**
* @deprecated Use Zend\Hydrator\Strategy\DateTimeFormatterStrategy from zendframework/zend-hydrator instead.
*/
class DateTimeFormatterStrategy extends BaseDateTimeFormatterStrategy implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\DefaultStrategy as BaseDefaultStrategy;
/**
* @deprecated Use Zend\Hydrator\Strategy\DefaultStrategy from zendframework/zend-hydrator instead.
*/
class DefaultStrategy extends BaseDefaultStrategy implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy\Exception;
use Zend\Hydrator\Strategy\Exception;
/**
* @deprecated Use Zend\Hydrator\Strategy\Exception\ExceptionInterface from zendframework/zend-hydrator instead.
*/
interface ExceptionInterface extends Exception\ExceptionInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy\Exception;
use Zend\Hydrator\Strategy\Exception\InvalidArgumentException as BaseInvalidArgumentException;
/**
* @deprecated Use Zend\Hydrator\Strategy\Exception\InvalidArgumentException from zendframework/zend-hydrator instead.
*/
class InvalidArgumentException extends BaseInvalidArgumentException implements ExceptionInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\ExplodeStrategy as BaseExplodeStrategy;
/**
* @deprecated Use Zend\Hydrator\Strategy\ExplodeStrategy from zendframework/zend-hydrator instead.
*/
class ExplodeStrategy extends BaseExplodeStrategy implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\SerializableStrategy as BaseSerializableStrategy;
/**
* @deprecated Use Zend\Hydrator\Strategy\SerializableStrategy from zendframework/zend-hydrator instead.
*/
class SerializableStrategy extends BaseSerializableStrategy implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\StrategyChain as BaseStrategyChain;
/**
* @deprecated Use Zend\Hydrator\Strategy\StrategyChain from zendframework/zend-hydrator instead.
*/
class StrategyChain extends BaseStrategyChain implements StrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator\Strategy;
use Zend\Hydrator\Strategy\StrategyInterface as BaseStrategyInterface;
/**
* @deprecated Use Zend\Hydrator\Strategy\StrategyInterface from zendframework/zend-hydrator instead.
*/
interface StrategyInterface extends BaseStrategyInterface
{
}

View file

@ -1,19 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Stdlib\Hydrator;
use Zend\Hydrator\StrategyEnabledInterface as BaseStrategyEnabledInterface;
/**
* @deprecated Use Zend\Hydrator\Strategy\StrategyEnabledInterface from zendframework/zend-hydrator instead.
*/
interface StrategyEnabledInterface extends BaseStrategyEnabledInterface
{
}

View file

@ -9,6 +9,9 @@
namespace Zend\Stdlib;
/**
* @deprecated Since 3.1.0; use the native JsonSerializable interface
*/
interface JsonSerializable extends \JsonSerializable
{
}

View file

@ -40,7 +40,7 @@ class Message implements MessageInterface
$this->metadata[$spec] = $value;
return $this;
}
if (!is_array($spec) && !$spec instanceof Traversable) {
if (! is_array($spec) && ! $spec instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected a string, array, or Traversable argument in first position; received "%s"',
(is_object($spec) ? get_class($spec) : gettype($spec))
@ -66,7 +66,7 @@ class Message implements MessageInterface
return $this->metadata;
}
if (!is_scalar($key)) {
if (! is_scalar($key)) {
throw new Exception\InvalidArgumentException('Non-scalar argument provided for key');
}

View file

@ -70,7 +70,7 @@ class Parameters extends PhpArrayObject implements ParametersInterface
*/
public function toString()
{
return http_build_query($this);
return http_build_query($this->toArray());
}
/**

View file

@ -62,7 +62,7 @@ class PriorityList implements Iterator, Countable
*/
public function insert($name, $value, $priority = 0)
{
if (!isset($this->items[$name])) {
if (! isset($this->items[$name])) {
$this->count++;
}
@ -85,7 +85,7 @@ class PriorityList implements Iterator, Countable
*/
public function setPriority($name, $priority)
{
if (!isset($this->items[$name])) {
if (! isset($this->items[$name])) {
throw new \Exception("item $name not found");
}
@ -131,7 +131,7 @@ class PriorityList implements Iterator, Countable
*/
public function get($name)
{
if (!isset($this->items[$name])) {
if (! isset($this->items[$name])) {
return;
}
@ -145,7 +145,7 @@ class PriorityList implements Iterator, Countable
*/
protected function sort()
{
if (!$this->sorted) {
if (! $this->sorted) {
uasort($this->items, [$this, 'compare']);
$this->sorted = true;
}
@ -161,7 +161,7 @@ class PriorityList implements Iterator, Countable
protected function compare(array $item1, array $item2)
{
return ($item1['priority'] === $item2['priority'])
? ($item1['serial'] > $item2['serial'] ? -1 : 1) * $this->isLIFO
? ($item1['serial'] > $item2['serial'] ? -1 : 1) * $this->isLIFO
: ($item1['priority'] > $item2['priority'] ? -1 : 1);
}

View file

@ -99,7 +99,7 @@ class PriorityQueue implements Countable, IteratorAggregate, Serializable
unset($this->items[$key]);
$this->queue = null;
if (!$this->isEmpty()) {
if (! $this->isEmpty()) {
$queue = $this->getQueue();
foreach ($this->items as $item) {
$queue->insert($item['data'], $item['priority']);
@ -277,7 +277,7 @@ class PriorityQueue implements Countable, IteratorAggregate, Serializable
{
if (null === $this->queue) {
$this->queue = new $this->queueClass();
if (!$this->queue instanceof \SplPriorityQueue) {
if (! $this->queue instanceof \SplPriorityQueue) {
throw new Exception\DomainException(sprintf(
'PriorityQueue expects an internal queue of type SplPriorityQueue; received "%s"',
get_class($this->queue)

View file

@ -36,7 +36,7 @@ class SplPriorityQueue extends \SplPriorityQueue implements Serializable
*/
public function insert($datum, $priority)
{
if (!is_array($priority)) {
if (! is_array($priority)) {
$priority = [$priority, $this->serial--];
}
parent::insert($datum, $priority);

View file

@ -84,7 +84,7 @@ abstract class StringUtils
public static function registerWrapper($wrapper)
{
$wrapper = (string) $wrapper;
if (!in_array($wrapper, static::$wrapperRegistry, true)) {
if (! in_array($wrapper, static::$wrapperRegistry, true)) {
static::$wrapperRegistry[] = $wrapper;
}
}

View file

@ -38,11 +38,11 @@ abstract class AbstractStringWrapper implements StringWrapperInterface
{
$supportedEncodings = static::getSupportedEncodings();
if (!in_array(strtoupper($encoding), $supportedEncodings)) {
if (! in_array(strtoupper($encoding), $supportedEncodings)) {
return false;
}
if ($convertEncoding !== null && !in_array(strtoupper($convertEncoding), $supportedEncodings)) {
if ($convertEncoding !== null && ! in_array(strtoupper($convertEncoding), $supportedEncodings)) {
return false;
}
@ -61,7 +61,7 @@ abstract class AbstractStringWrapper implements StringWrapperInterface
$supportedEncodings = static::getSupportedEncodings();
$encodingUpper = strtoupper($encoding);
if (!in_array($encodingUpper, $supportedEncodings)) {
if (! in_array($encodingUpper, $supportedEncodings)) {
throw new Exception\InvalidArgumentException(
'Wrapper doesn\'t support character encoding "' . $encoding . '"'
);
@ -69,7 +69,7 @@ abstract class AbstractStringWrapper implements StringWrapperInterface
if ($convertEncoding !== null) {
$convertEncodingUpper = strtoupper($convertEncoding);
if (!in_array($convertEncodingUpper, $supportedEncodings)) {
if (! in_array($convertEncodingUpper, $supportedEncodings)) {
throw new Exception\InvalidArgumentException(
'Wrapper doesn\'t support character encoding "' . $convertEncoding . '"'
);

View file

@ -214,7 +214,7 @@ class Iconv extends AbstractStringWrapper
*/
public function __construct()
{
if (!extension_loaded('iconv')) {
if (! extension_loaded('iconv')) {
throw new Exception\ExtensionNotLoadedException(
'PHP extension "iconv" is required for this wrapper'
);

View file

@ -37,7 +37,7 @@ class Intl extends AbstractStringWrapper
*/
public function __construct()
{
if (!extension_loaded('intl')) {
if (! extension_loaded('intl')) {
throw new Exception\ExtensionNotLoadedException(
'PHP extension "intl" is required for this wrapper'
);

View file

@ -48,7 +48,7 @@ class MbString extends AbstractStringWrapper
*/
public function __construct()
{
if (!extension_loaded('mbstring')) {
if (! extension_loaded('mbstring')) {
throw new Exception\ExtensionNotLoadedException(
'PHP extension "mbstring" is required for this wrapper'
);

View file

@ -35,7 +35,7 @@ class Native extends AbstractStringWrapper
$encodingUpper = strtoupper($encoding);
$supportedEncodings = static::getSupportedEncodings();
if (!in_array($encodingUpper, $supportedEncodings)) {
if (! in_array($encodingUpper, $supportedEncodings)) {
return false;
}
@ -69,7 +69,7 @@ class Native extends AbstractStringWrapper
$supportedEncodings = static::getSupportedEncodings();
$encodingUpper = strtoupper($encoding);
if (!in_array($encodingUpper, $supportedEncodings)) {
if (! in_array($encodingUpper, $supportedEncodings)) {
throw new Exception\InvalidArgumentException(
'Wrapper doesn\'t support character encoding "' . $encoding . '"'
);

View file

@ -1,14 +0,0 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @deprecated
*/
/**
* Legacy purposes only, to prevent code that references it from breaking.
*/
trigger_error('Polyfill autoload support (file library/Zend/Stdlib/compatibility/autoload.php) is no longer necessary; please remove your require statement referencing this file', E_USER_DEPRECATED);