Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
..
.phpunit.cache
architectural-decisions.xml.bak
composer.lock
build/
vendor/
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v2.4.0](https://github.com/cspray/annotated-container/tree/v2.4.0) - 2024-06-08
## [2.4.0](https://github.com/cspray/annotated-container/tree/v2.4.0) - 2025-06-18

### Added

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Charles Sprayberry
Copyright (c) 2025 Charles Sprayberry

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
50 changes: 50 additions & 0 deletions architectural-decisions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,54 @@ functionality, you should implement your own custom ServiceAttribute.]]></conten
</deprecation>
</meta>
</architecturalDecision>
<architecturalDecision id="DeprecateDefinitionBuilderImplementations" attribute="Cspray\AnnotatedContainer\ArchitecturalDecisionRecords\DeprecateDefinitionBuilderImplementations">
<date>2025-05-15</date>
<status>Accepted</status>
<contents><![CDATA[# Deprecate Definition Builder implementations

## Context

Starting with the initial versions of Annotated Container most Definitions that make up a ContainerDefinition are
created through a series of "builder" objects using a fluent API. Ultimately, even the functional API utilizes the
builder API when you aren't using attributes to declare your ContainerDefinition. The intent of these builder objects
is to provide a singular, correct method for creating implementations for the interfaces that make up a
ContainerDefinition. In practice, these objects proved to be more difficult to use than expected, and led to an
increase in maintenance requirements.

## Decision

The fluent API for creating definitions proved to be clunky to use, hard to test properly, and created lots of
static analysis issues. In v3, these issues started to exacerbate when we needed to make changes to the underlying
Definition interfaces and their corresponding builders. Instead of continuing with this subpar system, it was
removed in v3 in favor of a concrete Factory class that ensures resultant Definitions are valid and proper without
having to rely on a chain of fluent API calls.]]></contents>
<codeAnnotations>
<codeAnnotation>
<class>Cspray\AnnotatedContainer\Definition\AliasDefinitionBuilder</class>
</codeAnnotation>
<codeAnnotation>
<class>Cspray\AnnotatedContainer\Definition\ServiceDefinitionBuilder</class>
</codeAnnotation>
<codeAnnotation>
<class>Cspray\AnnotatedContainer\Definition\ServicePrepareDefinitionBuilder</class>
</codeAnnotation>
<codeAnnotation>
<class>Cspray\AnnotatedContainer\Definition\InjectDefinitionBuilder</class>
</codeAnnotation>
<codeAnnotation>
<class>Cspray\AnnotatedContainer\Definition\ServiceDelegateDefinitionBuilder</class>
</codeAnnotation>
</codeAnnotations>
<meta>
<author>
<name>Charles Sprayberry</name>
<website>https://cspray.io</website>
<githubProfile>https://github.com/cspray</githubProfile>
</author>
<deprecation>
<since>2.4.0</since>
<scheduledForRemoval>3.0.0</scheduledForRemoval>
</deprecation>
</meta>
</architecturalDecision>
</architecturalDecisions>
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ext-libxml": "*",
"composer-runtime-api": "^2",
"brick/varexporter": "^0.3.7",
"cspray/annotated-container-adr": "^3",
"cspray/annotated-container-adr": "^3.3.2",
"cspray/annotated-container-attribute": "^1.3",
"cspray/annotated-target": "^v0.3",
"cspray/precision-stopwatch": "^0.2.0",
Expand All @@ -29,7 +29,6 @@
},
"require-dev": {
"illuminate/container": "^10.11",
"jetbrains/phpstorm-attributes": "^1.1",
"php-di/php-di": "^7.0",
"rdlowrey/auryn": "^1.4",
"roave/security-advisories": "dev-latest"
Expand Down
Loading