diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..530e88c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# CHANGELOG + +## v0.1.4 + +Add ability to export tempfile + +## v.0.1.0 + +Initial deploy diff --git a/README.md b/README.md index f2b4b06..6b2ba48 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Install with composer using `composer require itsnubix/nowcal` ```php use NowCal\NowCal; -$event = NowCal::build(['start' => 'October 5, 2019 6:03PM'])) +$event = NowCal::create(['start' => 'October 5, 2019 6:03PM'])) ->summary('Daft Punk is playing') ->location('My House'); ``` @@ -45,7 +45,7 @@ $props = [ ]; // Creates a NowCal instance -$nowcal = new NowCal($props); // or NowCal::build($props); +$nowcal = new NowCal($props); // or NowCal::create($props); // Exports a raw output array $nowcal->raw; // or NowCal::raw($props) diff --git a/composer.json b/composer.json index 44b05cd..7ff7357 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "itsnubix/nowcal", - "version": "0.1.4", + "version": "0.1.5", "description": "A modern PHP library for generating iCalendar v2.0 events", "keywords": [ "icalendar", diff --git a/src/NowCal/Traits/HasStaticAccessors.php b/src/NowCal/Traits/HasStaticAccessors.php index 01fe4d8..52a4719 100644 --- a/src/NowCal/Traits/HasStaticAccessors.php +++ b/src/NowCal/Traits/HasStaticAccessors.php @@ -4,11 +4,25 @@ trait HasStaticAccessors { + /** + * Pass the props into the class and create a new instance. + * + * @param array $props + * + * @return \NowCal\NowCal + */ + public static function create(array $props = []) + { + return new self($props); + } + /** * Pass the props into the class and build it. * * @param array $props * + * @deprecated 1.0.0 Prefer "create" syntax + * * @return \NowCal\NowCal */ public static function build(array $props = []) @@ -25,7 +39,7 @@ public static function build(array $props = []) */ public static function raw(array $props = []): array { - return self::build($props)->raw; + return self::create($props)->raw; } /** @@ -37,7 +51,7 @@ public static function raw(array $props = []): array */ public static function plain(array $props = []): string { - return self::build($props)->plain; + return self::create($props)->plain; } /** @@ -49,6 +63,6 @@ public static function plain(array $props = []): string */ public static function file(array $props = []): string { - return self::build($props)->file; + return self::create($props)->file; } }