GithubHelp home page GithubHelp logo

coding-standard's People

Contributors

ashokadewit avatar janmartendeboer avatar jasperzeinstra avatar leonhelmus avatar marcelmediact avatar michielfb avatar vssr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

coding-standard's Issues

Remove redundant phpdocs for methods and variables

As a developer I'd like to have the requirement for phpdoc for methods/variables in classes removed, so I don't have to add irrelevant doc blocks to my code.

Now that with the latest PHP versions it's possible to set return types and parameter types within the code, having them in the phpdoc as well is redundant and only adds noise. They should only be added if there is not just one type for these variables/methods or when more information is required in the phpdoc about the variable or method..

In the following situation, the doc blocks add nothing useful:

class Foobar extends BaseFoobar
{
    private FoobarVariable $foobarVariable;

    public function __construct(FoobarVariable $foobarVariable)
    {
        $this->foobarVariable = $foobarVariable;
    }

    public function someFunction(string $key, array $values): void
    {
        $foobarVariable = $this->foobarVariable;

        // PHP magic is done here
    }
}

Acceptance criteria

  • Phpdocs are no longer mandatory in the coding standards

Enforce an empty line between parameters

By default, parameters in PHP storm are created like:

/** @var Warehouse */
private $warehouse;
/** @var PredictedStock */
private $predictedStock;

Although it is not really nice to read, testing-suite is ok with this

We want to enforce an empty line between parameters, like

/** @var Warehouse */
private $warehouse;

/** @var PredictedStock */
private $predictedStock;

Requirements

  • Empty line is enforced

Nice to have

  • Emty line is added while creating
  • PHPcs fixer(?) can automatically fix this

Add support to PHP ^8

When I try to install a package that requires mediact/coding-standard ^3.2

๎‚ฐ composer require elgentos/laravel-coding-standard --dev
Using version ^1.0 for elgentos/laravel-coding-standard
./composer.json has been updated
Running composer update elgentos/laravel-coding-standard
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mediact/coding-standard[3.0.0, ..., 3.0.2] require php ^5.4.0 || ^7.0 -> your php version (8.1.3) does not satisfy that requirement.
    - mediact/coding-standard[3.1.0, ..., 3.2.0] require php ^7.0 -> your php version (8.1.3) does not satisfy that requirement.
    - elgentos/laravel-coding-standard 1.0.0 requires mediact/coding-standard ^3.0 -> satisfiable by mediact/coding-standard[3.0.0, ..., 3.2.0].
    - Root composer.json requires elgentos/laravel-coding-standard ^1.0 -> satisfiable by elgentos/laravel-coding-standard[1.0.0].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require elgentos/laravel-coding-standard:*" to figure out if any version is installable, or "composer require elgentos/laravel-coding-standard:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.