0

Using composer, I have come across a package that does what I want, if I modify the constant values and some of the code in private methods.

What I've been trying to do is create my own package and extend the other package that I've found and try to override the methods from within my own classes. However, as the package contains constants and private methods, it's difficult/impossible to implement my own package to take advantage of the other package.

What I'm wondering now is what is the best way to go about using the code in this other package? Do I copy the code into my own package and change the namespace and modify the code for my own needs? Or is there another way where I can change the values in another package and modify the private classes?

user9418
  • 395
  • 2
  • 4
  • 13
  • 1
    Do your own package, btw, if you have time, fork his project, and set all privates in protected, like this it can be extended, then do a pull-request :) – Bobot May 19 '15 at 15:59
  • I own the package I'm making but not the third party one. I might just clone this other package and try and maintain it, or see if I can implement a interface to it :) – user9418 May 19 '15 at 16:03
  • [see this](https://getcomposer.org/doc/05-repositories.md#vcs) , it can helps you to fork it. Thats better than maintaining a copy of a package ^^ – Bobot May 19 '15 at 16:12

0 Answers0