2017 © Pedro Peláez
 

library phpstring

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring)

image

saraivadaniel/phpstring

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring)

  • Thursday, June 22, 2017
  • by SaraivaDaniel
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

PHP String

Travis Latest Stable Version Total Downloads Latest Unstable Version MIT license, (*1)

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring), (*2)

How to use

Add library, (*3)

$ composer require saraivadaniel/phpstring

Add autoload.php in your file:, (*4)

require_once 'vendor/autoload.php';  

Add annotations, (*5)

<?php

class Event
{
    /**
     * @Text(sequence=1, size=20)
     */
    public $name;

    /**
     * @Date(sequence=2, size=8, format="Ymd")
     */
    public $date;

    /**
     * @Numeric(sequence=3, size=6, decimals=2, decimal_separator="")
     */
    public $price;

    /**
     * @Text(sequence=4, size=100)
     */
    public $description;

}

String -> Object

$parser = new PHPString(Event::class);
$event = $parser->toObject("BH Bike Show        20160621002000Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce consequat augue at hendrerit posuere.");

echo $parser->getSize(); //output: 134

String <- Object

$parser = new PHPString(Event::class);

$event = new Event();
$event->name = 'Motocross Adventure';
$event->description = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce consequat augue at hendrerit posuere.';
$event->date = Carbon::createFromFormat('Y-m-d', '2016-06-21');
$event->price = 1200.98;

$string = $parser->toString($event);

License

The MIT License (MIT), (*6)

The Versions

22/06 2017

1.0.x-dev

1.0.9999999.9999999-dev

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

22/06 2017

v1.0.7

1.0.7.0

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

03/05 2017

v1.0.6

1.0.6.0

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

02/05 2017

v1.0.5

1.0.5.0

Create objects filling attribute classes with string data (fork of jansenfelipe/phpstring)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

22/08 2016

v1.0.4

1.0.4.0

Create objects filling attribute classes with string data

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

22/08 2016

v1.0.3

1.0.3.0

Create objects filling attribute classes with string data

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

26/07 2016

v1.0.2

1.0.2.0

Create objects filling attribute classes with string data

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

09/07 2016

v1.0.1

1.0.1.0

Create objects filling attribute classes with string data

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe

23/06 2016

v1.0.0

1.0.0.0

Create objects filling attribute classes with string data

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jansen Felipe