Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 4.x #64

Merged
merged 63 commits into from
Jan 10, 2021
Merged

Backport 4.x #64

merged 63 commits into from
Jan 10, 2021

Conversation

boesing
Copy link
Member

@boesing boesing commented Dec 2, 2020

No description provided.

Updated packages in composer to latest stable version and PHP requirements
changed to PHP ^7.1
Updated suggestion in composer.
Conflicts:
	CHANGELOG.md
…olved alias name, and not the alias itself
…tainer

Per laminas#239, currently when an argument is type-hinted but has a default
value (typically `null`), the factory raises an exception about not
being able to retrieve the value from the container. In such cases, we
can use the default value for the argument during injection.
Forward port laminas#233

Also brings in changes specific to develop branch.
…d-function

Avoid usage of leading `\` on imported functions
All these tests implemented  here previously for shared services are moved
into separate library so it should be used instead.
Previously, the imports were _mostly_ alphabetized. However, with the
switch to Laminas, the container import was now happening incorrectly
with regards to the factory interface. Additionally, it makes sense to
alphabetize to ensure we follow our own CS.

This patch updates the factory generation code to alphabetize import
statements before injecting them in the template.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
…oxy-manager` to use `laminas` equivalent of `zend-code`

Signed-off-by: Maximilian Bösing <[email protected]>
…ave 7.4 compatibility

Signed-off-by: Maximilian Bösing <[email protected]>
… aswell as `laminas/laminas-code` less than `3.3.1`

Signed-off-by: Maximilian Bösing <[email protected]>
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
`composer.lock` is not committed anymore, thus, there is no need for `latest` and `composer update` anymore

Signed-off-by: Maximilian Bösing <[email protected]>
- require `composer/package-versions-deprecated` in order to get proper installation on PHP 7.3 and 8.0
- require `phpbench/phpbench` alpha as it supports PHP 8.0
- only ignore platform-requirement for PHP until `composer/proxy-manager` supports PHP 8.0

Signed-off-by: Maximilian Bösing <[email protected]>
composer.json Outdated Show resolved Hide resolved
Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main comments:

  • We're bumping the minimum supported PHP version to 7.4. So all NEW methods should have full typehinting in place; this includes closures.
  • Add indenting to heredoc/nowdoc definitions (I have a comment on that later).
  • Don't switch between $this-> and self:: in the tests; it's a lot of noise, and we really need to have a discussion about this in the TSC to decide which one we're going to use going forward. For now, instance usage is consistent with other components, and reduces the size of this patch considerably.

src/AbstractFactory/ConfigAbstractFactory.php Outdated Show resolved Hide resolved
src/Exception/CyclicAliasException.php Outdated Show resolved Hide resolved
src/Exception/InvalidArgumentException.php Outdated Show resolved Hide resolved
src/Tool/FactoryCreator.php Outdated Show resolved Hide resolved
src/Tool/FactoryCreator.php Outdated Show resolved Hide resolved
test/Exception/CyclicAliasExceptionTest.php Outdated Show resolved Hide resolved
test/Exception/CyclicAliasExceptionTest.php Outdated Show resolved Hide resolved
test/Exception/CyclicAliasExceptionTest.php Outdated Show resolved Hide resolved
- Add typehints for any new function/method declarations.
- Do not use FQ class names; functions in strings do not need qualification.
- Indent heredoc/nowdoc declarations.
- Provide typehints on closure definitions.
- Do not use `self::` in unit tests.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
We're pinned to `~8.0.0`, and nightly targets 8.1.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
In order to get laminas-code versions that work under PHP 8, we need to have an ocramius/proxy-manager version that no longer uses zend-code.
That version is 2.11.0.
Also, we need to explicitly select a newer version of doctrine/annotations to fix conflicts with phpbench.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Signed-off-by: Maximilian Bösing <[email protected]>
- remove duplicated test
- adds typehints

Signed-off-by: Maximilian Bösing <[email protected]>
@boesing boesing merged commit b7342b7 into laminas:3.6.x Jan 10, 2021
@boesing boesing deleted the backport-4.x branch January 10, 2021 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants