pwweb / artomator

Artomator: Custom commands making life easier for Laravel.
MIT License
4 stars 1 forks source link

Controller stub not adhering to PHPCS #33

Closed frankpde closed 4 years ago

frankpde commented 4 years ago
ERROR | Missing short description in doc comment
ERROR | Missing doc comment for function __construct()
ERROR | Missing parameter comment
ERROR | Implicit true comparisons prohibited; use === TRUE instead
rabrowne85 commented 4 years ago

Can you share the phpcs config file? Will help streamline the fix.

frankpde commented 4 years ago

Sure thing. Was the one you provided.

<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
    <description>The coding standard for PWWEB/Artomator.</description>

    <file>src</file>

    <arg name="basepath" value="."/>
    <arg name="colors"/>
    <arg name="parallel" value="75"/>
    <arg value="np"/>

    <!-- Include the PSR standards -->
    <rule ref="PEAR">
        <exclude name="PEAR.NamingConventions.ValidFunctionName"/>
        <exclude name="PEAR.NamingConventions.ValidVariableName"/>
        <exclude name="PEAR.Commenting.FileComment"/>
        <exclude name="PEAR.Commenting.ClassComment"/>
        <exclude name="PEAR.WhiteSpace.ScopeIndent.IncorrectExact"/>
    </rule>
    <rule ref="PSR1" />
    <rule ref="PSR2" />
    <rule ref="PSR12" />

    <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
    <rule ref="Squiz.ControlStructures.ControlSignature"/>
    <rule ref="Squiz.ControlStructures.ElseIfDeclaration"/>
    <rule ref="Squiz.Commenting.EmptyCatchComment"/>
    <!-- <rule ref="Squiz.Commenting.InlineComment"/> -->
    <rule ref="Squiz.Commenting.LongConditionClosingComment"/>
    <rule ref="Squiz.Commenting.PostStatementComment"/>
    <rule ref="Squiz.Commenting.VariableComment"/>
    <rule ref="Squiz.Formatting.OperatorBracket"/>
    <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>
    <rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
    <rule ref="Squiz.Scope.MethodScope"/>
    <rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
    <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
    <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
    <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
    <rule ref="Generic.CodeAnalysis.EmptyStatement" />
    <rule ref="Generic.Commenting.Todo"/>
    <rule ref="Generic.Commenting.DocComment" />
    <rule ref="Generic.ControlStructures.InlineControlStructure"/>
    <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
    <rule ref="Generic.Formatting.SpaceAfterCast"/>
    <rule ref="Generic.NamingConventions.ConstructorName"/>
    <rule ref="Generic.PHP.DeprecatedFunctions"/>
    <rule ref="Generic.PHP.LowerCaseKeyword"/>
    <rule ref="Generic.Strings.UnnecessaryStringConcat"/>
    <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>

    <!-- Private methods MUST not be prefixed with an underscore -->
    <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
        <type>error</type>
    </rule>

    <!-- Private properties MUST not be prefixed with an underscore -->
    <rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
        <type>error</type>
    </rule>

</ruleset>
rabrowne85 commented 4 years ago

Update in latest version. Not everything is "fixable" due to the base issues with the Model template, but as per previous comments, if you know you're always using the same parts for the model i.e. timestamps or soft deletes, the stub file can be published and then modified to suit the requirements of the project.