PHP code example of net_bazzline / component_data_type

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

    

net_bazzline / component_data_type example snippets


/**
 * Class with type hint for string
 *
 * @author stev leibelt <[email protected]>
 * @since 2013-08-04
 */
class MyClass
{
    /**
     * @var array
     * @author stev leibelt <[email protected]>
     * @since 2013-08-04
     */
    private $strings = array();

    /**
     * Super cool method with type hint for string
     *
     * @author stev leibelt <[email protected]>
     * @since 2013-08-04
     */
    public function addString(\Net\Bazzline\Component\DataType\String $string)
    {
        $this->strings[] = $string;

        return $this;
    }
}

$myString = new \Net\Bazzline\Component\DataType\String('super cool test string');

$myClass = new MyClass();
$myClass->addString($myString);