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
6 changes: 6 additions & 0 deletions .harper-dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MeliorStan
PHPMD
PHPStan
PHPStan's
cyclomatic
goto
58 changes: 28 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# MeliorStan

**Advanced PHPStan Rules for Superior Code Quality**
**Advanced PHPStan Rules for Code Quality and Consistency**

*Enhance your PHP codebase with intelligent static analysis rules that detect code smells, enforce naming conventions, and promote best practices.*

Expand All @@ -16,26 +16,26 @@

---

## 📋 Table of Contents
## Table of Contents

- [Features](#-features)
- [🚀 Quick Start](#-quick-start)
- [📚 Available Rules](#-available-rules)
- [🔧 Configuration](#-configuration)
- [🎯 Inspiration](#-inspiration)
- [📄 License](#-license)
- [🙏 Acknowledgments](#-acknowledgments)
- [Features](#-features)
- [Quick Start](#-quick-start)
- [Available Rules](#-available-rules)
- [Configuration](#-configuration)
- [Inspiration](#-inspiration)
- [License](#-license)
- [Acknowledgments](#-acknowledgments)

## Features
## Features

- **🔍 Comprehensive Code Analysis**: Detect code smells and potential issues
- **📏 Naming Convention Enforcement**: Ensure consistent naming across your codebase
- **⚙️ Highly Configurable**: Customize rules to match your project's standards
- **🚀 Modern PHP Support**: Built for PHP 8.3+ with PHPStan 2.1+
- **📖 Extensive Documentation**: Detailed guides for each rule
- **🧪 Well Tested**: Comprehensive test suite ensuring reliability
- **Comprehensive Code Analysis**: Detect code smells and potential issues
- **Naming Convention Enforcement**: Ensure consistent naming across your codebase
- **Highly Configurable**: Customize rules to match your project's standards
- **Modern PHP Support**: Built for PHP 8.3+ with PHPStan 2.1+
- **Extensive Documentation**: Detailed guides for each rule
- **Well Tested**: Comprehensive test suite ensuring reliability

## 🚀 Quick Start
## Quick Start

### Installation

Expand Down Expand Up @@ -70,17 +70,17 @@ parameters:
allow_underscore_prefix: false
```

## 📚 Available Rules
## Available Rules

### Naming Conventions

| Rule | Description | Target |
|------|-------------|---------|
| **[BooleanGetMethodName](docs/BooleanGetMethodName.md)** | Prevents `get*` methods from returning boolean values | Methods |
| **[CamelCase Method Name](docs/CamelCaseMethodName.md)** | Enforces camelCase for method names | Methods |
| **[CamelCase Parameter Name](docs/CamelCaseParameterName.md)** | Enforces camelCase for parameter names | Parameters |
| **[CamelCase Property Name](docs/CamelCasePropertyName.md)** | Enforces camelCase for property names | Properties |
| **[CamelCase Variable Name](docs/CamelCaseVariableName.md)** | Enforces camelCase for variable names | Variables |
| **[CamelCaseMethodName](docs/CamelCaseMethodName.md)** | Enforces camelCase for method names | Methods |
| **[CamelCaseParameterName](docs/CamelCaseParameterName.md)** | Enforces camelCase for parameter names | Parameters |
| **[CamelCasePropertyName](docs/CamelCasePropertyName.md)** | Enforces camelCase for property names | Properties |
| **[CamelCaseVariableName](docs/CamelCaseVariableName.md)** | Enforces camelCase for variable names | Variables |
| **[ConstantNamingConventions](docs/ConstantNamingConventions.md)** | Enforces UPPERCASE for constants | Constants |
| **[ConstructorWithNameAsEnclosingClass](docs/ConstructorWithNameAsEnclosingClass.md)** | Prevents methods with same name as their class | Methods |
| **[LongClassName](docs/LongClassName.md)** | Limits class/interface/trait/enum name length | Classes, Interfaces, Traits, Enums |
Expand Down Expand Up @@ -119,7 +119,7 @@ parameters:
| **[NumberOfChildren](docs/NumberOfChildren.md)** | Detects classes with too many direct child classes | Class Hierarchy |
| **[TooManyMethods](docs/TooManyMethods.md)** | Detects classes with too many methods | Classes, Interfaces, Traits, Enums |

## 🔧 Configuration
## Configuration

Each rule supports extensive configuration options. Refer to individual rule documentation for detailed configuration parameters.

Expand Down Expand Up @@ -157,21 +157,21 @@ parameters:
subtract_suffixes: ["Interface", "Trait"]
```

## 🎯 Inspiration
## Inspiration

Originally inspired by [**PHPMD - PHP Mess Detector**](https://phpmd.org/), this project provides modern PHPStan equivalents with enhanced configurability and PHP 8+ features.

> **Note**: While inspired by PHPMD, these rules are not exact replicas. They may offer additional or renamed customization options and are adapted for PHPStan's architecture and modern PHP practices.

## 🤝 Contributing
## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

## 📄 License
## License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

## 🙏 Acknowledgments
## Acknowledgments

- [**PHPStan**](https://phpstan.org/) - The foundation of modern PHP static analysis
- [**PHPMD**](https://phpmd.org/) - Original inspiration for code quality rules
Expand All @@ -180,8 +180,6 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE)

<div align="center">

**Made with ❤️ for the PHP community**

[📖 Documentation](docs/) • [🐛 Report Issues](https://github.com/orrison/meliorstan/issues)
[Documentation](docs/) • [Report Issues](https://github.com/orrison/meliorstan/issues)

</div>