Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 50 additions & 176 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,299 +18,173 @@ services:

# # # # # DECLARATION RULES # # # # #

# ShouldBeNamed rules
# Named rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeNamed\ClassnameRule
class: PHPat\Rule\Assertion\Declaration\Named\ClassnameRule
tags:
- phpstan.rules.rule

# ShouldBeReadonly rules
# Readonly rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeReadonly\IsReadonlyRule
class: PHPat\Rule\Assertion\Declaration\IsReadonly\IsReadonlyRule
tags:
- phpstan.rules.rule

# ShouldNotBeReadonly rules
# Abstract rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldNotBeReadonly\IsReadonlyRule
class: PHPat\Rule\Assertion\Declaration\IsAbstract\AbstractRule
tags:
- phpstan.rules.rule

# ShouldBeAbstract rules
# Final rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeAbstract\AbstractRule
class: PHPat\Rule\Assertion\Declaration\IsFinal\IsFinalRule
tags:
- phpstan.rules.rule

# ShouldNotBeAbstract rules
# Enum rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldNotBeAbstract\AbstractRule
class: PHPat\Rule\Assertion\Declaration\IsEnum\IsEnumRule
tags:
- phpstan.rules.rule

# ShouldBeFinal rules
# Invokable rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeFinal\IsFinalRule
class: PHPat\Rule\Assertion\Declaration\IsInvokable\IsInvokableRule
tags:
- phpstan.rules.rule

# ShouldNotBeFinal rules
# OnePublicMethod rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldNotBeFinal\IsFinalRule
class: PHPat\Rule\Assertion\Declaration\OnePublicMethod\HasOnlyOnePublicMethodRule
tags:
- phpstan.rules.rule

# ShouldBeEnum rules
# OnePublicMethodNamed rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeEnum\IsEnumRule
class: PHPat\Rule\Assertion\Declaration\OnePublicMethodNamed\HasOnlyOnePublicMethodNamedRule
tags:
- phpstan.rules.rule

# ShouldNotBeEnum rules
# Interface rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldNotBeEnum\IsEnumRule
class: PHPat\Rule\Assertion\Declaration\IsInterface\IsInterfaceRule
tags:
- phpstan.rules.rule

# ShouldBeInvokable rules
# Exists rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeInvokable\IsInvokableRule
tags:
- phpstan.rules.rule

# ShouldNotBeInvokable rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldNotBeInvokable\IsInvokableRule
tags:
- phpstan.rules.rule

# ShouldHaveOnlyOnePublicMethod rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldHaveOnlyOnePublicMethod\HasOnlyOnePublicMethodRule
tags:
- phpstan.rules.rule

# ShouldHaveOnlyOnePublicMethodNamed rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldHaveOnlyOnePublicMethodNamed\HasOnlyOnePublicMethodNamedRule
tags:
- phpstan.rules.rule

# ShouldBeInterface rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldBeInterface\IsInterfaceRule
tags:
- phpstan.rules.rule

# ShouldNotExist rules
-
class: PHPat\Rule\Assertion\Declaration\ShouldNotExist\ExistsRule
class: PHPat\Rule\Assertion\Declaration\Exists\ExistsRule
tags:
- phpstan.rules.rule

# # # # # RELATION RULES # # # # #

# ShouldImplement rules
# Implement rules
-
class: PHPat\Rule\Assertion\Relation\ShouldImplement\ImplementedInterfacesRule
class: PHPat\Rule\Assertion\Relation\Implement\ImplementedInterfacesRule
tags:
- phpstan.rules.rule

# ShouldExtend rules
# Extend rules
-
class: PHPat\Rule\Assertion\Relation\ShouldExtend\ParentClassRule
class: PHPat\Rule\Assertion\Relation\Extend\ParentClassRule
tags:
- phpstan.rules.rule

# ShouldInclude rules
-
class: PHPat\Rule\Assertion\Relation\ShouldInclude\IncludedTraitsRule
tags:
- phpstan.rules.rule

