@@ -8,103 +8,103 @@ |
||
8 | 8 | class EntityContainerTest extends TestCase |
9 | 9 | { |
10 | 10 | |
11 | - public static function getEntityContainer(){ |
|
12 | - $entityContainer = new EntityContainer("NorthwindEntities", true,null,true); |
|
11 | + public static function getEntityContainer() { |
|
12 | + $entityContainer = new EntityContainer("NorthwindEntities", true, null, true); |
|
13 | 13 | |
14 | 14 | $entitySetarray = [ |
15 | - ['Categories','NorthwindModel.Category'], |
|
16 | - ['CustomerDemographics','NorthwindModel.CustomerDemographic'], |
|
17 | - ['Customers','NorthwindModel.Customer'], |
|
18 | - ['Employees','NorthwindModel.Employee'], |
|
19 | - ['Order_Details','NorthwindModel.Order_Detail'], |
|
20 | - ['Orders','NorthwindModel.Order'], |
|
21 | - ['Products','NorthwindModel.Product'], |
|
22 | - ['Regions','NorthwindModel.Region'], |
|
23 | - ['Shippers','NorthwindModel.Shipper'], |
|
24 | - ['Suppliers','NorthwindModel.Supplier'], |
|
25 | - ['Territories','NorthwindModel.Territory'], |
|
26 | - ['Alphabetical_list_of_products','NorthwindModel.Alphabetical_list_of_product'], |
|
27 | - ['Category_Sales_for_1997','NorthwindModel.Category_Sales_for_1997'], |
|
28 | - ['Current_Product_Lists','NorthwindModel.Current_Product_List'], |
|
29 | - ['Customer_and_Suppliers_by_Cities','NorthwindModel.Customer_and_Suppliers_by_City'], |
|
30 | - ['Invoices','NorthwindModel.Invoice'], |
|
31 | - ['Order_Details_Extendeds','NorthwindModel.Order_Details_Extended'], |
|
32 | - ['Order_Subtotals','NorthwindModel.Order_Subtotal'], |
|
33 | - ['Orders_Qries','NorthwindModel.Orders_Qry'], |
|
34 | - ['Product_Sales_for_1997','NorthwindModel.Product_Sales_for_1997'], |
|
35 | - ['Products_Above_Average_Prices','NorthwindModel.Products_Above_Average_Price'], |
|
36 | - ['Products_by_Categories','NorthwindModel.Products_by_Category'], |
|
37 | - ['Sales_by_Categories','NorthwindModel.Sales_by_Category'], |
|
38 | - ['Sales_Totals_by_Amounts','NorthwindModel.Sales_Totals_by_Amount'], |
|
39 | - ['Summary_of_Sales_by_Quarters','NorthwindModel.Summary_of_Sales_by_Quarter'], |
|
40 | - ['Summary_of_Sales_by_Years','NorthwindModel.Summary_of_Sales_by_Year'], |
|
15 | + ['Categories', 'NorthwindModel.Category'], |
|
16 | + ['CustomerDemographics', 'NorthwindModel.CustomerDemographic'], |
|
17 | + ['Customers', 'NorthwindModel.Customer'], |
|
18 | + ['Employees', 'NorthwindModel.Employee'], |
|
19 | + ['Order_Details', 'NorthwindModel.Order_Detail'], |
|
20 | + ['Orders', 'NorthwindModel.Order'], |
|
21 | + ['Products', 'NorthwindModel.Product'], |
|
22 | + ['Regions', 'NorthwindModel.Region'], |
|
23 | + ['Shippers', 'NorthwindModel.Shipper'], |
|
24 | + ['Suppliers', 'NorthwindModel.Supplier'], |
|
25 | + ['Territories', 'NorthwindModel.Territory'], |
|
26 | + ['Alphabetical_list_of_products', 'NorthwindModel.Alphabetical_list_of_product'], |
|
27 | + ['Category_Sales_for_1997', 'NorthwindModel.Category_Sales_for_1997'], |
|
28 | + ['Current_Product_Lists', 'NorthwindModel.Current_Product_List'], |
|
29 | + ['Customer_and_Suppliers_by_Cities', 'NorthwindModel.Customer_and_Suppliers_by_City'], |
|
30 | + ['Invoices', 'NorthwindModel.Invoice'], |
|
31 | + ['Order_Details_Extendeds', 'NorthwindModel.Order_Details_Extended'], |
|
32 | + ['Order_Subtotals', 'NorthwindModel.Order_Subtotal'], |
|
33 | + ['Orders_Qries', 'NorthwindModel.Orders_Qry'], |
|
34 | + ['Product_Sales_for_1997', 'NorthwindModel.Product_Sales_for_1997'], |
|
35 | + ['Products_Above_Average_Prices', 'NorthwindModel.Products_Above_Average_Price'], |
|
36 | + ['Products_by_Categories', 'NorthwindModel.Products_by_Category'], |
|
37 | + ['Sales_by_Categories', 'NorthwindModel.Sales_by_Category'], |
|
38 | + ['Sales_Totals_by_Amounts', 'NorthwindModel.Sales_Totals_by_Amount'], |
|
39 | + ['Summary_of_Sales_by_Quarters', 'NorthwindModel.Summary_of_Sales_by_Quarter'], |
|
40 | + ['Summary_of_Sales_by_Years', 'NorthwindModel.Summary_of_Sales_by_Year'], |
|
41 | 41 | ]; |
42 | - foreach($entitySetarray as $es){ |
|
43 | - $entityContainer->addToEntitySet(new EntityContainer\EntitySet($es[0],$es[1])); |
|
42 | + foreach ($entitySetarray as $es) { |
|
43 | + $entityContainer->addToEntitySet(new EntityContainer\EntitySet($es[0], $es[1])); |
|
44 | 44 | } |
45 | 45 | $assocationSetArray = [ |
46 | 46 | new EntityContainer\AssociationSet("FK_Products_Categories", |
47 | 47 | "NorthwindModel.FK_Products_Categories", |
48 | - new EntityContainer\AssociationSet\End("Categories","Categories"), |
|
49 | - new EntityContainer\AssociationSet\End("Products","Products") |
|
48 | + new EntityContainer\AssociationSet\End("Categories", "Categories"), |
|
49 | + new EntityContainer\AssociationSet\End("Products", "Products") |
|
50 | 50 | ), |
51 | 51 | new EntityContainer\AssociationSet("CustomerCustomerDemo", |
52 | 52 | "NorthwindModel.CustomerCustomerDemo", |
53 | - new EntityContainer\AssociationSet\End("CustomerDemographics","CustomerDemographics"), |
|
54 | - new EntityContainer\AssociationSet\End("Customers","Customers") |
|
53 | + new EntityContainer\AssociationSet\End("CustomerDemographics", "CustomerDemographics"), |
|
54 | + new EntityContainer\AssociationSet\End("Customers", "Customers") |
|
55 | 55 | ), |
56 | 56 | new EntityContainer\AssociationSet("FK_Orders_Customers", |
57 | 57 | "NorthwindModel.FK_Orders_Customers", |
58 | - new EntityContainer\AssociationSet\End("Customers","Customers"), |
|
59 | - new EntityContainer\AssociationSet\End("Orders","Orders") |
|
58 | + new EntityContainer\AssociationSet\End("Customers", "Customers"), |
|
59 | + new EntityContainer\AssociationSet\End("Orders", "Orders") |
|
60 | 60 | ), |
61 | 61 | new EntityContainer\AssociationSet("FK_Employees_Employees", |
62 | 62 | "NorthwindModel.FK_Employees_Employees", |
63 | - new EntityContainer\AssociationSet\End("Employees","Employees"), |
|
64 | - new EntityContainer\AssociationSet\End("Employees","Employees1") |
|
63 | + new EntityContainer\AssociationSet\End("Employees", "Employees"), |
|
64 | + new EntityContainer\AssociationSet\End("Employees", "Employees1") |
|
65 | 65 | ), |
66 | 66 | new EntityContainer\AssociationSet("FK_Orders_Employees", |
67 | 67 | "NorthwindModel.FK_Orders_Employees", |
68 | - new EntityContainer\AssociationSet\End("Employees","Employees"), |
|
69 | - new EntityContainer\AssociationSet\End("Orders","Orders") |
|
68 | + new EntityContainer\AssociationSet\End("Employees", "Employees"), |
|
69 | + new EntityContainer\AssociationSet\End("Orders", "Orders") |
|
70 | 70 | ), |
71 | 71 | new EntityContainer\AssociationSet("EmployeeTerritories", |
72 | 72 | "NorthwindModel.EmployeeTerritories", |
73 | - new EntityContainer\AssociationSet\End("Employees","Employees"), |
|
74 | - new EntityContainer\AssociationSet\End("Territories","Territories") |
|
73 | + new EntityContainer\AssociationSet\End("Employees", "Employees"), |
|
74 | + new EntityContainer\AssociationSet\End("Territories", "Territories") |
|
75 | 75 | ), |
76 | 76 | new EntityContainer\AssociationSet("FK_Order_Details_Orders", |
77 | 77 | "NorthwindModel.FK_Order_Details_Orders", |
78 | - new EntityContainer\AssociationSet\End("Order_Details","Order_Details"), |
|
79 | - new EntityContainer\AssociationSet\End("Orders","Orders") |
|
78 | + new EntityContainer\AssociationSet\End("Order_Details", "Order_Details"), |
|
79 | + new EntityContainer\AssociationSet\End("Orders", "Orders") |
|
80 | 80 | ), |
81 | 81 | new EntityContainer\AssociationSet("FK_Order_Details_Products", |
82 | 82 | "NorthwindModel.FK_Order_Details_Products", |
83 | - new EntityContainer\AssociationSet\End("Order_Details","Order_Details"), |
|
84 | - new EntityContainer\AssociationSet\End("Products","Products") |
|
83 | + new EntityContainer\AssociationSet\End("Order_Details", "Order_Details"), |
|
84 | + new EntityContainer\AssociationSet\End("Products", "Products") |
|
85 | 85 | ), |
86 | 86 | new EntityContainer\AssociationSet("FK_Orders_Shippers", |
87 | 87 | "NorthwindModel.FK_Orders_Shippers", |
88 | - new EntityContainer\AssociationSet\End("Orders","Orders"), |
|
89 | - new EntityContainer\AssociationSet\End("Shippers","Shippers") |
|
88 | + new EntityContainer\AssociationSet\End("Orders", "Orders"), |
|
89 | + new EntityContainer\AssociationSet\End("Shippers", "Shippers") |
|
90 | 90 | ), |
91 | 91 | new EntityContainer\AssociationSet("FK_Products_Suppliers", |
92 | 92 | "NorthwindModel.FK_Products_Suppliers", |
93 | - new EntityContainer\AssociationSet\End("Products","Products"), |
|
94 | - new EntityContainer\AssociationSet\End("Suppliers","Suppliers") |
|
93 | + new EntityContainer\AssociationSet\End("Products", "Products"), |
|
94 | + new EntityContainer\AssociationSet\End("Suppliers", "Suppliers") |
|
95 | 95 | ), |
96 | 96 | new EntityContainer\AssociationSet("FK_Territories_Region", |
97 | 97 | "NorthwindModel.FK_Territories_Region", |
98 | - new EntityContainer\AssociationSet\End("Regions","Region"), |
|
99 | - new EntityContainer\AssociationSet\End("Territories","Territories") |
|
98 | + new EntityContainer\AssociationSet\End("Regions", "Region"), |
|
99 | + new EntityContainer\AssociationSet\End("Territories", "Territories") |
|
100 | 100 | ), |
101 | 101 | ]; |
102 | 102 | $entityContainer->setAssociationSet($assocationSetArray); |
103 | 103 | return $entityContainer; |
104 | 104 | } |
105 | 105 | |
106 | - public function testXmlSerialize(){ |
|
107 | - $domNode = $this->TESTNODE; |
|
106 | + public function testXmlSerialize() { |
|
107 | + $domNode = $this->TESTNODE; |
|
108 | 108 | $entityContainer = self::getEntityContainer(); |
109 | 109 | $domNode = $this->writerContext->write($entityContainer, false); |
110 | 110 | $this->TESTNODE->appendChild($domNode); |
@@ -8,7 +8,8 @@ discard block |
||
8 | 8 | class EntityContainerTest extends TestCase |
9 | 9 | { |
10 | 10 | |
11 | - public static function getEntityContainer(){ |
|
11 | + public static function getEntityContainer() |
|
12 | + { |
|
12 | 13 | $entityContainer = new EntityContainer("NorthwindEntities", true,null,true); |
13 | 14 | |
14 | 15 | $entitySetarray = [ |
@@ -39,7 +40,7 @@ discard block |
||
39 | 40 | ['Summary_of_Sales_by_Quarters','NorthwindModel.Summary_of_Sales_by_Quarter'], |
40 | 41 | ['Summary_of_Sales_by_Years','NorthwindModel.Summary_of_Sales_by_Year'], |
41 | 42 | ]; |
42 | - foreach($entitySetarray as $es){ |
|
43 | + foreach($entitySetarray as $es) { |
|
43 | 44 | $entityContainer->addToEntitySet(new EntityContainer\EntitySet($es[0],$es[1])); |
44 | 45 | } |
45 | 46 | $assocationSetArray = [ |
@@ -103,7 +104,8 @@ discard block |
||
103 | 104 | return $entityContainer; |
104 | 105 | } |
105 | 106 | |
106 | - public function testXmlSerialize(){ |
|
107 | + public function testXmlSerialize() |
|
108 | + { |
|
107 | 109 | $domNode = $this->TESTNODE; |
108 | 110 | $entityContainer = self::getEntityContainer(); |
109 | 111 | $domNode = $this->writerContext->write($entityContainer, false); |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | public function testKeyElementXmlSerialize($expected, $propertyRefArray) |
15 | 15 | { |
16 | 16 | $key = new KeyElement(); |
17 | - foreach($propertyRefArray as $proRef){ |
|
18 | - $key[]=$proRef; |
|
17 | + foreach ($propertyRefArray as $proRef) { |
|
18 | + $key[] = $proRef; |
|
19 | 19 | } |
20 | 20 | $domNode = $this->writerContext->write($key, false); |
21 | 21 | $this->TESTNODE->appendChild($domNode); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $this->assertXmlStringEqualsXmlString($expected, $xml); |
24 | 24 | } |
25 | 25 | |
26 | - public static function KeyElementProvider(){ |
|
26 | + public static function KeyElementProvider() { |
|
27 | 27 | return [ |
28 | 28 | [ |
29 | 29 | '<Key>' . |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | public function testKeyElementXmlSerialize($expected, $propertyRefArray) |
15 | 15 | { |
16 | 16 | $key = new KeyElement(); |
17 | - foreach($propertyRefArray as $proRef){ |
|
17 | + foreach($propertyRefArray as $proRef) { |
|
18 | 18 | $key[]=$proRef; |
19 | 19 | } |
20 | 20 | $domNode = $this->writerContext->write($key, false); |
@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | $this->assertXmlStringEqualsXmlString($expected, $xml); |
24 | 24 | } |
25 | 25 | |
26 | - public static function KeyElementProvider(){ |
|
26 | + public static function KeyElementProvider() |
|
27 | + { |
|
27 | 28 | return [ |
28 | 29 | [ |
29 | 30 | '<Key>' . |
@@ -21,7 +21,7 @@ |
||
21 | 21 | protected function setUp(): void |
22 | 22 | { |
23 | 23 | parent::setUp(); |
24 | - $this->writerContext = new WriterContext(OdataVersions::THREE()); |
|
24 | + $this->writerContext = new WriterContext(OdataVersions::THREE()); |
|
25 | 25 | $this->setContext($this->writerContext); |
26 | 26 | } |
27 | 27 |
@@ -9,10 +9,10 @@ |
||
9 | 9 | |
10 | 10 | class AccessorType extends Enum |
11 | 11 | { |
12 | - protected const Public = "Public"; |
|
12 | + protected const public = "Public"; |
|
13 | 13 | protected const Internal = "Internal"; |
14 | - protected const Protected = "Protected"; |
|
15 | - protected const Private = "Private"; |
|
14 | + protected const protected = "Protected"; |
|
15 | + protected const private = "Private"; |
|
16 | 16 | |
17 | 17 | public static $cgNamespace = "http://schemas.microsoft.com/ado/2006/04/codegeneration"; |
18 | 18 | } |
@@ -29,10 +29,10 @@ |
||
29 | 29 | /** |
30 | 30 | * @return array|AttributeContainer[] |
31 | 31 | */ |
32 | - abstract public function getAttributes(): array ; |
|
32 | + abstract public function getAttributes(): array; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @return array|DomBase[] |
36 | 36 | */ |
37 | - abstract public function getChildElements(): array ; |
|
37 | + abstract public function getChildElements(): array; |
|
38 | 38 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | /** |
161 | 161 | * @var PropertyRef[]|KeyElement $key |
162 | 162 | */ |
163 | - private $key ; |
|
163 | + private $key; |
|
164 | 164 | |
165 | 165 | /** |
166 | 166 | * @var PropertyHolder|Property[] $property EntityTypeProperty child elements are uniquely named within the |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | /** |
173 | 173 | * @var NavigationPropertyHolder|NavigationProperty[] $navigationProperty |
174 | 174 | */ |
175 | - private $navigationProperty ; |
|
175 | + private $navigationProperty; |
|
176 | 176 | |
177 | 177 | public function __construct( |
178 | 178 | string $name, |
@@ -98,8 +98,7 @@ |
||
98 | 98 | new AttributeContainer('Type', $this->getType()->getName()) |
99 | 99 | ]; |
100 | 100 | return $this->getType() instanceof IScalarType ? |
101 | - array_merge($this->getAttributesHasFacets(), $baseAttribute) : |
|
102 | - $baseAttribute; |
|
101 | + array_merge($this->getAttributesHasFacets(), $baseAttribute) : $baseAttribute; |
|
103 | 102 | } |
104 | 103 | |
105 | 104 | /** |
@@ -97,8 +97,7 @@ |
||
97 | 97 | new AttributeContainer('Type', strval($containerFor)) |
98 | 98 | ]; |
99 | 99 | return $containerFor instanceof IScalarType ? |
100 | - array_merge($this->getAttributesHasFacets(), $baseAttribute) : |
|
101 | - $baseAttribute; |
|
100 | + array_merge($this->getAttributesHasFacets(), $baseAttribute) : $baseAttribute; |
|
102 | 101 | } |
103 | 102 | |
104 | 103 | /** |
@@ -46,7 +46,7 @@ |
||
46 | 46 | * In this specification the namespace prefix Edm is used to represent the Entity Data Model namespace, however |
47 | 47 | * the prefix name is not prescriptive. |
48 | 48 | */ |
49 | - private const V1EdmNamespace= 'http://schemas.microsoft.com/ado/2006/04/edm'; |
|
49 | + private const V1EdmNamespace = 'http://schemas.microsoft.com/ado/2006/04/edm'; |
|
50 | 50 | private const V2EdmNamespace = 'http://schemas.microsoft.com/ado/2008/09/edm'; |
51 | 51 | private const V3EdmNamespace = 'http://schemas.microsoft.com/ado/2009/11/edm'; |
52 | 52 | /** |