@@ -41,36 +41,38 @@ public function __construct(string $writeDir, string $objectName, string $namesp
4141 /**
4242 * @param string $fieldName
4343 */
44- public function addScalarField (string $ fieldName )
44+ public function addScalarField (string $ fieldName, bool $ isDeprecated , ? string $ deprecationReason )
4545 {
4646 $ upperCamelCaseProp = StringLiteralFormatter::formatUpperCamelCase ($ fieldName );
47- $ this ->addSimpleSelector ($ fieldName , $ upperCamelCaseProp );
47+ $ this ->addSimpleSelector ($ fieldName , $ upperCamelCaseProp, $ isDeprecated , $ deprecationReason );
4848 }
4949
5050 /**
5151 * @param string $fieldName
5252 * @param string $typeName
5353 * @param string $argsObjectName
5454 */
55- public function addObjectField (string $ fieldName , string $ typeName , string $ argsObjectName )
55+ public function addObjectField (string $ fieldName , string $ typeName , string $ argsObjectName, bool $ isDeprecated , ? string $ deprecationReason )
5656 {
5757 $ upperCamelCaseProp = StringLiteralFormatter::formatUpperCamelCase ($ fieldName );
58- $ this ->addObjectSelector ($ fieldName , $ upperCamelCaseProp , $ typeName , $ argsObjectName );
58+ $ this ->addObjectSelector ($ fieldName , $ upperCamelCaseProp , $ typeName , $ argsObjectName, $ isDeprecated , $ deprecationReason );
5959 }
6060
6161 /**
6262 * @param string $propertyName
6363 * @param string $upperCamelName
64+ * @param bool $isDeprecated
65+ * @param string|null $deprecationReason
6466 */
65- protected function addSimpleSelector (string $ propertyName , string $ upperCamelName )
67+ protected function addSimpleSelector (string $ propertyName , string $ upperCamelName, bool $ isDeprecated , ? string $ deprecationReason )
6668 {
6769 $ method = "public function select $ upperCamelName()
6870{
6971 \$this->selectField( \"$ propertyName \");
7072
7173 return \$this;
7274} " ;
73- $ this ->classFile ->addMethod ($ method );
75+ $ this ->classFile ->addMethod ($ method, $ isDeprecated , $ deprecationReason );
7476 }
7577
7678 /**
@@ -79,7 +81,7 @@ protected function addSimpleSelector(string $propertyName, string $upperCamelNam
7981 * @param string $fieldTypeName
8082 * @param string $argsObjectName
8183 */
82- protected function addObjectSelector (string $ fieldName , string $ upperCamelName , string $ fieldTypeName , string $ argsObjectName )
84+ protected function addObjectSelector (string $ fieldName , string $ upperCamelName , string $ fieldTypeName , string $ argsObjectName, bool $ isDeprecated , ? string $ deprecationReason )
8385 {
8486 $ objectClassName = $ fieldTypeName . 'QueryObject ' ;
8587 $ argsMapClassName = $ argsObjectName . 'ArgumentsObject ' ;
@@ -93,7 +95,7 @@ protected function addObjectSelector(string $fieldName, string $upperCamelName,
9395
9496 return \$object;
9597} " ;
96- $ this ->classFile ->addMethod ($ method );
98+ $ this ->classFile ->addMethod ($ method, $ isDeprecated , $ deprecationReason );
9799 }
98100
99101 /**
@@ -103,4 +105,4 @@ public function build(): void
103105 {
104106 $ this ->classFile ->writeFile ();
105107 }
106- }
108+ }
0 commit comments