neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 218 forks source link

Code Style: Unify php file licence headers and their position #5138

Open mhsdesign opened 3 weeks ago

mhsdesign commented 3 weeks ago

Subtask of https://github.com/neos/neos-development-collection/issues/4478

@kitsunet brought up the question on our rules regarding copyright doc blocks in our classes. We agreed to the positioning of such block: If we follow PSR-12 it would be the first thing in every class, even before any declare directives.

On slack we voted for option 2:

  1. we want to keep our "This file is part of the [...] package" version
  2. introduce a reduced version without any dynamic parts
  3. get rid of the per-file copyright doc blocks (legally they aren't required)

That means a php file would start with

<?php

/*
 * (c) Contributors of the Neos Project - www.neos.io
 * Please see the LICENSE file which was distributed with this source code.
 */

declare(strict_types=1);

namespace Neos\ContentRepository\Core;

use Neos\Utility\Arrays;

Not only do we want to use this pattern for new files, but the goal would be to adjust all current files as well lint against these rules in ci.