<?php

class FlavioLaino
{
    const JOB = 'full stack developer';
    const STARTING_AT = 2003;

    public $experience;

    public $currentCompany = ['Immobiliare.it' => 'full stack developer'];
    public $skills = [];
    
    public $personalLinks = [
        'site' => 'http://www.flaviolaino.it',
        'linkedin' => 'http://it.linkedin.com/in/flaviolaino'
    ];

    const PREVIOUS_COMPANIES = [
        'Gag s.r.l.' => 'php developer',
        'One Italia s.p.a.' => 'php developer',
        'Il Messaggero s.p.a.' => 'dtp',
        'Giroal srl' => 'web manager'
    ];

    function __construct()
    {
        $this->experience = date('Y') - self::STARTING_AT;
        $this->setSkill();
    }

    public function setSkill()
    {
        $this->skills[] = ['what' => 'PHP', 'level' => 'expert'];
        $this->skills[] = ['what' => 'OOP', 'level' => 'expert'];
        $this->skills[] = ['what' => 'MySql', 'level' => 'expert'];
        $this->skills[] = ['what' => 'JS', 'level' => 'expert'];
        $this->skills[] = ['what' => 'JSON', 'level' => 'expert'];
        $this->skills[] = ['what' => 'HTML 5', 'level' => 'expert'];
        $this->skills[] = ['what' => 'API Rest', 'level' => 'expert'];
        $this->skills[] = ['what' => 'jQuery', 'level' => 'expert'];
        $this->skills[] = ['what' => 'Bootstrap', 'level' => 'expert'];
        $this->skills[] = ['what' => 'GIT', 'level' => 'medium'];
        $this->skills[] = ['what' => 'MongoDB', 'level' => 'medium'];
        $this->skills[] = ['what' => 'AWS', 'level' => 'medium'];
        $this->skills[] = ['what' => 'CSS 3', 'level' => 'medium'];
        $this->skills[] = ['what' => 'Node.js', 'level' => 'medium'];
        $this->skills[] = ['what' => 'Slack bot', 'level' => 'medium'];
        $this->skills[] = ['what' => 'ReactJs', 'level' => 'beginner'];
        $this->skills[] = ['what' => 'Bash', 'level' => 'beginner'];
        $this->skills[] = ['what' => 'Symfony', 'level' => 'beginner'];
    }

    public function contactMe($yourText = '')
    {
        $atSign = '@';
        return mail("info{$atSign}flaviolaino.it", 'Info', $yourText);
    }

    function __invoke($remuneration = null)
    {
        if (empty($remuneration)) {
            return false;
        } else if ((int)$remuneration < 0) {
            sleep(5);
            return false;
        } else {
            return true;
        }
    }
}