Cursor rule
.cursor/rules/moodle-php-coding-standards.mdc[object Object]
Cursor rules
Quality
50/100
Scores the file, not the repository.Length
275 words
5 headings · 1 code blocksRepository
4
— · pushed 2 days agoLast changed
3 days ago
First indexed 3 days ago.123456---7name: Moodle PHP Coding Standards8---910# Moodle PHP Coding Standards1112## Purpose13Ensure consistent PHP coding standards across all Moodle-related PHP files in the project.1415## Instructions16When working with PHP files in this Moodle project, follow these coding standards:17181. **PSR-12 Compliance**: Follow PSR-12 coding standards for all PHP code192. **Moodle Coding Style**: Adhere to Moodle's specific coding conventions203. **Indentation**: Use 4 spaces for indentation, never tabs214. **Line Length**: Keep lines under 132 characters when possible225. **Naming Conventions**:23 - Classes: PascalCase (e.g., `MoodlePlugin`)24 - Methods: camelCase (e.g., `getUserData()`)25 - Variables: camelCase (e.g., `$userData`)26 - Constants: UPPER_CASE (e.g., `MOODLE_VERSION`)276. **File Structure**: Always include proper PHP opening tag `<?php` and no closing tag287. **Comments**: Use PHPDoc blocks for classes, methods, and functions298. **Error Handling**: Use Moodle's exception handling patterns3031## Examples3233```php34<?php35// File: ./includes/classes/moodle_plugin.php3637/**38 * Example Moodle plugin class following coding standards39 *40 * @package moodle41 * @category core42 * @copyright 2024 Your Name43 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later44 */45class moodle_plugin {4647 /** @var string Plugin name */48 private $pluginname;4950 /**51 * Constructor52 *53 * @param string $pluginname The name of the plugin54 */55 public function __construct($pluginname) {56 $this->pluginname = $pluginname;57 }5859 /**60 * Get plugin data61 *62 * @return array Plugin data63 * @throws moodle_exception If plugin not found64 */65 public function getPluginData() {66 if (empty($this->pluginname)) {67 throw new moodle_exception('pluginnotfound', 'core');68 }6970 return [71 'name' => $this->pluginname,72 'version' => MOODLE_VERSION73 ];74 }75}76```7778## Exceptions79- Legacy code may not follow all standards but should be updated when modified80- Third-party libraries should maintain their original coding style81
Also in WisdmLabs/moodle-local_edwiserreports-free
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-ajax-and-js-integration.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-configuration-management.mdc · 4 | Cursor rules | agent-behaviour | 36/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-database-patterns.mdc · 4 | Cursor rules | styledatabaseagent-behaviour | 54/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-error-handling.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-events-and-callbacks.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-file-and-media-handling.mdc · 4 | Cursor rules | agent-behaviour | 36/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-internationalization.mdc · 4 | Cursor rules | agent-behaviour | 36/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-performance-optimization.mdc · 4 | Cursor rules | performanceagent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-plugin-structure.mdc · 4 | Cursor rules | archagent-behaviour | 54/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-scheduled-tasks.mdc · 4 | Cursor rules | agent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-security-practices.mdc · 4 | Cursor rules | securityagent-behaviour | 50/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-testing-and-quality.mdc · 4 | Cursor rules | testtesting-strategyagent-behaviour | 54/100 | 3 days ago | |
| WisdmLabs/moodle-local_edwiserreports-free.cursor/rules/moodle-web-services-and-api.mdc · 4 | Cursor rules | apiagent-behaviour | 50/100 | 3 days ago |
Diff against .cursor/rules/moodle-ajax-and-js-integration.mdc Diff against .cursor/rules/moodle-configuration-management.mdc Diff against .cursor/rules/moodle-database-patterns.mdc Diff against .cursor/rules/moodle-error-handling.mdc Diff against .cursor/rules/moodle-events-and-callbacks.mdc Diff against .cursor/rules/moodle-file-and-media-handling.mdc Diff against .cursor/rules/moodle-internationalization.mdc Diff against .cursor/rules/moodle-performance-optimization.mdc Diff against .cursor/rules/moodle-plugin-structure.mdc Diff against .cursor/rules/moodle-scheduled-tasks.mdc Diff against .cursor/rules/moodle-security-practices.mdc Diff against .cursor/rules/moodle-testing-and-quality.mdc Diff against .cursor/rules/moodle-web-services-and-api.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
