PHPackages                             uocs/uncanny-owl-coding-standards - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. uocs/uncanny-owl-coding-standards

ActivePhpcodesniffer-standard[PSR &amp; Standards](/categories/psr-standards)

uocs/uncanny-owl-coding-standards
=================================

PHP\_CodeSniffer rules (sniffs) to enforce Uncanny Owl coding conventions

v1.4(1y ago)03.6k↓31.6%[2 PRs](https://github.com/UncannyOwl/Uncanny-Owl-Coding-Standards/pulls)proprietaryPHPPHP &gt;=7.4CI failing

Since Mar 5Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/UncannyOwl/Uncanny-Owl-Coding-Standards)[ Packagist](https://packagist.org/packages/uocs/uncanny-owl-coding-standards)[ RSS](/packages/uocs-uncanny-owl-coding-standards/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (15)Versions (11)Used By (0)

Uncanny Owl Coding Standards (UOCS)
===================================

[](#uncanny-owl-coding-standards-uocs)

PHP\_CodeSniffer rules and sniffs to enforce Uncanny Owl coding conventions.

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- Composer

Installation
------------

[](#installation)

### Global Installation (Recommended)

[](#global-installation-recommended)

```
composer global require uocs/uncanny-owl-coding-standards
```

### Project Installation

[](#project-installation)

```
composer require --dev uocs/uncanny-owl-coding-standards
```

Usage
-----

[](#usage)

After installation, you can use the standards in several ways:

### Using Composer Scripts (Recommended)

[](#using-composer-scripts-recommended)

```
# Check coding standards
composer uocs [path]

# Fix coding standards
composer uocbf [path]

# Use strict mode
composer uocs-strict [path]
composer uocbf-strict [path]
```

### Using PHPCS Directly

[](#using-phpcs-directly)

```
# Check coding standards
vendor/bin/phpcs --standard=Uncanny-Owl [path]

# Fix coding standards
vendor/bin/phpcbf --standard=Uncanny-Owl [path]
```

Standards
---------

[](#standards)

The UOCS includes and extends the following standards:

- WordPress Coding Standards
- PHP Compatibility
- PHPCSExtra
- Custom Uncanny Owl rules

### Available Standards

[](#available-standards)

- `Uncanny-Owl`: Default standard with common rules
- `Uncanny-Owl-Strict`: Stricter version with additional checks

### Custom Ruleset

[](#custom-ruleset)

You can override the default ruleset for your project in two ways:

1. **Project-specific ruleset** (Recommended): Create a `phpcs.xml` or `phpcs.xml.dist` in your project root:

```

    src/
    tests/

    /vendor/*
    /node_modules/*

```

2. **Command-line Override**:

```
# Using composer script
composer uocs --standard=/path/to/your/custom-ruleset.xml [path]

# Or directly with PHPCS
vendor/bin/phpcs --standard=/path/to/your/custom-ruleset.xml [path]
```

IDE Integration
---------------

[](#ide-integration)

### Visual Studio Code

[](#visual-studio-code)

1. Install the [PHP Sniffer &amp; Beautifier](https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab) extension
2. Configure settings.json:

```
{
    "phpSniffer.standard": "Uncanny-Owl",
    "phpSniffer.run": "onType"
}
```

### PhpStorm

[](#phpstorm)

1. Go to Settings → PHP → Quality Tools → PHP\_CodeSniffer
2. Set PHP\_CodeSniffer path to your vendor/bin/phpcs
3. Go to Settings → Editor → Inspections
4. Enable PHP → Quality Tools → PHP\_CodeSniffer validation
5. Set 'Coding Standard' to Uncanny-Owl

CI/CD Integration
-----------------

[](#cicd-integration)

### Buddy

[](#buddy)

```
- pipeline: "Code Standards"
  trigger_mode: "ON_EVERY_PUSH"
  ref_name: "refs/heads/*"
  actions:
    - action: "Install Dependencies"
      type: "BUILD"
      working_directory: "/buddy/app"
      docker_image_name: "library/php"
      docker_image_tag: "8.1"
      execute_commands:
        - composer install
    - action: "Check Coding Standards"
      type: "BUILD"
      working_directory: "/buddy/app"
      docker_image_name: "library/php"
      docker_image_tag: "8.1"
      execute_commands:
        - composer uocs
```

### GitHub Actions

[](#github-actions)

```
name: PHP_CodeSniffer

on: [push, pull_request]

jobs:
  phpcs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.1'
      - name: Install Dependencies
        run: composer install
      - name: Run PHPCS
        run: composer uocs
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

1. **Standards Not Found**

    - Ensure Composer installation was successful
    - Try running `composer install` again
    - Check if the standard is listed in `vendor/bin/phpcs -i`
2. **Path Issues**

    - Use relative paths from your project root
    - Ensure the path exists and is readable

### Debug Mode

[](#debug-mode)

For detailed output, add `-v` to the composer command:

```
composer uocs -v [path]
```

Contributing
------------

[](#contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

Support
-------

[](#support)

For support, please open an issue in the GitHub repository or contact the Uncanny Owl development team.

IDE Integration
---------------

[](#ide-integration-1)

### Visual Studio Code

[](#visual-studio-code-1)

1. Install the [PHP Sniffer &amp; Beautifier](https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab) extension
2. Configure settings.json:

```
{
    "phpsab.standard": "Uncanny-Owl",
    "phpsab.executablePathCS": "/usr/local/bin/uocs",
    "phpsab.executablePathCBF": "/usr/local/bin/uocbf"
}
```

### PhpStorm

[](#phpstorm-1)

1. Go to Settings → PHP → Quality Tools → PHP\_CodeSniffer
2. Set PHP\_CodeSniffer path to the `uocs` binary
3. In Editor → Inspections → PHP → Quality Tools
4. Enable PHP\_CodeSniffer and select "Uncanny-Owl" standard

Troubleshooting
---------------

[](#troubleshooting-1)

### Common Issues

[](#common-issues-1)

1. **Standards Not Found**

```
make reinstall
```

2. **Permission Issues**

```
sudo chmod +x ./bin/uocs ./bin/uocbf
```

3. **Path Issues**

```
./bin/uocs --debug
```

### Debug Mode

[](#debug-mode-1)

For detailed output about paths and configuration:

```
./bin/uocs --debug
./bin/uocbf --debug
```

Contributing
------------

[](#contributing-1)

1. Fork the repository
2. Create your feature branch
3. Make your changes
4. Run tests and ensure coding standards:

```
make check-standards
./bin/uocs .
```

5. Submit a pull request

License
-------

[](#license-1)

MIT License - see LICENSE file for details.

Support
-------

[](#support-1)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance69

Regular maintenance activity

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

6

Last Release

424d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/190b61e1c79943e6f36f1ccc464baec1a0077006e96c3a335a0a207a48611aeb?d=identicon)[uncannyowl](/maintainers/uncannyowl)

---

Top Contributors

[![saad-siddique](https://avatars.githubusercontent.com/u/34320771?v=4)](https://github.com/saad-siddique "saad-siddique (79 commits)")[![JosephGabito](https://avatars.githubusercontent.com/u/81974552?v=4)](https://github.com/JosephGabito "JosephGabito (6 commits)")

---

Tags

standardsphpcswordpressautomatorUncanny Owl

###  Code Quality

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/uocs-uncanny-owl-coding-standards/health.svg)

```
[![Health](https://phpackages.com/badges/uocs-uncanny-owl-coding-standards/health.svg)](https://phpackages.com/packages/uocs-uncanny-owl-coding-standards)
```

###  Alternatives

[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[automattic/vipwpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions

25510.2M145](/packages/automattic-vipwpcs)[wptrt/wpthemereview

PHP\_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org

217736.5k29](/packages/wptrt-wpthemereview)[infinum/eightshift-coding-standards

Eightshift WordPress Coding Standards

1785.2k3](/packages/infinum-eightshift-coding-standards)[inpsyde/php-coding-standards

PHP 7.4+ coding standards for Syde WordPress projects.

101163.9k45](/packages/inpsyde-php-coding-standards)[mayflower/mo4-coding-standard

PHP CodeSniffer ruleset implementing the MO4 coding standards extending the Symfony coding standards.

17508.3k5](/packages/mayflower-mo4-coding-standard)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
