Laravel version update
Laravel version update
This commit is contained in:
73
vendor/zendframework/zend-stdlib/CHANGELOG.md
vendored
73
vendor/zendframework/zend-stdlib/CHANGELOG.md
vendored
@@ -2,6 +2,79 @@
|
||||
|
||||
All notable changes to this project will be documented in this file, in reverse chronological order by release.
|
||||
|
||||
## 3.2.0 - 2018-04-30
|
||||
|
||||
### Added
|
||||
|
||||
- [#87](https://github.com/zendframework/zend-stdlib/pull/87) adds support for PHP 7.2.
|
||||
|
||||
### Changed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- [#87](https://github.com/zendframework/zend-stdlib/pull/87) removes support for HHVM.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Nothing.
|
||||
|
||||
## 3.1.1 - 2018-04-12
|
||||
|
||||
### Added
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Changed
|
||||
|
||||
- [#67](https://github.com/zendframework/zend-stdlib/pull/67) changes the typehint of the `$content` property
|
||||
of the `Message` class to indicate it is a string. All known implementations
|
||||
already assumed this.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Removed
|
||||
|
||||
- Nothing.
|
||||
|
||||
### Fixed
|
||||
|
||||
- [#60](https://github.com/zendframework/zend-stdlib/pull/60) fixes an issue whereby calling `remove()` would
|
||||
incorrectly re-calculate the maximum priority stored in the queue.
|
||||
|
||||
- [#60](https://github.com/zendframework/zend-stdlib/pull/60) fixes an infinite loop condition that can occur when
|
||||
inserting an item at 0 priority.
|
||||
|
||||
## 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
|
||||
|
43
vendor/zendframework/zend-stdlib/CONDUCT.md
vendored
43
vendor/zendframework/zend-stdlib/CONDUCT.md
vendored
@@ -1,43 +0,0 @@
|
||||
# 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 everyone’s 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.
|
244
vendor/zendframework/zend-stdlib/CONTRIBUTING.md
vendored
244
vendor/zendframework/zend-stdlib/CONTRIBUTING.md
vendored
@@ -1,244 +0,0 @@
|
||||
# CONTRIBUTING
|
||||
|
||||
## RESOURCES
|
||||
|
||||
If you wish to contribute to Zend Framework, please be sure to
|
||||
read/subscribe to the following resources:
|
||||
|
||||
- [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards)
|
||||
- [Contributor's Guide](http://framework.zend.com/participate/contributor-guide)
|
||||
- ZF Contributor's mailing list:
|
||||
Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html
|
||||
Subscribe: zf-contributors-subscribe@lists.zend.com
|
||||
- ZF Contributor's IRC channel:
|
||||
#zftalk.dev on Freenode.net
|
||||
|
||||
If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-stdlib/issues/new).
|
||||
|
||||
## Reporting Potential Security Issues
|
||||
|
||||
If you have encountered a potential security vulnerability, please **DO NOT** report it on the public
|
||||
issue tracker: send it to us at [zf-security@zend.com](mailto:zf-security@zend.com) instead.
|
||||
We will work with you to verify the vulnerability and patch it as soon as possible.
|
||||
|
||||
When reporting issues, please provide the following information:
|
||||
|
||||
- Component(s) affected
|
||||
- A description indicating how to reproduce the issue
|
||||
- A summary of the security vulnerability and impact
|
||||
|
||||
We request that you contact us via the email address above and give the project
|
||||
contributors a chance to resolve the vulnerability and issue a new release prior
|
||||
to any public exposure; this helps protect users and provides them with a chance
|
||||
to upgrade and/or update in order to protect their applications.
|
||||
|
||||
For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).
|
||||
|
||||
## RUNNING TESTS
|
||||
|
||||
> ### Note: testing versions prior to 2.4
|
||||
>
|
||||
> This component originates with Zend Framework 2. During the lifetime of ZF2,
|
||||
> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no
|
||||
> changes were necessary. However, due to the migration, tests may not run on
|
||||
> versions < 2.4. As such, you may need to change the PHPUnit dependency if
|
||||
> attempting a fix on such a version.
|
||||
|
||||
To run tests:
|
||||
|
||||
- Clone the repository:
|
||||
|
||||
```console
|
||||
$ git clone git@github.com:zendframework/zend-stdlib.git
|
||||
$ cd
|
||||
```
|
||||
|
||||
- Install dependencies via composer:
|
||||
|
||||
```console
|
||||
$ curl -sS https://getcomposer.org/installer | php --
|
||||
$ ./composer.phar install
|
||||
```
|
||||
|
||||
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
|
||||
|
||||
- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
|
||||
|
||||
```console
|
||||
$ ./vendor/bin/phpunit
|
||||
```
|
||||
|
||||
You can turn on conditional tests with the phpunit.xml file.
|
||||
To do so:
|
||||
|
||||
- Copy `phpunit.xml.dist` file to `phpunit.xml`
|
||||
- Edit `phpunit.xml` to enable any specific functionality you
|
||||
want to test, as well as to provide test values to utilize.
|
||||
|
||||
## Running Coding Standards Checks
|
||||
|
||||
This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding
|
||||
standards checks, and provides configuration for our selected checks.
|
||||
`php-cs-fixer` is installed by default via Composer.
|
||||
|
||||
To run checks only:
|
||||
|
||||
```console
|
||||
$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs
|
||||
```
|
||||
|
||||
To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run`
|
||||
flag:
|
||||
|
||||
```console
|
||||
$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs
|
||||
```
|
||||
|
||||
If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure
|
||||
they pass, and make sure you add and commit the changes after verification.
|
||||
|
||||
## Benchmarks
|
||||
|
||||
We provide benchmark tests for zend-stdlib under the directory [benchmark/](benchmark/),
|
||||
using. [athletic](https://github.com/polyfractal/athletic). You can execute
|
||||
the benchmarks running the following command:
|
||||
|
||||
```bash
|
||||
$ ./vendor/bin/athletic -p benchmark
|
||||
```
|
||||
|
||||
## Recommended Workflow for Contributions
|
||||
|
||||
Your first step is to establish a public repository from which we can
|
||||
pull your work into the master repository. We recommend using
|
||||
[GitHub](https://github.com), as that is where the component is already hosted.
|
||||
|
||||
1. Setup a [GitHub account](http://github.com/), if you haven't yet
|
||||
2. Fork the repository (http://github.com/zendframework/zend-stdlib)
|
||||
3. Clone the canonical repository locally and enter it.
|
||||
|
||||
```console
|
||||
$ git clone git://github.com:zendframework/zend-stdlib.git
|
||||
$ cd zend-stdlib
|
||||
```
|
||||
|
||||
4. Add a remote to your fork; substitute your GitHub username in the command
|
||||
below.
|
||||
|
||||
```console
|
||||
$ git remote add {username} git@github.com:{username}/zend-stdlib.git
|
||||
$ git fetch {username}
|
||||
```
|
||||
|
||||
### Keeping Up-to-Date
|
||||
|
||||
Periodically, you should update your fork or personal repository to
|
||||
match the canonical ZF repository. Assuming you have setup your local repository
|
||||
per the instructions above, you can do the following:
|
||||
|
||||
|
||||
```console
|
||||
$ git checkout master
|
||||
$ git fetch origin
|
||||
$ git rebase origin/master
|
||||
# OPTIONALLY, to keep your remote up-to-date -
|
||||
$ git push {username} master:master
|
||||
```
|
||||
|
||||
If you're tracking other branches -- for example, the "develop" branch, where
|
||||
new feature development occurs -- you'll want to do the same operations for that
|
||||
branch; simply substitute "develop" for "master".
|
||||
|
||||
### Working on a patch
|
||||
|
||||
We recommend you do each new feature or bugfix in a new branch. This simplifies
|
||||
the task of code review as well as the task of merging your changes into the
|
||||
canonical repository.
|
||||
|
||||
A typical workflow will then consist of the following:
|
||||
|
||||
1. Create a new local branch based off either your master or develop branch.
|
||||
2. Switch to your new local branch. (This step can be combined with the
|
||||
previous step with the use of `git checkout -b`.)
|
||||
3. Do some work, commit, repeat as necessary.
|
||||
4. Push the local branch to your remote repository.
|
||||
5. Send a pull request.
|
||||
|
||||
The mechanics of this process are actually quite trivial. Below, we will
|
||||
create a branch for fixing an issue in the tracker.
|
||||
|
||||
```console
|
||||
$ git checkout -b hotfix/9295
|
||||
Switched to a new branch 'hotfix/9295'
|
||||
```
|
||||
|
||||
... do some work ...
|
||||
|
||||
|
||||
```console
|
||||
$ git commit
|
||||
```
|
||||
|
||||
... write your log message ...
|
||||
|
||||
|
||||
```console
|
||||
$ git push {username} hotfix/9295:hotfix/9295
|
||||
Counting objects: 38, done.
|
||||
Delta compression using up to 2 threads.
|
||||
Compression objects: 100% (18/18), done.
|
||||
Writing objects: 100% (20/20), 8.19KiB, done.
|
||||
Total 20 (delta 12), reused 0 (delta 0)
|
||||
To ssh://git@github.com/{username}/zend-stdlib.git
|
||||
b5583aa..4f51698 HEAD -> master
|
||||
```
|
||||
|
||||
To send a pull request, you have two options.
|
||||
|
||||
If using GitHub, you can do the pull request from there. Navigate to
|
||||
your repository, select the branch you just created, and then select the
|
||||
"Pull Request" button in the upper right. Select the user/organization
|
||||
"zendframework" as the recipient.
|
||||
|
||||
If using your own repository - or even if using GitHub - you can use `git
|
||||
format-patch` to create a patchset for us to apply; in fact, this is
|
||||
**recommended** for security-related patches. If you use `format-patch`, please
|
||||
send the patches as attachments to:
|
||||
|
||||
- zf-devteam@zend.com for patches without security implications
|
||||
- zf-security@zend.com for security patches
|
||||
|
||||
#### What branch to issue the pull request against?
|
||||
|
||||
Which branch should you issue a pull request against?
|
||||
|
||||
- For fixes against the stable release, issue the pull request against the
|
||||
"master" branch.
|
||||
- For new features, or fixes that introduce new elements to the public API (such
|
||||
as new public methods or properties), issue the pull request against the
|
||||
"develop" branch.
|
||||
|
||||
### Branch Cleanup
|
||||
|
||||
As you might imagine, if you are a frequent contributor, you'll start to
|
||||
get a ton of branches both locally and on your remote.
|
||||
|
||||
Once you know that your changes have been accepted to the master
|
||||
repository, we suggest doing some cleanup of these branches.
|
||||
|
||||
- Local branch cleanup
|
||||
|
||||
```console
|
||||
$ git branch -d <branchname>
|
||||
```
|
||||
|
||||
- Remote branch removal
|
||||
|
||||
```console
|
||||
$ git push {username} :<branchname>
|
||||
```
|
||||
|
||||
|
||||
## Conduct
|
||||
|
||||
Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project.
|
13
vendor/zendframework/zend-stdlib/LICENSE.md
vendored
13
vendor/zendframework/zend-stdlib/LICENSE.md
vendored
@@ -1,16 +1,15 @@
|
||||
Copyright (c) 2005-2015, Zend Technologies USA, Inc.
|
||||
|
||||
Copyright (c) 2005-2018, Zend Technologies USA, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Zend Technologies USA, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
|
17
vendor/zendframework/zend-stdlib/README.md
vendored
17
vendor/zendframework/zend-stdlib/README.md
vendored
@@ -1,13 +1,12 @@
|
||||
# zend-stdlib
|
||||
|
||||
[](https://secure.travis-ci.org/zendframework/zend-stdlib)
|
||||
[](https://coveralls.io/r/zendframework/zend-stdlib?branch=master)
|
||||
[](https://coveralls.io/github/zendframework/zend-stdlib?branch=master)
|
||||
|
||||
`Zend\Stdlib` is a set of components that implements general purpose utility
|
||||
class for different scopes like:
|
||||
|
||||
- array utilities functions;
|
||||
- json serializable interfaces;
|
||||
- general messaging systems;
|
||||
- string wrappers;
|
||||
- etc.
|
||||
@@ -15,4 +14,16 @@ 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/
|
||||
|
||||
## Benchmarks
|
||||
|
||||
We provide scripts for benchmarking zend-stdlib using the
|
||||
[PHPBench](https://github.com/phpbench/phpbench) framework; these can be
|
||||
found in the `benchmark/` directory.
|
||||
|
||||
To execute the benchmarks you can run the following command:
|
||||
|
||||
```bash
|
||||
$ vendor/bin/phpbench run --report=aggregate
|
||||
```
|
||||
|
@@ -1,56 +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 ZendBench\Stdlib;
|
||||
|
||||
use Athletic\AthleticEvent;
|
||||
use Zend\Stdlib\FastPriorityQueue;
|
||||
use Zend\Stdlib\PriorityQueue;
|
||||
use Zend\Stdlib\SplPriorityQueue;
|
||||
|
||||
class ExtractPriorityQueue extends AthleticEvent
|
||||
{
|
||||
public function classSetUp()
|
||||
{
|
||||
$this->splPriorityQueue = new SplPriorityQueue();
|
||||
$this->fastPriorityQueue = new FastPriorityQueue();
|
||||
$this->priorityQueue = new PriorityQueue();
|
||||
|
||||
for ($i = 0; $i < 5000; $i += 1) {
|
||||
$priority = rand(1, 100);
|
||||
$this->splPriorityQueue->insert('foo', $priority);
|
||||
$this->fastPriorityQueue->insert('foo', $priority);
|
||||
$this->priorityQueue->insert('foo', $priority);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 5000
|
||||
*/
|
||||
public function extractSplPriorityQueue()
|
||||
{
|
||||
$this->splPriorityQueue->extract();
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 5000
|
||||
*/
|
||||
public function extractPriorityQueue()
|
||||
{
|
||||
$this->priorityQueue->extract();
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 5000
|
||||
*/
|
||||
public function extractFastPriorityQueue()
|
||||
{
|
||||
$this->fastPriorityQueue->extract();
|
||||
}
|
||||
}
|
@@ -1,49 +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 ZendBench\Stdlib;
|
||||
|
||||
use Athletic\AthleticEvent;
|
||||
use Zend\Stdlib\FastPriorityQueue;
|
||||
use Zend\Stdlib\PriorityQueue;
|
||||
use Zend\Stdlib\SplPriorityQueue;
|
||||
|
||||
class InsertPriorityQueue extends AthleticEvent
|
||||
{
|
||||
public function classSetUp()
|
||||
{
|
||||
$this->splPriorityQueue = new SplPriorityQueue();
|
||||
$this->fastPriorityQueue = new FastPriorityQueue();
|
||||
$this->priorityQueue = new PriorityQueue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 5000
|
||||
*/
|
||||
public function insertSplPriorityQueue()
|
||||
{
|
||||
$this->splPriorityQueue->insert('foo', rand(1, 100));
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 5000
|
||||
*/
|
||||
public function insertPriorityQueue()
|
||||
{
|
||||
$this->priorityQueue->insert('foo', rand(1, 100));
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 5000
|
||||
*/
|
||||
public function insertFastPriorityQueue()
|
||||
{
|
||||
$this->fastPriorityQueue->insert('foo', rand(1, 100));
|
||||
}
|
||||
}
|
@@ -1,45 +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 ZendBench\Stdlib;
|
||||
|
||||
use Athletic\AthleticEvent;
|
||||
use Zend\Stdlib\FastPriorityQueue;
|
||||
use Zend\Stdlib\PriorityQueue;
|
||||
|
||||
class RemovePriorityQueue extends AthleticEvent
|
||||
{
|
||||
public function classSetUp()
|
||||
{
|
||||
$this->fastPriorityQueue = new FastPriorityQueue();
|
||||
$this->priorityQueue = new PriorityQueue();
|
||||
|
||||
for ($i = 0; $i < 1000; $i += 1) {
|
||||
$priority = rand(1, 100);
|
||||
$this->fastPriorityQueue->insert('foo', $priority);
|
||||
$this->priorityQueue->insert('foo', $priority);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 1000
|
||||
*/
|
||||
public function removePriorityQueue()
|
||||
{
|
||||
$this->priorityQueue->remove('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* @iterations 1000
|
||||
*/
|
||||
public function removeFastPriorityQueue()
|
||||
{
|
||||
$this->fastPriorityQueue->remove('foo');
|
||||
}
|
||||
}
|
55
vendor/zendframework/zend-stdlib/composer.json
vendored
55
vendor/zendframework/zend-stdlib/composer.json
vendored
@@ -1,35 +1,56 @@
|
||||
{
|
||||
"name": "zendframework/zend-stdlib",
|
||||
"description": " ",
|
||||
"description": "SPL extensions, array utilities, error handlers, and more",
|
||||
"license": "BSD-3-Clause",
|
||||
"keywords": [
|
||||
"zf2",
|
||||
"zf",
|
||||
"zendframework",
|
||||
"stdlib"
|
||||
],
|
||||
"homepage": "https://github.com/zendframework/zend-stdlib",
|
||||
"support": {
|
||||
"docs": "https://docs.zendframework.com/zend-stdlib/",
|
||||
"issues": "https://github.com/zendframework/zend-stdlib/issues",
|
||||
"source": "https://github.com/zendframework/zend-stdlib",
|
||||
"rss": "https://github.com/zendframework/zend-stdlib/releases.atom",
|
||||
"slack": "https://zendframework-slack.herokuapp.com",
|
||||
"forum": "https://discourse.zendframework.com/c/questions/components"
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.6 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpbench/phpbench": "^0.13",
|
||||
"phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2",
|
||||
"zendframework/zend-coding-standard": "~1.0.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Zend\\Stdlib\\": "src/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.5 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"fabpot/php-cs-fixer": "1.7.*",
|
||||
"phpunit/PHPUnit": "~4.0",
|
||||
"athletic/athletic": "~0.1"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev",
|
||||
"dev-develop": "3.1-dev"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"ZendTest\\Stdlib\\": "test/",
|
||||
"ZendBench\\Stdlib\\": "benchmark/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2.x-dev",
|
||||
"dev-develop": "3.3.x-dev"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"check": [
|
||||
"@cs-check",
|
||||
"@test"
|
||||
],
|
||||
"cs-check": "phpcs",
|
||||
"cs-fix": "phpcbf",
|
||||
"test": "phpunit --colors=always",
|
||||
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +0,0 @@
|
||||
<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>
|
||||
|
@@ -1 +0,0 @@
|
||||
../../README.md
|
@@ -1,60 +0,0 @@
|
||||
# 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.
|
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
9
vendor/zendframework/zend-stdlib/mkdocs.yml
vendored
9
vendor/zendframework/zend-stdlib/mkdocs.yml
vendored
@@ -1,9 +0,0 @@
|
||||
docs_dir: doc/book
|
||||
site_dir: doc/html
|
||||
pages:
|
||||
- index.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>'
|
@@ -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',
|
||||
|
@@ -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];
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -292,12 +292,13 @@ abstract class ArrayUtils
|
||||
}
|
||||
|
||||
/**
|
||||
* Compatibility Method for array_filter on <5.6 systems
|
||||
* @deprecated Since 3.2.0; use the native array_filter methods
|
||||
*
|
||||
* @param array $data
|
||||
* @param callable $callback
|
||||
* @param null|int $flag
|
||||
* @return array
|
||||
* @throws Exception\InvalidArgumentException
|
||||
*/
|
||||
public static function filter(array $data, $callback, $flag = null)
|
||||
{
|
||||
@@ -308,28 +309,6 @@ abstract class ArrayUtils
|
||||
));
|
||||
}
|
||||
|
||||
if (version_compare(PHP_VERSION, '5.6.0') >= 0) {
|
||||
return array_filter($data, $callback, $flag);
|
||||
}
|
||||
|
||||
$output = [];
|
||||
foreach ($data as $key => $value) {
|
||||
$params = [$value];
|
||||
|
||||
if ($flag === static::ARRAY_FILTER_USE_BOTH) {
|
||||
$params[] = $key;
|
||||
}
|
||||
|
||||
if ($flag === static::ARRAY_FILTER_USE_KEY) {
|
||||
$params = [$key];
|
||||
}
|
||||
|
||||
$response = call_user_func_array($callback, $params);
|
||||
if ($response) {
|
||||
$output[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
return array_filter($data, $callback, $flag);
|
||||
}
|
||||
}
|
||||
|
158
vendor/zendframework/zend-stdlib/src/ConsoleHelper.php
vendored
Normal file
158
vendor/zendframework/zend-stdlib/src/ConsoleHelper.php
vendored
Normal 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);
|
||||
}
|
||||
}
|
@@ -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);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ abstract class ErrorHandler
|
||||
*
|
||||
* @param bool $throw Throw the ErrorException if any
|
||||
* @return null|ErrorException
|
||||
* @throws ErrorException If an error has been catched and $throw is true
|
||||
* @throws ErrorException If an error has been caught and $throw is true
|
||||
*/
|
||||
public static function stop($throw = false)
|
||||
{
|
||||
@@ -72,7 +72,7 @@ abstract class ErrorHandler
|
||||
if (static::$stack) {
|
||||
$errorException = array_pop(static::$stack);
|
||||
|
||||
if (!static::$stack) {
|
||||
if (! static::$stack) {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
|
@@ -57,9 +57,9 @@ class FastPriorityQueue implements Iterator, Countable, Serializable
|
||||
/**
|
||||
* Max priority
|
||||
*
|
||||
* @var integer
|
||||
* @var integer|null
|
||||
*/
|
||||
protected $maxPriority = 0;
|
||||
protected $maxPriority = null;
|
||||
|
||||
/**
|
||||
* Total number of elements in the queue
|
||||
@@ -86,7 +86,7 @@ class FastPriorityQueue implements Iterator, Countable, Serializable
|
||||
* Insert an element in the queue with a specified priority
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param integer $priority a positive integer
|
||||
* @param integer $priority
|
||||
*/
|
||||
public function insert($value, $priority)
|
||||
{
|
||||
@@ -96,7 +96,7 @@ class FastPriorityQueue implements Iterator, Countable, Serializable
|
||||
$this->values[$priority][] = $value;
|
||||
if (! isset($this->priorities[$priority])) {
|
||||
$this->priorities[$priority] = $priority;
|
||||
$this->maxPriority = max($priority, $this->maxPriority);
|
||||
$this->maxPriority = $this->maxPriority === null ? $priority : max($priority, $this->maxPriority);
|
||||
}
|
||||
++$this->count;
|
||||
}
|
||||
@@ -132,11 +132,35 @@ class FastPriorityQueue implements Iterator, Countable, Serializable
|
||||
*/
|
||||
public function remove($datum)
|
||||
{
|
||||
$currentIndex = $this->index;
|
||||
$currentSubIndex = $this->subIndex;
|
||||
$currentPriority = $this->maxPriority;
|
||||
|
||||
$this->rewind();
|
||||
while ($this->valid()) {
|
||||
if (current($this->values[$this->maxPriority]) === $datum) {
|
||||
$index = key($this->values[$this->maxPriority]);
|
||||
unset($this->values[$this->maxPriority][$index]);
|
||||
|
||||
// The `next()` method advances the internal array pointer, so we need to use the `reset()` function,
|
||||
// otherwise we would lose all elements before the place the pointer points.
|
||||
reset($this->values[$this->maxPriority]);
|
||||
|
||||
$this->index = $currentIndex;
|
||||
$this->subIndex = $currentSubIndex;
|
||||
|
||||
// If the array is empty we need to destroy the unnecessary priority,
|
||||
// otherwise we would end up with an incorrect value of `$this->count`
|
||||
// {@see \Zend\Stdlib\FastPriorityQueue::nextAndRemove()}.
|
||||
if (empty($this->values[$this->maxPriority])) {
|
||||
unset($this->values[$this->maxPriority]);
|
||||
unset($this->priorities[$this->maxPriority]);
|
||||
if ($this->maxPriority === $currentPriority) {
|
||||
$this->subIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$this->maxPriority = empty($this->priorities) ? null : max($this->priorities);
|
||||
--$this->count;
|
||||
return true;
|
||||
}
|
||||
@@ -191,11 +215,15 @@ class FastPriorityQueue implements Iterator, Countable, Serializable
|
||||
*/
|
||||
protected function nextAndRemove()
|
||||
{
|
||||
$key = key($this->values[$this->maxPriority]);
|
||||
|
||||
if (false === next($this->values[$this->maxPriority])) {
|
||||
unset($this->priorities[$this->maxPriority]);
|
||||
unset($this->values[$this->maxPriority]);
|
||||
$this->maxPriority = empty($this->priorities) ? 0 : max($this->priorities);
|
||||
$this->maxPriority = empty($this->priorities) ? null : max($this->priorities);
|
||||
$this->subIndex = -1;
|
||||
} else {
|
||||
unset($this->values[$this->maxPriority][$key]);
|
||||
}
|
||||
++$this->index;
|
||||
++$this->subIndex;
|
||||
@@ -211,7 +239,7 @@ class FastPriorityQueue implements Iterator, Countable, Serializable
|
||||
if (false === next($this->values[$this->maxPriority])) {
|
||||
unset($this->subPriorities[$this->maxPriority]);
|
||||
reset($this->values[$this->maxPriority]);
|
||||
$this->maxPriority = empty($this->subPriorities) ? 0 : max($this->subPriorities);
|
||||
$this->maxPriority = empty($this->subPriorities) ? null : max($this->subPriorities);
|
||||
$this->subIndex = -1;
|
||||
}
|
||||
++$this->index;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -9,6 +9,9 @@
|
||||
|
||||
namespace Zend\Stdlib;
|
||||
|
||||
/**
|
||||
* @deprecated Since 3.1.0; use the native JsonSerializable interface
|
||||
*/
|
||||
interface JsonSerializable extends \JsonSerializable
|
||||
{
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ class Message implements MessageInterface
|
||||
protected $metadata = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var mixed
|
||||
*/
|
||||
protected $content = '';
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,7 @@ class Parameters extends PhpArrayObject implements ParametersInterface
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return http_build_query($this);
|
||||
return http_build_query($this->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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 . '"'
|
||||
);
|
||||
|
@@ -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'
|
||||
);
|
||||
|
@@ -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'
|
||||
);
|
||||
|
@@ -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'
|
||||
);
|
||||
|
@@ -16,7 +16,7 @@ class Native extends AbstractStringWrapper
|
||||
{
|
||||
/**
|
||||
* The character encoding working on
|
||||
* (overwritten to change defaut encoding)
|
||||
* (overwritten to change default encoding)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
@@ -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 . '"'
|
||||
);
|
||||
|
Reference in New Issue
Block a user