PHP code example of sun / alien

1. Go to this page and download the library: Download sun/alien 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/ */

    

sun / alien example snippets


 

 Sun\AlienLoader::load();

 return [
     'File' => 'Sun\FilesystemAlien',
     'Mail'	=> 'SunMailer\MailerAlien',
     'View'	=> 'SunMailer\ViewAlien'

 ];

namespace Sun;

class FilesystemAlien extends \Sun\Alien
{

    /**
     * To register Alien
     *
     * @return string namespace
     */
    public static function registerAlien()
    {
        return 'Sun\Filesystem';
    }
}

$filesystem = new Sun\Filesystem;
$filesystem->create();

File::create();

$mocked = File::shouldReceive('create')
                ->once()
                ->andReturn('mocked');

$this->assertEquals('mocked', $mocked); // true

public function tearDown()
{
    Mockery::close();
}