'which design pattern is used in the code below? [closed]

Can someone please tell me which design pattern is used in the code below?

This code has been used in a recruitement test (live codingame test). So i would like to have the answer in case the same code will be back.

        class UnixText
        {
        function write($txt){echo $txt;}
        function lf()   {echo "\n";}
    
        }
        
        class MSWindowsText
        {
        function write($txt){echo $txt;}
        function crlf()   {echo "\r\n";}
    
        }

        interface Writer
        {
        function write($txt);
        function newLine();
        }

        class UnixWriter implements Writer{
        private $target;
    
        public function __construct($unixText){$this->target=$unixText; }
        function write($txt){$this->target->write($txt);}
        function newLine(){$this->target->lf();}
        }

        class MSWindowsWriter implements Writer{
        private $target;
    
        public function __construct($winText){$this->target=$winText;   }
        function write($txt){$this->target->write($txt);}
        function newLine(){$this->target->crlf();}
        }
        //example of use
        $writer=NULL;
        if($isUnix){$writer= new UnixWriter(new UnixText());}
        else {$writer= new MSWindowsWriter(new MSWindowsText());}
        $writer->write('First Line');
        $writer->newLine();
        $writer->write('Second Line');
        ```


Solution 1:[1]

I finally got the response in case it would be helpful for sommeone else. The design pattern used in this case is Adapter. Thanks

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 idrissa ramatou