1.2.1291. Unused Interfaces

Those interfaces are defined and never used. They should be removed, as they are dead code.

Interfaces may be use as parent for other interfaces, as types (argument, return and property), in instance of.

<?php

interface used {}
interface unused {}

// Used by implementation
class c implements used {}

// Used by extension
interface j implements used {}

$x = new c;

// Used in a instanceof
var_dump($x instanceof used);

// Used in a type
function foo(Used $x) {}

?>

1.2.1291.1. Suggestions

  • Remove the interface

  • Actually use the interface

1.2.1291.2. Specs

Short name

Interfaces/UnusedInterfaces

Rulesets

All, Changed Behavior, Dead code, Suggestions

Exakat since

0.8.4

PHP Version

All

Severity

Minor

Time To Fix

Instant (5 mins)

Precision

Very high

Features

interface

Examples

Tine20

Available in

Entreprise Edition, Exakat Cloud