1.2.337. Definitions Only

File is definition only.

Definition-only files only include structure definitions : class, functions, traits, interfaces, constants, global, declare(), use and include().

Some functioncalls are also considered definition only, as they configure PHP, but don’t process data : * ini_set() * error_reporting * register_shutdown_function() * set_session_handler() * set_error_handler() * spl_autoload_register() File A : File B :

<?php

// This file has only definitions
function foo() {}

define('a', 1);

class bar {}

?>

1.2.337.1. Specs

Short name

Files/DefinitionsOnly

Rulesets

All

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

definition

Available in

Entreprise Edition, Exakat Cloud