# ShouldNotDepend rules
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DirectInterfacesRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\ParentClassRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\IncludedTraitsRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\AllAttributesRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\ClassPropertyRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\ConstantUseRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocMethodTagRule
tags:
- phpstan.rules.rule
# Include rules
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocMixinTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocParamTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocPropertyTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocReturnTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocThrowsTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\DocVarTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\MethodParamRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\MethodReturnRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\NewRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\StaticMethodRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\CatchBlockRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\ShouldNotDepend\InstanceofRule
class: PHPat\Rule\Assertion\Relation\IncludeTrait\IncludedTraitsRule
tags:
- phpstan.rules.rule

# CanOnlyDepend rules
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DirectInterfacesRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\ParentClassRule
tags:
- phpstan.rules.rule
# Depend rules
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\IncludedTraitsRule
class: PHPat\Rule\Assertion\Relation\Depend\DirectInterfacesRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\AllAttributesRule
class: PHPat\Rule\Assertion\Relation\Depend\ParentClassRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\ClassPropertyRule
class: PHPat\Rule\Assertion\Relation\Depend\IncludedTraitsRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\ConstantUseRule
class: PHPat\Rule\Assertion\Relation\Depend\AllAttributesRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocMethodTagRule
class: PHPat\Rule\Assertion\Relation\Depend\ClassPropertyRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocMixinTagRule
class: PHPat\Rule\Assertion\Relation\Depend\ConstantUseRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocParamTagRule
class: PHPat\Rule\Assertion\Relation\Depend\DocMethodTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocPropertyTagRule
class: PHPat\Rule\Assertion\Relation\Depend\DocMixinTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocReturnTagRule
class: PHPat\Rule\Assertion\Relation\Depend\DocParamTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocThrowsTagRule
class: PHPat\Rule\Assertion\Relation\Depend\DocPropertyTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\DocVarTagRule
class: PHPat\Rule\Assertion\Relation\Depend\DocReturnTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\MethodParamRule
class: PHPat\Rule\Assertion\Relation\Depend\DocThrowsTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\MethodReturnRule
class: PHPat\Rule\Assertion\Relation\Depend\DocVarTagRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\NewRule
class: PHPat\Rule\Assertion\Relation\Depend\MethodParamRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\StaticMethodRule
class: PHPat\Rule\Assertion\Relation\Depend\MethodReturnRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\CatchBlockRule
class: PHPat\Rule\Assertion\Relation\Depend\NewRule
tags:
- phpstan.rules.rule
-
class: PHPat\Rule\Assertion\Relation\CanOnlyDepend\InstanceofRule
class: PHPat\Rule\Assertion\Relation\Depend\StaticMethodRule
tags:
- phpstan.rules.rule

# ShouldNotConstruct rules
-
class: PHPat\Rule\Assertion\Relation\ShouldNotConstruct\NewRule
class: PHPat\Rule\Assertion\Relation\Depend\CatchBlockRule
tags:
- phpstan.rules.rule

# ShouldNotExtend rules
-
class: PHPat\Rule\Assertion\Relation\ShouldNotExtend\ParentClassRule
tags:
- phpstan.rules.rule

# ShouldNotImplement rules
-
class: PHPat\Rule\Assertion\Relation\ShouldNotImplement\ImplementedInterfacesRule
class: PHPat\Rule\Assertion\Relation\Depend\InstanceofRule
tags:
- phpstan.rules.rule

# ShouldNotInclude rules
# Construct rules
-
class: PHPat\Rule\Assertion\Relation\ShouldNotInclude\IncludedTraitsRule
class: PHPat\Rule\Assertion\Relation\Construct\NewRule
tags:
- phpstan.rules.rule

# ShouldApplyAttribute rules
# ApplyAttribute rules
-
class: PHPat\Rule\Assertion\Relation\ShouldApplyAttribute\ClassAttributeRule
class: PHPat\Rule\Assertion\Relation\ApplyAttribute\ClassAttributeRule
tags:
- phpstan.rules.rule

Expand Down
10 changes: 10 additions & 0 deletions src/Rule/Assertion/Constraint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php declare(strict_types=1);

namespace PHPat\Rule\Assertion;

enum Constraint: string
{
case Should = 'should';
case ShouldNot = 'shouldNot';
case CanOnly = 'canOnly';
}
Loading