Flow Coding Guidelines On One Page
Flow Coding Guidelines On One Page
<?php
Prefer strict types declare(strict_types=1); Capture the joy of coding as you
namespace Acme\TestPackage; create excellent web solutions.
Namespace starts with vendor Enjoy coding. Enjoy Flow.
name followed by package key /*
* This file is part of the Acme.TestPackage package.
(name) and subparts as needed
*
* (c) Whoever wrote this
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
One use statement per line. * source code.
One use statement per */ Description of the class. Make it
namespace. as long as needed, feel free to
Order statements alphabetically. use Acme\TestPackage\Service\FooGenerator;
explain how to use it
Don't import namespaces unless use Neos\Flow\Annotations as Flow;
you use them /**
* Here goes the description of the class. It should explain what the main UpperCamelCase class name.
* purpose of this class is...
* Class names should be nouns.
No empty line between * @Flow\Scope(”singleton”) In other packages, import \Acme\
DocComment and class, */ TestPackage\UniverseAnalyzer
member var or method class UniverseAnalyzer extends BaseClass implements SomeInterface and refer to it as
{ UniverseAnalyer
/**
* Some injected dependency
*
Use @var tag. Optional
* @Flow\Inject
description goes in the first List @Flow\* before other tags:
* @var FooGenerator
comment line followed by a @var, @param, @return, @throws,
*/
@api, @since, @deprecated
blank comment line protected $someDependency = null;
/**
* @var bool
*/
static protected $addictedToFlow = true;