All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Broadened the requirement for
symfony/finderto include version 6.x to be compatible with symfony 6.x projects.
Architecturenow uses aComposerFileParserFactoryto create a file parser.CachedComposerFileParserFactorycan be used for caching of results in order to prevent parsing the file multiple times.
- PHP8 is now supported
- PHP 7.3 is no longer supported
- The minimum compatible version of
symfony/finderwas lifted from 3.* to 4.* making this update incompatible with symfony 3.* projets.
- Fixed a typo in the error message of
mustOnlyDependOn
- Support for PHP 7.2 was dropped
- Dependencies were updated
phpunit/phpunitto 9.4+thecodingmachine/safeto 1.3+- and more...
- Added type hints to more methods
- Types used inside of generics are now also tracked correctly.
- Support for
symfony/finder5.x. This means phparch will install in symfony 4 & 5 environments.
- Architectures are now not validated to only have autoloadable dependencies anymore because this validator disregards namespace imports.
- A new
MustOnlyHaveAutoloadableDependenciesvalidator has been added in order to prevent accidental dependencies to unrelated packages that just happen to be used in the same system often.- All components in architectures are now being checked against this new validator.
- A new
MustOnlyDependOnComposerDependenciesvalidator has been added in order to prevent accidentally using namespaces that are not also declared incomposer.json. - A new
ExplicitlyAllowDependencyvalidator allows explicitly allowing dependencies from one component to another. - Architectures now have a bunch of new helper methods
mustOnlyDependOnComposerDependenciesaddsMustOnlyDependOnComposerDependenciesvalidator.addComposerBasedComponentinitializes a full component from the givencomposer.jsonfile and adds aMustOnlyDependOnComposerDependenciesvalidatorisAllowedToDependOnallows dependencies from one component to another one.disallowInterdependencemakes it easy to disallow dependence between many different components.mustNotDependOnAnyOtherComponentmakes it easy to declare core components that should not depend on anything else that is architecturally significant.
- Support for PHP 7.1 was dropped
- Allowing dependencies to Interfaces only is now possible
- Using the
AllowInterfacesValidation wrapper - Using the
mustNotDependOnmethod on a component - Using the
mustNotDirectlyDependOnmethod on an architecture
- Using the
- Bulk declaration of components using the
Architecture->componentsmethod is now possible
- Dependencies of anonymous / inner classes are now correctly tracked
- Not loading tests into production autoloader anymore
- Now ignoring references to non-existent classes
- Fixed Validators not being able to be serialized correctly for error output
- Now correctly identifies the following types of dependencies (though in most cases they have already been tracked through
usestatements):- DocBlock comments
- Static method calls
- Argument type annotations
- Return type annotations
- Namespace comparisons against higher up namespaces no longer match
- New
assertHasNoErrorsmethod was added to make checking for architecture violations in PHPUnit easier.
- Switched from using php-dependency-analysis to manually using
nikic/php-parser- phpda uses outdated dependencies that are hard to install on many up-to-date systems (such as a current laravel installation).
- Initial release. Literally everything was added.