SyliusCon 2025
Early Bird Deal
LogoLogo
🛣️ Roadmap💻 Sylius Demo💬 Community Slack
  • Sylius Documentation
  • Sylius Plugins
  • Sylius Stack
  • 📖Sylius 2.0 Documentation
    • Organization
      • Release Cycle
      • Backwards Compatibility Promise
      • Sylius Team
      • Sylius Roadmap
  • Getting Started with Sylius
    • Installation
    • Basic Configuration
    • Shipping & Payment
    • First Product
    • Customizing the Shop
    • Customizing Business Logic
    • Using API
    • Installing Plugins
    • Deployment
    • Summary
  • The Book
    • Introduction to Sylius
    • Installation
      • System Requirements
      • Sylius CE Installation
        • Sylius CE Installation with Docker
      • ➕Sylius Plus Installation
      • Upgrading Sylius CE
      • Upgrading Sylius Plus
    • Architecture
      • Architecture Overview
      • Architectural Drivers
      • Resource Layer
      • State Machine
      • Translations
      • E-Mails
      • Contact
      • Fixtures
      • Events
    • Configuration
      • Channels
      • Locales
      • Currencies
    • Customers
      • Customer & ShopUser
      • ➕Customer Pools
      • AdminUser
      • Addresses
        • Countries
        • Zones
        • Addresses
        • Address Book
    • Products
      • Products
      • Product Reviews
      • Product Associations
      • Attributes
      • Pricing
      • Catalog Promotions
      • Taxons
      • Inventory
      • ➕Multi-Source Inventory
      • Search
    • Carts & Orders
      • Orders
      • Cart flow
      • Taxation
      • Adjustments
      • Cart Promotions
      • Coupons
      • Payments
      • 🧩Invoices
      • Shipments
    • Support
    • Contributing
      • Contributing Code
        • Submitting a Patch
        • ⚠️Security Issues
        • Coding Standards
        • Conventions
        • Sylius License and Trademark
      • Contributing Translations
      • Key Contributors
  • The Customization Guide
    • Customizing Models
      • How to add a custom model?
      • How to add a custom translatable model?
    • Customizing Forms
      • How to add a live form for a custom model?
    • Customizing Styles
    • Customizing Validation
    • Customizing Menus
    • Customizing Templates
    • Customizing Translations
    • Customizing Flashes
    • Customizing State Machines
    • Customizing Grids
    • Customizing Fixtures
    • Customizing API
    • Customizing Serialization of API
    • Customizing Payments
      • How to integrate a Payment Gateway as a Plugin?
  • 🧑‍🍳The Cookbook
  • How to resize images?
  • How to add one image to an entity?
  • How to add multiple images to an entity?
  • Sylius 1.X Documentation
    • 📓Sylius 1.x Documentation
Powered by GitBook
LogoLogo

Developer

  • Community
  • Online Course

About

  • Team

© 2025 Sylius. All Rights Reserved

On this page

Was this helpful?

Edit on GitHub
  1. The Book
  2. Contributing
  3. Contributing Code

Conventions

This document describes conventions used in the Sylius to make it more consistent and predictable. Any new code delivered to Sylius should comply with the following conventions, we also encourage you to use them in your own projects based on Sylius.

Naming

  • Use camelCase for:

    • PHP variables,

    • method names (except PHPSpec and PHPUnit),

    • arguments,

    • Twig templates;

  • Use snake_case for:

    • configuration parameters,

    • Twig template variables,

    • fixture fields,

    • YAML files,

    • XML files,

    • Behat feature files,

    • PHPSpec method names,

    • PHPUnit method names;

  • Use SCREAMING_SNAKE_CASE for:

    • constants,

    • environment variables;

  • Use UpperCamelCase for:

    • classes names,

    • interfaces names,

    • traits names,

    • other PHP file names;

  • Prefix abstract classes with Abstract,

  • Suffix interfaces with Interface,

  • Suffix traits with Trait,

  • Use a command name with the Handler suffix to create a name of the command handler,

  • Suffix exceptions with Exception,

  • Suffix PHPSpec classes with Spec,

  • Suffix PHPUnit tests with Test,

  • Prefix Twig templates that are partial blocks with _,

  • Use the fully qualified class name (FQCN) of an interface as a service name of a newly created service or FQCN of a class if there are multiple implementations of a given interface unless it is inconsistent with the current scope of Sylius.

PreviousCoding StandardsNextSylius License and Trademark

Last updated 7 months ago

Was this helpful?