Skip to content

Commit cf9fb85

Browse files
authored
Merge pull request #14 from rbergDrox/1.x
Inheritance problem - Remove the constructor
2 parents 8c766a3 + 6f16f92 commit cf9fb85

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/GraphQLTypeGenerator.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,10 @@ private function generateAbstractTypeFile(BeanDescriptorInterface $beanDescripto
9898
$baseClassName = 'TdbmObjectType';
9999
$callParentBuild = '';
100100
$isExtended = false;
101-
$parentCall = 'parent::__construct($config);';
102101
} else {
103102
$baseClassName = '\\'.$this->namespace.'\\'.$this->namingStrategy->getClassName($extendedBeanClassName);
104103
$isExtended = true;
105104
$callParentBuild = "parent::build(\$config);\n ";
106-
$parentCall = 'parent::__construct($registry, $config);';
107105
}
108106

109107
// one to many and many to many relationships:
@@ -135,17 +133,18 @@ private function generateAbstractTypeFile(BeanDescriptorInterface $beanDescripto
135133
136134
abstract class $generatedTypeClassName extends $baseClassName
137135
{
136+
137+
EOF;
138+
if (!$isExtended) {
139+
$str .= <<<EOF
138140
protected \$registry;
139141
140142
public function __construct(Registry \$registry, array \$config = [])
141143
{
142-
$parentCall
144+
parent::__construct(\$config);
143145
\$this->registry = \$registry;
144146
}
145147
146-
EOF;
147-
if (!$isExtended) {
148-
$str .= <<<EOF
149148
/**
150149
* Alters the list of properties for this type.
151150
*/

0 commit comments

Comments
 (0)