PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1

■ INDEX


function keyword, 19
get_class(), 83
get_class_methods(), 84
get_class_vars(), 85
get_declared_classes(), 82
get_parent_class(), 85
inheritance tree, building, 31
inheritance, definition of, 27
instanceof operator, 31, 83
invoking the parent class’s constructor, 32
is_callable(), 84
is_subclass_of(), 85
leaving an overzealous class unchanged,
109
locking down access control, 37
member variable, 17
method_exists(), 84
methods, definition of, 19
minimizing the use of concrete subclasses,
457
new operator, 16
null default values in hinted arguments, 27
organizing into package-like structures, 71
overridden method, invoking, 35
parent and child classes, 27
parent keyword, 33, 35
polymorphism, definition of, 106
prepending package names to class names,
72
private keyword, 17
properties, setting dynamically, 18
property, definition of, 17
protected keyword, 17
public keyword, 17
scope, definition of, 17
storing a method name in a string variable,
84
superclass, 27
testing that a method exists, 84
$this pseudo-variable, 20
tools for checking the type of an object, 83
using a string to invoke a method
dynamically, 86
using strings to refer to classes dynamically,
81
visibility keyword, 17, 19
See also objects

classroot element, 248
clean argument, 425
client code, definition of, 18
__clone()
copying by reference, 64
copying objects with, 63
implementing, 63, 165
making a new shallow copy, 64
clone keyword, 63, 162, 165
code coverage, generating, 431
code design, 99
code duplication, 109, 454
code smells, 109
CodeSniffer, 444
cohesion, definition of, 104
collection(), 294
CollectionParse class, code listing, 477
command and control layer, 223
Command class, 241, 247
code listing, 254
command element, 248
Command pattern
AccessManager class, 217–218
class diagram, 220
client, invoker, and receiver, 216
Command class, code listing, 217
execute(), 216
FeedbackCommand class, 219
implementing, 216
LoginCommand class, 217
overview of, 216
process(), 219
Registry class, 218
when application logic creeps into
command classes, 218
CommandContext class, code listing, 217
CommandFactory class, code listing, 218
CommandResolver class, 244
code listing, 240
CommsManager class, 153
code listing, 159
redesignating as an abstract class, 155
compile(), 484
components, building from scratch versus
purchasing, 317
composite (collection) parsers, 476
Composite pattern, 482
Free download pdf