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

Update package to follow organization standards #89

Merged

Conversation

weierophinney
Copy link
Member

This patch updates the package to follow current ZF standards. Among other things:

  • Imports all support docs, and renames repo to zend-diagnostics
  • Use PSR-4 directory structure
  • Use zend-coding-standard for CS checks
  • Use phpunit 5/6/7 insted of 4/5
    • No custom bootstrap necessary
    • use namespaced TestCase
    • migrate setExpectedException to expectException
    • migrate getMock to createMock
    • use ::class notation everywhere
  • Use consistent license docblock everywhere
  • Adopt lowest/locked/latest test matrix

Additionally, it splits the README.md file into actual mkdocs documentation.

- Use PSR-4 directory structure
- Use zend-coding-standard for CS checks
- Use phpunit 5/6/7 insted of 4/5
  - No custom bootstrap necessary
  - use namespaced TestCase
  - migrate `setExpectedException` to `expectException`
  - migrate `getMock` to `createMock`
  - use `::class` notation everywhere
- Use consistent license docblock everywhere
- Adopt lowest/locked/latest test matrix
Splits the README.md file into a number of markdown chapters for mkdocs.
Starting in the 1.5 series, doctrine/migrations allows using a version
of ocramius/package-versions that depends on PHP 7.0 and up (usage of
return type hints, scalar type hints, and, in even later versions,
void return types).

This patch installs dependencies using PHP 5.6, to allow testing across
all versions.
@weierophinney weierophinney force-pushed the feature/modernize-package branch from 05db7a8 to a09ed00 Compare June 21, 2018 21:54
- Exception types vary between versions of the php ampq library.
- A bad conditional in guzzle3 logic may cause problems.
When running under xdebug, exceptions are thrown by the client, which we
need to catch in order to retrieve the response.
coveralls installs guzzlehttp/guzzle, which is a version 6 guzzle
client, and incompatible with v4/v5... causing tests to error!
@weierophinney weierophinney force-pushed the feature/modernize-package branch from d1cc167 to 99ef1d4 Compare June 21, 2018 22:45
@weierophinney
Copy link
Member Author

Finally have tests passing. What the matrix highlights is:

  • We need to be using recent versions of Guzzle. The ability to test against version 3, version 4, and version 5 is brittle, and version 6 is incompatible with previous versions. Since guzzle is only used for purposes of verifying page availability, we can likely bump the version at this point. (The fact that we get abandonment notices for the guzzle dependencies we DO install is a good indicator we should switch!)

  • We should likely have separate test cases for features such as redis, memcache/memcached, PDO, and Doctrine migrations support. The latter, in particular, was problematic as newer versions rely on newer versions of ocramius/proxy-manager, which rely on newer versions of ocramiux/package-versions, both of which use PHP 7.0+ features. This means that PHP 5.6 MUST currently be used to generate the composer.lock file, as package-versions is a Composer plugin, and the incompatible syntax causes errors on installation otherwise.

@weierophinney
Copy link
Member Author

weierophinney commented Jun 21, 2018

TODO:

  • Publish docs to gh-pages branch
  • Register component with zfbot

Guzzle 3 has been EOL for 5 years. 4 has been EOL for 3 years (though it
had a release ~21 months ago). Guzzle 5 is still being maintained, but
is considered legacy to the PSR-7-based Guzzle 6. Versions 4 and 5 have
the same API for our purposes, so we can support those two reasonably,
and add support for version 6 (which, while we had code to allow it, it
never was actually tested, and, in fact, did not work without
deprecation notices).
@weierophinney weierophinney force-pushed the feature/modernize-package branch from 7c2efd4 to 2e2843d Compare June 25, 2018 14:17
Guzzle 4's `Emitter::once()` method (and potentially others) has a
syntax error that is detected in PHP 7.1 and up (an attempt to bind a
variable name by the same name as a parameter to the closure). As such,
we can no longer support it.
@weierophinney weierophinney merged commit 07a84bc into zendframework:master Jun 25, 2018
weierophinney added a commit that referenced this pull request Jun 25, 2018
@weierophinney weierophinney deleted the feature/modernize-package branch June 25, 2018 15:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant