Skip to content
academia.sh

Course Intermediate

Object-Oriented PHP and Standards

Published Updated

By the end of this course

Start course

01

Object Model

Classes and objects, inheritance and abstract classes, interfaces, traits, static members, magic methods and type declarations — each as a mechanism that decides what the code using a definition experiences when that definition changes.

  1. 01 Classes and Objects What the code that uses a class experiences when a name inside the class changes: a private property, a public property, and a consumer that writes to a public property; the four reaches that measure where a change goes.
  2. 02 Inheritance and Abstract Classes A change inside a parent class shifting the result of a subclass implicitly, an added abstract method stopping the subclasses, and the same counter built with composition leaving the same change in place.
  3. 03 Interfaces A class that implements an interface failing to declare when a method is added to the interface, the interface as a type and instanceof, and the same addition staying in place in an abstract class with a body.
  4. 04 Traits Sharing methods between classes with a trait, resolving a conflict with insteadof and as, and the consumer stopping when a method of the same name is added to a trait it uses.
  5. 05 Static Members and Constants Properties, methods, and constants bound to the class, hiding the constructor behind a static factory method, and which changes stop the consumer.
  6. 06 Magic Methods The __get, __set, __isset, __call, and __toString methods, resolving a name that is read through a method, and the implicit and breaking results the consumer meets when that resolution changes.
  7. 07 Type Declarations Parameter, return, and property types, ?int and the union type, and which inputs stop the consumer when a type is added to a parameter.

02

Standards and Packages

Namespaces, autoloading, common interface standards, the dependency manager and dependency injection — arrangements that either gather a change into a single wiring point or carry it to every user.

  1. 01 Namespaces namespace, use and aliases with fully qualified names; two same-named classes kept apart by a namespace, while the same collision in code without namespaces stops the program; an unqualified function call falling back to the global function.
  2. 02 Autoloading An autoloader built with spl_autoload_register; mapping a namespace prefix to a directory and PSR-4; the number of files not deciding the reach when a class file moves; a move made without updating the loader stopping the program; the mapping depending on letter case in the file name.
  3. 03 Common Interface Standards Common interfaces such as PSR-3; the consumer bound to the interface while the implementation changes in the setup file; an interface checking the signature but not the meaning; an implementation that leaves placeholders unfilled silently changing the output.
  4. 04 The Dependency Manager The manifest file, the version constraint and the lock file; a minor version of an unlocked dependency silently changing the output; the lock file pinning the version; the constraint guarding the major version boundary; semantic versioning being a promise.
  5. 05 Dependency Injection Constructor injection, depending on an interface, and manual wiring; a service's dependency changing only in the setup file; building the dependency inside moving the change onto the services; the seam holding only as long as the contract is kept; the measurement table of twelve lessons.

Final exam

Object-Oriented PHP and Standards — Final Exam

In preparation

This course's question bank is not complete yet. The exam opens here automatically once enough questions are added.

Start typing to search.

↑↓ ↵ Esc navigate · open · close