Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call-chain indentation #13

Open
gossi opened this issue Oct 18, 2014 · 0 comments
Open

Call-chain indentation #13

gossi opened this issue Oct 18, 2014 · 0 comments

Comments

@gossi
Copy link
Collaborator

gossi commented Oct 18, 2014

Indentation for call-chains, probably customizable.

tree-wise call-stack e.g. ProfileDefinition

$node
    ->children()
        ->arrayNode('indentation')
            ->children()
                ->enumNode('character')
                    ->values(['tab', 'space'])
                ->end()
                ->integerNode('size')->end()
                ->booleanNode('struct')->end()
                ->booleanNode('function')->end()
                ->booleanNode('blocks')->end()
                ->booleanNode('switch')->end()
                ->booleanNode('case')->end()
                ->booleanNode('break')->end()
                ->booleanNode('empty_lines')
            ->end()
        ->end()
    ->end()
;

Subindentations e.g. php-code-generator

$class = new PhpClass();
$class->setQualifiedName('gossi\codegen\tests\fixture\Entity')
    ->setAbstract(true)
    ->setDocblock($classDoc)
    ->setDescription($classDoc->getShortDescription())
    ->setLongDescription($classDoc->getLongDescription())
    ->setProperty(PhpProperty::create('id')
        ->setVisibility('private')
        ->setDocblock($propDoc)
        ->setDescription($propDoc->getShortDescription()))
    ->setProperty(PhpProperty::create('enabled')
        ->setVisibility('private')
        ->setDefaultValue(false))
;

$method = PhpMethod::create()
    ->setName('__construct')
    ->setFinal(true)
    ->addParameter(new PhpParameter('a'))
    ->addParameter(PhpParameter::create()
        ->setName('b')
        ->setType('array')
        ->setPassedByReference(true))
    ->addParameter(PhpParameter::create()
        ->setName('c')
        ->setType('stdClass'))
    ->addParameter(PhpParameter::create()
        ->setName('d')
        ->setDefaultValue('foo'))
    ->addParameter(PhpParameter::create()
        ->setName('e')
        ->setType('callable'))
    ->setDocblock($methodDoc)
    ->setDescription($methodDoc->getShortDescription())
    ->setLongDescription($methodDoc->getLongDescription())
;
@gossi gossi mentioned this issue Oct 18, 2014
3 tasks
@gossi gossi modified the milestone: Version 1.0 Oct 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant