PHPC2 | Mastering Object Oriented Progamming in PHP 7

  • Learn how to master object oriented programming with PHP with practical examples and expert trainers.
  • Prerequisites

    Mastering the basics of the PHP language
  • Goals

    In three days you will learn all the basic concepts of object-oriented programming in PHP to become operational on frameworks like Symfony, Silex, Laravel, Drupal and Zend. You'll also learn how to develop with the object-oriented philosophy with the latest PHP versions including PHP 7.

Full program

Introduction to Object Oriented Programming

  • Introduction to the OOP main concepts
  • Understanding the benefits of using OOP
  • Discovering the main principles of OOP
  • Learning how to think and design code with the object approach
  • Discovering all new object oriented features introduced since PHP 5.3

Fundamentals of Object Oriented Programming

  • Understanding the concepts of classes and objects
  • Setting the state of an object with its properties
  • Reading and changing the state of an object thanks to its methods
  • Instanciating and initializing an object with its constructor
  • Destroying an object the right way with its destructor
  • Ensuring object state encapsulation thanks to attributes and methods scopes
  • Understanding the difference between instance and class scope
  • Specializing classes thanks to the inheritance principle
  • Leveraging classes to define new advanced data structures and types

Advanced Object Oriented Programming Concepts

  • Generalizing data structures types with abstract classes and methods
  • Preventing class and methods specialization
  • Overriding and overloading the behavior of a parent class' method
  • Handling errors properly with the exception mechanism
  • Design implementation contracts thanks to interfaces
  • Overriding implicit default objects behaviors with « magic methods »
  • Setting up mechanisms to automatically load class definitions files
  • Organizing data structures thanks to namespaces
  • Refactoring reusable chunks of object oriented code into « traits »

Leveraging the PHP 7 SPL

  • Discovering the « Standard PHP Library » aka SPL
  • Raising and throwing SPL specific exceptions types
  • Using the new SPL built-in data structures
  • Creating objects iterators thanks to the « Iterator » interface
  • Counting objects in a collection thanks to the « Countable » interface
  • Converting a PHP object into a PHP regular array with the « ArrayAccess » interface

Practicing the PHP 7 Native Object Oriented Tools

  • Manipulating relational databases with PHP Data Objects aka PDO
  • Traversing the data of an XML file thanks to the SimpleXML objects
  • Manipulating and formatting dates with the DateTime objects
  • Accessing files informations thanks to the SplFileInfo objects

Acquire Object Oriented Development Best Practices

  • Commenting and annotating code thanks to the « phpdoc » syntax
  • Mastering the SOLID main principles
  • Programming against interfaces
  • Promoting composition over inheritance
  • Discovering the main GoF design patterns
  • Introducing automated code unit testing with PHPUnit
  • Duration

    3 day(s)
  • Level

    Intermediate
  • Available languages

    French, English
  • Available countries

    France, Worldwide
From €1,590.00
No session scheduled

No session is scheduled for this course. However we organize tailored training courses: contact us for more informations!