Skip to content

property-no-var

Ensure that property is not declared with var

Examples

  • Examples of correct code for this rule using default options

Properties are declared with no var keyword

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

Properties are declared with var keyword

php
<?php
class Database {
	var $min_connections;
	var $max_pcs;
	var $max_requests;
	var $max_interruptions;
	var $max_lines;
}

Released under the MIT License.