shouldAllowExtraKeys example

 '$this->PROPERTY->toArray()'
                    ;
                }
            }

            $body .= strtr(' if (isset($this->_usedProperties[\'PROPERTY\'])) { $output[\'ORG_NAME\'] = '.$code.'; }', ['PROPERTY' => $p->getName(), 'ORG_NAME' => $p->getOriginalName(), 'CLASS' => $p->getType()]);
        }

        $extraKeys = $class->shouldAllowExtraKeys() ? ' + $this->_extraKeys' : '';

        $class->addMethod('toArray', ' public function NAME(): array { '.$body.' return $output'.$extraKeys.'; }');
    }

    private function buildConstructor(ClassBuilder $class): void
    {
Home | Imprint | This part of the site doesn't use cookies.