-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint and check schema for XML files (#2246)
- Loading branch information
Showing
21 changed files
with
106 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
lint-xml: | ||
find './tests/.' \( -name '*.xml' \) \ | ||
| while read xmlFile; \ | ||
do \ | ||
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile"|diff - "$$xmlFile"; \ | ||
if [ $$? -ne 0 ]; then echo "$$xmlFile" && exit 1; fi; \ | ||
done | ||
|
||
.PHONY: lint-xml | ||
|
||
lint-doctrine-xml-schema: | ||
find './tests/Gedmo/Mapping/Driver/Xml/.' \( -name '*.xml' \) \ | ||
| while read xmlFile; \ | ||
do \ | ||
xmllint --encode UTF-8 --format "$$xmlFile" --schema "./doctrine-mapping.xsd"; \ | ||
if [ $$? -ne 0 ]; then echo "$$xmlFile" && exit 1; fi; \ | ||
done | ||
|
||
.PHONY: lint-doctrine-xml-schema | ||
|
||
cs-fix-doctrine-xml: | ||
find './tests/Gedmo/Mapping/Driver/Xml/.' \( -name '*.xml' \) \ | ||
| while read xmlFile; \ | ||
do \ | ||
XMLLINT_INDENT=' ' xmllint --encode UTF-8 --format "$$xmlFile" --output "$$xmlFile"; \ | ||
done | ||
.PHONY: cs-fix-doctrine-xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema"> | ||
<import namespace="http://doctrine-project.org/schemas/orm/doctrine-mapping" schemaLocation="./vendor/doctrine/orm/doctrine-mapping.xsd"/> | ||
<import namespace="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping" schemaLocation="./schemas/orm/doctrine-extensions-mapping-2-2.xsd"/> | ||
</schema> |
14 changes: 2 additions & 12 deletions
14
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.ClosureTree.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<entity name="Mapping\Fixture\Xml\ClosureTree" table="closure_trees"> | ||
|
||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<field name="name" type="string" length="128"/> | ||
|
||
<field name="level" type="integer"> | ||
<gedmo:tree-level /> | ||
<gedmo:tree-level/> | ||
</field> | ||
|
||
<many-to-one field="parent" target-entity="ClosureTree"> | ||
<join-column name="parent_id" referenced-column-name="id" on-delete="CASCADE"/> | ||
<gedmo:tree-parent/> | ||
</many-to-one> | ||
|
||
<gedmo:tree type="closure"/> | ||
<gedmo:tree-closure class="Mapping\Fixture\ClosureTreeClosure"/> | ||
|
||
</entity> | ||
|
||
</doctrine-mapping> |
9 changes: 2 additions & 7 deletions
9
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.Embedded.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<embeddable name="Mapping\Fixture\Xml\Embedded"> | ||
|
||
<field name="subtitle" type="string" length="191" /> | ||
<field name="subtitle" type="string" length="191"/> | ||
</embeddable> | ||
|
||
</doctrine-mapping> |
7 changes: 1 addition & 6 deletions
7
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.EmbeddedTranslatable.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<embeddable name="Mapping\Fixture\Xml\EmbeddedTranslatable"> | ||
|
||
<field name="subtitle" type="string" length="191"> | ||
<gedmo:translatable/> | ||
</field> | ||
</embeddable> | ||
|
||
</doctrine-mapping> |
10 changes: 1 addition & 9 deletions
10
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.Loggable.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<entity name="Mapping\Fixture\Xml\Loggable" table="loggables"> | ||
|
||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<field name="title" type="string" length="128"> | ||
<gedmo:versioned/> | ||
</field> | ||
<many-to-one field="status" target-entity="Status"> | ||
<join-column name="status_id" referenced-column-name="id"/> | ||
<gedmo:versioned/> | ||
</many-to-one> | ||
|
||
<gedmo:loggable log-entry-class="Gedmo\Loggable\Entity\LogEntry"/> | ||
|
||
</entity> | ||
|
||
</doctrine-mapping> |
13 changes: 2 additions & 11 deletions
13
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.LoggableWithEmbedded.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<entity name="Mapping\Fixture\Xml\LoggableWithEmbedded" table="loggables_with_embedded"> | ||
|
||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<embedded name="embedded" class="Mapping\Fixture\Xml\Embedded"> | ||
<gedmo:versioned /> | ||
<gedmo:versioned/> | ||
</embedded> | ||
|
||
<field name="title" type="string" length="128"> | ||
<gedmo:versioned/> | ||
</field> | ||
<many-to-one field="status" target-entity="Status"> | ||
<join-column name="status_id" referenced-column-name="id"/> | ||
<gedmo:versioned/> | ||
</many-to-one> | ||
|
||
<gedmo:loggable log-entry-class="Gedmo\Loggable\Entity\LogEntry"/> | ||
|
||
</entity> | ||
|
||
</doctrine-mapping> |
23 changes: 5 additions & 18 deletions
23
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.MaterializedPathTree.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<entity name="Mapping\Fixture\Xml\MaterializedPathTree" table="materialized_path_trees"> | ||
|
||
<indexes> | ||
<index name="title_idx" columns="title"/> | ||
</indexes> | ||
|
||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<field name="level" column="lvl" type="integer"> | ||
<gedmo:tree-level/> | ||
</field> | ||
|
||
<field name="title" type="string" length="64"> | ||
<gedmo:tree-path-source /> | ||
<gedmo:tree-path-source/> | ||
</field> | ||
|
||
<field name="path" type="string" length="3000"> | ||
<gedmo:tree-path separator="," /> | ||
<gedmo:tree-path separator=","/> | ||
</field> | ||
|
||
<field name="lockTime" type="datetime"> | ||
<gedmo:tree-lock-time /> | ||
<gedmo:tree-lock-time/> | ||
</field> | ||
|
||
<many-to-one field="parent" target-entity="MaterializedPathTree"> | ||
<join-column name="parent_id" referenced-column-name="id" on-delete="CASCADE"/> | ||
<gedmo:tree-parent/> | ||
</many-to-one> | ||
|
||
<gedmo:tree type="materializedPath" activate-locking="true" locking-timeout="10" /> | ||
|
||
<gedmo:tree type="materializedPath" activate-locking="true" locking-timeout="10"/> | ||
</entity> | ||
|
||
</doctrine-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.Sluggable.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 1 addition & 5 deletions
6
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.SoftDeleteable.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<entity name="Mapping\Fixture\Xml\SoftDeleteable" table="soft_deleteables"> | ||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<field name="deletedAt" type="datetime" nullable="true"/> | ||
|
||
<gedmo:soft-deleteable field-name="deletedAt" time-aware="false" hard-delete="true"/> | ||
</entity> | ||
</doctrine-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 1 addition & 6 deletions
7
tests/Gedmo/Mapping/Driver/Xml/Mapping.Fixture.Xml.Status.dcm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
|
||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"> | ||
<entity name="Mapping\Fixture\Xml\Status" table="statuses"> | ||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO"/> | ||
</id> | ||
|
||
<field name="title" type="string" length="128"/> | ||
</entity> | ||
|
||
</doctrine-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.