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

Task/psalm coverage #394

Merged
merged 2 commits into from
Jun 18, 2024
Merged
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
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ static-analysis-set-baseline:
@./tools/psalm/vendor/bin/psalm --set-baseline=known-issues.xml --no-cache

# Update the baseline to _remove_ fixed issues. If new issues are to be added please use static-analysis-set-baseline
static-analysis-update-baseline:
@./tools/psalm/vendor/bin/psalm --update-baseline --no-cache
static-analysis-update-baseline *FLAGS:
@./tools/psalm/vendor/bin/psalm --update-baseline --no-cache {{FLAGS}}

static-analysis-clear-cache:
@./tools/psalm/vendor/bin/psalm --clear-cache
Expand All @@ -56,4 +56,4 @@ ci-check:

# Generate a new Architectural Decision Record document
generate-adr:
@./vendor/bin/architectural-decisions
@./tools/adr/bin/generate-adr
68 changes: 46 additions & 22 deletions annotated-container-definition.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="https://annotated-container.cspray.io/schema/annotated-container-definition.xsd"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
targetNamespace="https://annotated-container.cspray.io/schema/annotated-container-definition.xsd">
targetNamespace="https://annotated-container.cspray.io/schema/annotated-container-definition.xsd"
>

<xs:annotation>
<xs:documentation>
Expand Down Expand Up @@ -42,11 +42,11 @@

<xs:complexType name="serviceDefinitionType">
<xs:all>
<xs:element name="type" type="fullyQualifiedClassNameType" />
<xs:element name="type" type="fullyQualifiedClassNameString" />
<xs:element name="name" type="xs:token" />
<xs:element name="profiles" type="profilesType" />
<xs:element name="concreteOrAbstract" type="concreteOrAbstractType" />
<xs:element name="attribute" type="xs:string" />
<xs:element name="attribute" type="base64EncodedString" />
</xs:all>
<xs:attribute name="isPrimary" type="xs:boolean" default="false" />
</xs:complexType>
Expand All @@ -59,8 +59,8 @@

<xs:complexType name="aliasDefinitionType">
<xs:all>
<xs:element name="abstractService" type="fullyQualifiedClassNameType" />
<xs:element name="concreteService" type="fullyQualifiedClassNameType" />
<xs:element name="abstractService" type="fullyQualifiedClassNameString" />
<xs:element name="concreteService" type="fullyQualifiedClassNameString" />
</xs:all>
</xs:complexType>

Expand All @@ -72,9 +72,9 @@

<xs:complexType name="servicePrepareDefinitionType">
<xs:all>
<xs:element name="type" type="fullyQualifiedClassNameType" />
<xs:element name="method" type="classMethodType" />
<xs:element name="attribute" type="xs:string" />
<xs:element name="type" type="fullyQualifiedClassNameString" />
<xs:element name="method" type="classMethodString" />
<xs:element name="attribute" type="base64EncodedString" />
</xs:all>
</xs:complexType>

Expand All @@ -86,10 +86,10 @@

<xs:complexType name="serviceDelegateDefinitionType">
<xs:all>
<xs:element name="service" type="fullyQualifiedClassNameType" />
<xs:element name="delegateType" type="fullyQualifiedClassNameType" />
<xs:element name="delegateMethod" type="classMethodType" />
<xs:element name="attribute" type="xs:string" />
<xs:element name="service" type="fullyQualifiedClassNameString" />
<xs:element name="delegateType" type="fullyQualifiedClassNameString" />
<xs:element name="delegateMethod" type="classMethodString" />
<xs:element name="attribute" type="base64EncodedString" />
</xs:all>
</xs:complexType>

Expand All @@ -101,41 +101,65 @@

<xs:complexType name="injectDefinitionType">
<xs:all>
<xs:element name="class" type="fullyQualifiedClassNameType" />
<xs:element name="method" type="classMethodType" />
<xs:element name="parameter" type="xs:token" />
<xs:element name="valueType" type="xs:token" />
<xs:element name="value" type="xs:string" />
<xs:element name="class" type="fullyQualifiedClassNameString" />
<xs:element name="method" type="classMethodString" />
<xs:element name="parameter" type="classMethodParameterString" />
<xs:element name="valueType" type="base64EncodedString" />
<xs:element name="value" type="base64EncodedString" />
<xs:element name="profiles" type="profilesType" />
<xs:element name="store" type="xs:token" />
<xs:element name="attribute" type="xs:string" />
<xs:element name="attribute" type="base64EncodedString" />
</xs:all>
</xs:complexType>

<xs:complexType name="profilesType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="profile" type="xs:token" />
<xs:element name="profile" type="profileString" />
</xs:sequence>
</xs:complexType>

<xs:simpleType name="profileString">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="concreteOrAbstractType">
<xs:restriction base="xs:string">
<xs:enumeration value="Concrete" />
<xs:enumeration value="Abstract" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="fullyQualifiedClassNameType">
<xs:simpleType name="fullyQualifiedClassNameString">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:pattern value="[a-zA-Z_&#x80;-&#xff;][a-zA-Z0-9_&#x80;-&#xff;]*(\\[a-zA-Z_&#x80;-&#xff;][a-zA-Z0-9_&#x80;-&#xff;]*)*" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="classMethodType">
<xs:simpleType name="serviceString">
<xs:restriction base="xs:string">

</xs:restriction>
</xs:simpleType>

<xs:simpleType name="classMethodString">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:pattern value="[a-zA-Z_&#x80;-&#xff;][a-zA-Z0-9_&#x80;-&#xff;]*" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="classMethodParameterString">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
<xs:pattern value="[a-zA-Z_&#x80;-&#xff;][a-zA-Z0-9_&#x80;-&#xff;]*" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="base64EncodedString">
<xs:restriction base="xs:base64Binary">
</xs:restriction>
</xs:simpleType>
</xs:schema>
12 changes: 9 additions & 3 deletions annotated-container.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,23 @@

<xs:complexType name="scanDirectoriesType">
<xs:all>
<xs:element name="source" type="sourceDirsType" minOccurs="1" maxOccurs="1" />
<xs:element name="source" type="sourceDirectoriesListType" minOccurs="1" maxOccurs="1" />
<xs:element name="vendor" type="vendorPackagesType" minOccurs="0" maxOccurs="1" />
</xs:all>
</xs:complexType>

<xs:complexType name="sourceDirsType">
<xs:complexType name="sourceDirectoriesListType">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="dir" type="xs:token"/>
<xs:element name="dir" type="sourceDirectoryType"/>
</xs:sequence>
</xs:complexType>

<xs:simpleType name="sourceDirectoryType">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>

<xs:complexType name="vendorPackagesType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="package" type="vendorPackageType" minOccurs="1" maxOccurs="1" />
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
"ext-dom": "*",
"ext-libxml": "*",
"composer-runtime-api": "^2.2",
"cspray/annotated-container-adr": "^3.2",
"cspray/annotated-container-attribute": "^2.0.0.alpha.5",
"cspray/annotated-target": "^v1.1",
"cspray/annotated-container-adr": "^4.0.0.alpha",
"cspray/annotated-container-attribute": "^2.0.0-alpha",
"cspray/annotated-target": "^v2.0.0.alpha",
"cspray/architectural-decision": "^3.0.0.alpha",
"cspray/precision-stopwatch": "^0.2.0",
"cspray/typiphy": "^0.3",
"cspray/typiphy": "^0.4",
"nikic/php-parser": "^4.19",
"psr/container": "^2.0"
},
Expand Down
Loading
Loading