Giter Site home page Giter Site logo

asispts / ptscs Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 234 KB

PSR-12 coding standard with additional strict rules

Home Page: https://packagist.org/packages/asispts/ptscs

License: MIT License

PHP 100.00%
coding-standard coding-style php phpcs-standard psr-12

ptscs's Introduction

๐Ÿ‘‹ Hi, there!

ยป This is where I showcase my personal projects and contributions ยซ


๐ŸŒŸ About me

A seasoned Backend/Full-stack Developer who used to work as a Cross-Platform Desktop Developer.

๐Ÿš† My Journey

Here's a glimpse of my learning journey:

  • 2005: Started my coding journey with Pascal and Visual Basic.
  • 2007: Began learning REALBAsic (a.k.a Xojo), diving into cross-platform desktop development.
  • 2008: Learned PHP and built my first website for a client in 2009.

In 2012, I began my career as a Remote Software Engineer. I worked for a company in Italy, developing apps for Windows, Linux, and macOS using Xojo. I also worked as a freelancer for several companies in Europe and Asia.

After a few years, I transitioned to become a Full-stack Web Developer, primarily using CodeIgniter and Symfony. I further expanded my expertise in backend development, with a strong focus on Symfony Framework. I also gained experience with WordPress, Laravel, and various frontend frameworks for different projects.

Looking ahead, I want to dive into mobile development as well.

ย 

๐ŸŒ Contributions

In addition to my personal projects, I contribute to open source projects through @pts-contrib account.

You also can check my old account: @pattisahusiwa.

ย 

๐Ÿค Get in touch

Want to collaborate or discuss a project? Drop me an email at [email protected]!


asispts's GitHub stats ย  Top Langs

ptscs's People

Contributors

asispts avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ptscs's Issues

`Squiz.WhiteSpace.MemberVarSpacing` bug

Reference: squizlabs/PHP_CodeSniffer#3594


Note:
Don't forget to remove this test and its corresponding data.

final class MemberVarSpacingTest extends SniffTestCase
{
protected function setUp(): void
{
$this->appendExclude('Squiz.Classes.ClassFileName');
}
public static function provideTestData(): Iterator
{
yield[
[
new ErrorData(5, 'Squiz.WhiteSpace.MemberVarSpacing.AfterComment'),
new ErrorData(16, 'Squiz.WhiteSpace.MemberVarSpacing.Incorrect'),
new ErrorData(28, 'Squiz.WhiteSpace.MemberVarSpacing.Incorrect'),
],
];
}
}

File header incorrect order

Describe the issue

The file-level docblock must follow the opening PHP tag in the file header
(PSR12.Files.FileHeader.IncorrectOrder)

Code to reproduce

<?php declare(strict_types=1);

/**
 * This file is part of packages
 *
 * @author  Some Author
 */
namespace App;

final class Foobar
{
}

Remove `SlevomatCodingStandard.Functions.UnusedParameter`

Coding standard can't be used for this purpose as it's unable to analyze code from a different file.

The main problem is that the rule can't ignore unused parameters that belong to the function definition inherited from parent methods or an interface. For example, in Symfony form, parameter $options is often unused, the rule will report it as unused. Although we can use phpcs:ignore to ignore this warning, it will add unnecessary technical debt.

public function buildForm(FormBuilderInterface $builder, array $options): void
{
    ...
}

We can use static analyzer for this task. See, for example, phpstan/phpstan#3031

Disallow One Line Property Doc Comment

Describe the issue

It is better to format one-line property doc comments into a multiline doc comment.

Example code

<?php declare(strict_types=1);

namespace App;

final class Foobar
{
    /** @var string */
    public $name;
}

Expected formatted code

The code will be formatted to:

<?php declare(strict_types=1);

namespace App;

final class Foobar
{
    /**
     * @var string
     */
    public $name;
}

Remove useless docblock

Example code

<?php declare(strict_types=1);

namespace App;

final class Foobar
{
    /**
     * @var string
     */
    private $value;

    /**
     * Class constructor.
     * @param string $value
     */
    public function __construct(string $value)
    {
        $this->value= $value;
    }

    /**
     * @return string
     */
    public function getValue(): string
    {
        return $this->value;
    }
}

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.