You have several options. Assuming
class BaseClass { public function WithWayTooMuchCode {
You can do
class MyOwnClass extends BaseClass { public function AnotherFunction() {
This allows you to do MyOwnClass-> AnotherFunction () and MyOwnClass-> WithWayTooMuchCode ()
or you could do
class MyOwnClass extends BaseClass { public function WithWayTooMuchCode() {
which will allow you to run MyOwnClass-> WithWayTooMuchCode () and will ONLY run "new code" and not "100 lines".
Finally, you could do
class MyOwnClass extends BaseClass { public function WithWayTooMuchCode() { parent::WithWayTooMuchCode();
which allows you to run MyOwnClass-> WithWayTooMuchCode () will run "100 lines of code" and new code. You can place the parent before / after / during your new code so that you can adapt it as needed.
source share