Skip to content

Commit 2995bb5

Browse files
committed
Refactor definition builders and remove cspray/typiphy
1 parent 6810587 commit 2995bb5

File tree

195 files changed

+4898
-4811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+4898
-4811
lines changed

annotated-container-definition.xsd

+20-22
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@
4343
<xs:complexType name="serviceDefinitionType">
4444
<xs:all>
4545
<xs:element name="type" type="fullyQualifiedClassNameString" />
46-
<xs:element name="name" type="xs:token" />
47-
<xs:element name="profiles" type="profilesType" />
48-
<xs:element name="concreteOrAbstract" type="concreteOrAbstractType" />
4946
<xs:element name="attribute" type="base64EncodedString" />
5047
</xs:all>
51-
<xs:attribute name="isPrimary" type="xs:boolean" default="false" />
48+
<xs:attribute name="isConcrete" type="xs:boolean" />
5249
</xs:complexType>
5350

5451
<xs:complexType name="aliasDefinitionsType">
@@ -104,32 +101,33 @@
104101
<xs:element name="class" type="fullyQualifiedClassNameString" />
105102
<xs:element name="method" type="classMethodString" />
106103
<xs:element name="parameter" type="classMethodParameterString" />
107-
<xs:element name="valueType" type="base64EncodedString" />
108-
<xs:element name="value" type="base64EncodedString" />
109-
<xs:element name="profiles" type="profilesType" />
110-
<xs:element name="store" type="xs:token" />
104+
<xs:element name="valueType" type="injectValueType" />
111105
<xs:element name="attribute" type="base64EncodedString" />
112106
</xs:all>
113107
</xs:complexType>
114108

115-
<xs:complexType name="profilesType">
109+
<xs:complexType name="injectValueType">
110+
<xs:choice>
111+
<xs:element name="type" type="xs:token" />
112+
<xs:element name="typeUnion" type="typeUnionType" />
113+
<xs:element name="typeIntersect" type="typeIntersectType" />
114+
</xs:choice>
115+
</xs:complexType>
116+
117+
<xs:complexType name="typeIntersectType">
116118
<xs:sequence maxOccurs="unbounded">
117-
<xs:element name="profile" type="profileString" />
119+
<xs:element name="type" type="xs:token" />
118120
</xs:sequence>
119121
</xs:complexType>
120122

121-
<xs:simpleType name="profileString">
122-
<xs:restriction base="xs:string">
123-
<xs:minLength value="1" />
124-
</xs:restriction>
125-
</xs:simpleType>
126-
127-
<xs:simpleType name="concreteOrAbstractType">
128-
<xs:restriction base="xs:string">
129-
<xs:enumeration value="Concrete" />
130-
<xs:enumeration value="Abstract" />
131-
</xs:restriction>
132-
</xs:simpleType>
123+
<xs:complexType name="typeUnionType">
124+
<xs:sequence maxOccurs="unbounded">
125+
<xs:choice>
126+
<xs:element name="type" type="xs:token" />
127+
<xs:element name="typeIntersect" type="typeIntersectType" />
128+
</xs:choice>
129+
</xs:sequence>
130+
</xs:complexType>
133131

134132
<xs:simpleType name="fullyQualifiedClassNameString">
135133
<xs:restriction base="xs:string">

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^8.1",
15+
"php": "^8.2",
1616
"ext-dom": "*",
1717
"ext-libxml": "*",
1818
"composer-runtime-api": "^2.2",
@@ -21,8 +21,7 @@
2121
"cspray/annotated-target": "^v2.0.0.alpha",
2222
"cspray/architectural-decision": "^3.0.0.alpha",
2323
"cspray/precision-stopwatch": "^0.2.0",
24-
"cspray/typiphy": "^0.4",
25-
"nikic/php-parser": "^4.19",
24+
"nikic/php-parser": "^5.3",
2625
"psr/container": "^2.0"
2726
},
2827
"require-dev": {
@@ -40,7 +39,8 @@
4039
},
4140
"files": [
4241
"src/Function/auto-wired-parameters.php",
43-
"src/Function/definitions.php"
42+
"src/Function/definitions.php",
43+
"src/Function/types.php"
4444
]
4545
},
4646
"autoload-dev": {

docs/how-to/01-add-third-party-services.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ThirdPartyServicesProvider implements DefinitionProvider {
4949
public function consume(DefinitionProviderContext $context) : void {
5050
$context->addServiceDefinition(service($loggerType = objectType(LoggerInterface::class)));
5151
$context->addServiceDelegateDefinition(
52-
serviceDelegate($loggerType, objectType(MonologLoggerFactory::class), 'createLogger')
52+
serviceDelegate(objectType(MonologLoggerFactory::class), 'createLogger')
5353
);
5454
$context->addServicePrepareDefinition(
5555
servicePrepare(

docs/references/02-functional-api.md

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ This document lists the functions for each purpose.
2323
) : \Cspray\AnnotatedContainer\Definition\AliasDefinition;
2424

2525
\Cspray\AnnotatedContainer\serviceDelegate(
26-
\Cspray\Typiphy\ObjectType $service,
2726
\Cspray\Typiphy\ObjectType $factoryClass,
2827
string $factoryMethod
2928
) : \Cspray\AnnotatedContainer\Definition\ServiceDelegateDefinition;

0 commit comments

Comments
 (0)