Design Patterns PHP - Adapter Java

1) Where to begin ?

We have some application which uses some library called here "LibraryOne"


interface LibraryOne
{
    public function doAB();
}

class LibraryOneImpl implements LibraryOne
{

    public function doAB()
    {
        echo 'do AB' . PHP_EOL;
    }
}




And in Client we just call method from library "doAB"


/** @var LibraryOne $library */
$library->doAB();




2) What we want to change ?

We would like to use another library "LibraryTwo" which doing the same but defining another interface.


interface LibraryTwo
{
    public function doA();

    public function doB();
}

class LibraryTwoImpl implements LibraryTwo
{

    public function doA()
    {
        echo 'doA' . PHP_EOL;
    }

    public function doB()
    {
        echo 'doB' . PHP_EOL;
    }
}




"LibraryOne" was used in many places in whole system. We don't want to refactor so big amount of code everywhere where "LibraryOne" was used by replacing
method of "LibraryOne" with "LibraryTwo".

3) How we can resolve this issue ?

We use "Adapter" pattern, let's see how is this look in step2.