PHP Objects, Patterns and Practice (3rd edition)

(Barry) #1
■ INDEX

add and remove functionality,
implementing, 173
benefits of, 174
Civilization-style game, code listing, 170
class diagram, 172
composite classes, 172
implementing, 172
inheritance tree, 170
leaf classes, 172, 174
modelling the relationship between
collections and components, 170
overview of, 169
splitting composite classes off into a
CompositeUnit class, 175
CompositeUnit class, 175, 211
composition, 115


combining objects to handle tasks
dynamically, 137
favoring composition over inheritance, 169
inheritance and, 132
conditional statements and polymorphism, 110


Conf class
code listing, 51
SimpleXml extension, 52
Conf(), 55
ConfException class, 55
Config class, 330
Config_Container class, 330
Config.php, 330
config.xml, 436, 440, 443


config-get command, 324
lack of Pyrus support for, 325
config-show command, 324
configuration flags, hard-coding, 166
connect(), 138
const keyword, 44
constant properties
defining within a class, 44
naming conventions, 44
constraints, 111, 386


constructors
__construct(), 21
inheritance and, 33
naming convention, 21
contents element, 336
Context class, code listing, 472
Continuous Integration (CI), 7, 322, 460


adding a version control system, 429
adding UserTests as a test suite class, 430
applying coding standards to a project, 433
automating the build and test process, 428
building and deploying a package using
package.xml, 435
CruiseControl, 436
defining coding guidelines and conventions
as a team, 433
failing to run tests, 428
Fedora 12, 432
generating a code coverage report, 431
installing a CI server, benefits of, 428
integration, definition of, 427
making systems easier to test and install,
428
PHP_CodeBrowser, installing and using,
433
PHP_CodeSniffer, 433
phpcb command line tool, 434
phpDocumentor, 431
phpUnderControl, 436
PHPUnit, 430
PHPUnit_Framework_TestSuite class, 431
practicing test-oriented development, 427
preparing a project for, 428
running unit tests, 430
Subversion, 430
ThoughtWorks, 436
transparency as a key principle, 431
userthing sample project, 429
writing documentation, 431
Xdebug, 432
Zend coding standard, 433
Controller class, 239
code listing, 236
ControllerMap class, code listing, 249
copy command, 373
copy element, table of attributes, 422
Copy task, 420, 422
@copyright tag, 352
coupling, 104
getNotifier(), 140
hiding the implementation details of a
notifier, 139
loosening, 139
MailNotifier class, 140
Free download pdf