PHP code example of grixu / data-factories

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

    

grixu / data-factories example snippets

 php
use Grixu\DataFactories\Factory;

class CustomerDataFactory extends Factory
{
    public function create(array $parameters = []): CustomerData
    {
        return new CustomerData(
            $parameters +
            [
                'name' => 'Testowy klient',
                'country' => 'PL',
                'postalCode' => '87-100',
                'city' => 'Toruń',
                'vatNumber' => '9562338798',
                'street' => 'Polna 140B',
                'voivodeship' => 'Kujawsko-pomorskie',
                'district' => 'Toruń',
                'paymentPeriod' => 15,
                'syncTs' => now(),
                'updatedAt' => now(),
                'xlId' => 1,
                'xlOperatorId' => 1,
            ]
        );
    }
}