yiisoft/yii2-coding-standards
Yii 2 coding standards package providing PHP_CodeSniffer ruleset, sniffs, and tooling configs based on PSR-12 with Yii2-specific tweaks. Use it to enforce Yii2 core style in framework development or in existing Yii2 applications.
squizlabs/php_codesniffer).yiisoft.array-syntax, yiisoft.naming-conventions) may clash with Laravel’s PSR-12. Mitigation: Override or disable conflicting rules via .phpcs.xml configuration.Yii::$app->request over Laravel’s $request dependency injection./legacy/ directories).extend config) to add Laravel-specific exceptions.yiisoft.array-syntax vs. Laravel’s array() vs. [])?phpstan, psalm, laravel-pint)?composer require --dev yiisoft/yii2-coding-standards
.phpcs.xml:
<config name="installedPackages" value="yiisoft/yii2-coding-standards"/>
<rule ref="yiisoft"/>
- name: Run PHP_CodeSniffer
run: vendor/bin/phpcs --standard=yiisoft src/ tests/
/legacy/ or /shared/).--ignore to exclude Laravel-specific files initially.yiisoft.naming-conventions for Laravel models).Route::get() as "non-static" (incorrectly). Add exceptions..blade.php files from PHP_CodeSniffer checks.$request injection. Document overrides.laravel-pint (formatting) or phpstan (static analysis). Use separate tools for clarity.phpcs on a sample of Laravel code to identify false positives..phpcs.xml, and test locally..phpcs.xml with Laravel-specific exceptions (e.g., exclude-patterns).yiisoft/yii2-coding-standards to a specific version to avoid breaking changes.parallel flag in phpcs).vendor/, node_modules/).phpstan or psalm if rules overlap (e.g., type hints).How can I help you explore Laravel packages today?