removing parse_version auxiliary function

This commit is contained in:
Reza Salarmehr
2017-09-23 23:20:39 +10:00
parent a84365e73d
commit c2be1bd745
2 changed files with 9 additions and 24 deletions

View File

@ -1,11 +1,6 @@
<?php <?php
/** /**
* Created by Reza Salarmehr. * Created by Reza Salarmehr.
*
* Some methods are from Laravel source code.
*
* Date: 18/09/2015
* Time: 22:37
*/ */
namespace Salarmehr; namespace Salarmehr;
@ -165,5 +160,5 @@ class Ary extends Collection
{ {
return new static(array_replace_recursive($this->items, $this->getArrayableItems($items))); return new static(array_replace_recursive($this->items, $this->getArrayableItems($items)));
} }
#endrtiong #endregion
} }

View File

@ -1,30 +1,20 @@
<?php <?php
/** /**
* Created by Reza Salarmehr * Created by Reza Salarmehr
* Date: 30/09/2015
* Time: 16:24
*/ */
use Salarmehr\Ary; use Salarmehr\Ary;
if (!function_exists('ary') && phpversion()) { if (!function_exists('ary') && phpversion()) {
if (!defined('ary') && PHP_VERSION_ID > 50600) {
/**
function parse_version($version) * @param array $items
* @return Ary
*/
function ary(...$items)
{ {
$version = explode('.', $version); return new Ary($items);
return $version[0] * 10000 + $version[1] * 100 + (int) $version[2];
}
if (!defined('ary') && parse_version(PHP_VERSION) > parse_version('5.6.0')) {
/**
* @param mixed $items,...
* @return Ary
*/
function ary()
{
return new Ary(...func_get_args());
}
} }
}
} }