Skip to content

property-limit

Ensure that only one property declared per statement

Examples

  • Examples of correct code for this rule using default options

One class property per statement

php
<?php
class Database {
	private $min_connections;
	private $max_pcs;
	public $max_requests;
	public $max_interruptions;
	public $max_lines;
}
  • Examples of incorrect code for this rule using default options

Multiple class properties per statement

php
<?php
class Database {
	private $min_connections, $max_pcs;
	public $max_requests, $max_interruptions, $max_lines;
}

Released under the MIT License.