diff --git a/assets/templates/_table_of_contents.phtml b/assets/templates/_table_of_contents.phtml index 841c855..dfea08e 100644 --- a/assets/templates/_table_of_contents.phtml +++ b/assets/templates/_table_of_contents.phtml @@ -21,6 +21,7 @@
  • Classes: Constructor
  • Static
  • Interfaces
  • +
  • Abstract Classes
  • Credits diff --git a/code/abstract.php b/code/abstract.php new file mode 100644 index 0000000..8cbff27 --- /dev/null +++ b/code/abstract.php @@ -0,0 +1,48 @@ +turnOn(); +$iPhone->unlock(); + +$android = new Android(); +$android->turnOn(); +$android->unlock(); + +// Lastly, you cannot create an instance of an abstract class. PHP would not know how to use the abstract methods +// so when you try to create an abstract instance you will get an error. +$cellPhone = new CellPhone(); diff --git a/config.php b/config.php index d026988..60ebd86 100644 --- a/config.php +++ b/config.php @@ -141,6 +141,12 @@ return [ 'title' => 'Interfaces', 'subtitle' => 'Writing code contracts', 'previous' => 'static', + 'next' => 'abstract', + ]), + Page::create('abstract', null, 'abstract.php', [ + 'title' => 'Abstract Classes', + 'subtitle' => 'Inheriting an interface', + 'previous' => 'interfaces', 'next' => '', ]), ],