PHP code example of myheritage / php-friendly

1. Go to this page and download the library: Download myheritage/php-friendly library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

myheritage / php-friendly example snippets


$ composer 


namespace MyHeritage\Friends\Tests\Friendly;

use MyHeritage\Friends\Friendly;

class AFriendlyClass
{
    use Friendly;

    /**
     * @friendly
     * @param $message
     * @return mixed
     */
    protected function friendlyMethod($message)
    {
        return $message;
    }

    protected function notFriendly()
    {
        return "Booo";
    }
}


namespace MyHeritage\Friends\Tests\Friendly;

class MyClass
{
    public function getHelpFromAFriendlyClass()
    {
        echo (new AFriendlyClass())->friendlyMethod('hello, can you give a hand?');
    }
}