etsetra/library

Helpers for etsetra projects.

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.0.7 2022-04-04 19:41 UTC

This package is not auto-updated.

Last update: 2024-03-19 04:38:59 UTC


README

Installation

composer require etsetra/library

DateTime

use Etsetra\Library\DateTime;

echo (new DT)->nowAt();
// 2021-09-30T00:00:00+00:00

echo (new DT)->createFromFormat('d.m.Y H:i:s', '30.09.2021 00:00:00');
// 2021-09-30T00:00:00+00:00

Lorem

use Etsetra\Library\Lorem;

print_r((new Lorem)->ipsum(1));
// Tortor molestie fusce tempus sociosqu nostra tristique nisl cras. Adipiscing primis consequat tempus pellentesque aliquet. Sit interdum dictum at tincidunt eleifend cursus proin nullam sollicitudin maximus duis morbi tristique. Ipsum at mauris fringilla commodo dui class sociosqu porta enim rhoncus sodales aenean, ipsum mi at mollis commodo inceptos habitant aenean. Non mollis nisi diam.

Ascii Fixer

use Etsetra\Library\Char;

echo (new Char)->convertAscii('ĞÜŞİÖÇI...', []);

// Options
'delimiter' => ' ',
'limit' => null,
'lowercase' => false,
'uppercase' => false,
'replacements' => [],
'transliterate' => false

Nokogiri

// Nokogiri after character encoding errors are fixed
// You can access the document on the Nokogiri page. https://github.com/olamedia/nokogiri

use Etsetra\Library\Nokogiri;

ArrayTo

use Etsetra\Library\ArrayTo;

// Returns the XML output of the Array value.
echo (new ArrayTo)->xml([ 'name' => 'Hakkı', 'class' => '4ABC' ]);

// Returns the CSV output of the Array value.
echo (new ArrayTo)->csv([ 'name' => 'Hakkı', 'class' => '4ABC' ]);