@@ -80,9 +80,9 @@ public function makeDefinitions(array $definitions) : void
8080
8181 public function generateDefinition (string $ namespacedClass , array $ properties ) : void
8282 {
83- $ parts = explode ('\\' , $ namespacedClass );
84- $ class = array_pop ($ parts );
85- $ namespace = implode ('\\' , $ parts );
83+ $ parts = \ explode ('\\' , $ namespacedClass );
84+ $ class = \ array_pop ($ parts );
85+ $ namespace = \ implode ('\\' , $ parts );
8686 $ originalType = '' ;
8787
8888 if (! isset ($ properties ['type ' ]))
@@ -180,6 +180,7 @@ public function generateDefinition(string $namespacedClass, array $properties) :
180180 }
181181
182182 $ description = '' ;
183+
183184 if (isset ($ details ['description ' ]))
184185 {
185186 $ description = $ this ->cleanDescription (\trim ($ details ['description ' ]));
@@ -190,7 +191,7 @@ public function generateDefinition(string $namespacedClass, array $properties) :
190191 $ type = $ originalType ;
191192 }
192193 $ type = \str_replace ('\\\\' , '\\' , $ type );
193- $ docBlock [] = trim ("{$ type } {$ dollar }{$ name } {$ description }" );
194+ $ docBlock [] = \ trim ("{$ type } {$ dollar }{$ name } {$ description }" );
194195 }
195196 $ this ->generateFromTemplate ($ class , ['fields ' => $ fields , 'minLength ' => $ minLength , 'maxLength ' => $ maxLength , ], $ docBlock );
196197 }
@@ -203,8 +204,9 @@ public function generateDefinition(string $namespacedClass, array $properties) :
203204 */
204205 private function getUniqueClassName (string $ namespace , string $ class ) : string
205206 {
206- $ namespace = trim ($ namespace , '\\' );
207+ $ namespace = \ trim ($ namespace , '\\' );
207208 $ class = $ this ->getClassName ($ class );
209+
208210 if (isset ($ this ->duplicateClasses [$ class ]))
209211 {
210212 $ class = $ this ->duplicateClasses [$ class ];
@@ -217,7 +219,7 @@ private function getUniqueClassName(string $namespace, string $class) : string
217219 $ fullName = '\\' . $ namespace . '\\' . $ class ;
218220
219221 // if we have seen this class before, then it is the plural version and it should be singular because CC does not know how to design an API (among other things).
220- if (! str_contains ($ fullName , 'Definition ' ) && isset ($ this ->generatedClasses [$ fullName ]))
222+ if (! \ str_contains ($ fullName , 'Definition ' ) && isset ($ this ->generatedClasses [$ fullName ]))
221223 {
222224 if (\str_ends_with ($ class , 'ies ' ))
223225 {
@@ -238,9 +240,9 @@ private function getUniqueClassName(string $namespace, string $class) : string
238240
239241 private function writeClass (string $ namespacedClass , string $ apiPath , array $ properties ) : void
240242 {
241- $ parts = explode ('\\' , $ namespacedClass );
242- $ class = array_pop ($ parts );
243- $ namespace = trim (implode ('\\' , $ parts ), '\\' );
243+ $ parts = \ explode ('\\' , $ namespacedClass );
244+ $ class = \ array_pop ($ parts );
245+ $ namespace = \ trim (\ implode ('\\' , $ parts ), '\\' );
244246
245247 $ methods = '' ;
246248 $ dollar = '$ ' ;
@@ -499,7 +501,7 @@ private function formatDescription(string $description) : string
499501 */
500502 private function generateFromTemplate (string $ name , array $ properties , array $ docBlocks ) : void
501503 {
502- $ namespace = trim ($ this ->definitionNamespace , '\\' );
504+ $ namespace = \ trim ($ this ->definitionNamespace , '\\' );
503505
504506 $ template = <<<PHP
505507<?php
@@ -588,21 +590,21 @@ private function deleteFileTree(string $path) : void
588590 $ directory = __DIR__ . '/../src/ConstantContact ' . $ path ;
589591
590592 $ iterator = new \RecursiveIteratorIterator (
591- new \RecursiveDirectoryIterator ($ directory , \RecursiveDirectoryIterator::SKIP_DOTS ),
592- \RecursiveIteratorIterator::SELF_FIRST );
593+ new \RecursiveDirectoryIterator ($ directory , \RecursiveDirectoryIterator::SKIP_DOTS ),
594+ \RecursiveIteratorIterator::SELF_FIRST
595+ );
593596
594597 foreach ($ iterator as $ item )
595598 {
596599 if (! $ item ->isDir ())
597600 {
598601 $ fileName = "{$ item }" ;
599602 // don't delete base classes
600- if (! str_ends_with ($ fileName , 'Base.php ' ))
603+ if (! \ str_ends_with ($ fileName , 'Base.php ' ))
601604 {
602- unlink ($ fileName );
605+ \ unlink ($ fileName );
603606 }
604607 }
605608 }
606609 }
607-
608610 }
0 commit comments