Skip to content

Commit

Permalink
PHP 5.6.0 minimum, updated to Doctrine Collections 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Apr 14, 2018
1 parent 4db2b75 commit 87b0d80
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 67 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: php
php:
- '5.5'
- '5.6'
- '7.0.21'
- '7.1'
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.5.0
## mm/dd/2018

1. [](#new)
* Set minimum requirements to [PHP 5.6.0](https://getgrav.org/blog/raising-php-requirements-2018)
* Updated to Doctrine Collections 1.4

# v1.4.3
## 04/12/2018

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The underlying architecture of Grav is designed to use well-established and _bes

# Requirements

- PHP 5.5.9 or higher. Check the [required modules list](https://learn.getgrav.org/basics/requirements#php-requirements)
- PHP 5.6.0 or higher. Check the [required modules list](https://learn.getgrav.org/basics/requirements#php-requirements)
- Check the [Apache](https://learn.getgrav.org/basics/requirements#apache-requirements) or [IIS](https://learn.getgrav.org/basics/requirements#iis-requirements) requirements

# QuickStart
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "http://getgrav.org",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"php": ">=5.6.0",
"twig/twig": "~1.24",
"erusev/parsedown": "1.6.4",
"erusev/parsedown-extra": "~0.7",
Expand All @@ -16,7 +16,7 @@
"symfony/var-dumper": "~2.8",
"symfony/polyfill-iconv": "~1.0",
"doctrine/cache": "^1.6",
"doctrine/collections": "1.3",
"doctrine/collections": "^1.4",
"psr/simple-cache": "^1.0",
"psr/http-message": "^1.0",
"guzzlehttp/psr7": "^1.4",
Expand Down Expand Up @@ -45,7 +45,7 @@
},
"config": {
"platform": {
"php": "5.5.9"
"php": "5.6.0"
}
},
"repositories": [
Expand Down
72 changes: 38 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

namespace Grav;
define('GRAV_PHP_MIN', '5.5.9');
define('GRAV_PHP_MIN', '5.6.0');

// Ensure vendor libraries exist
$autoload = __DIR__ . '/vendor/autoload.php';
Expand Down
4 changes: 2 additions & 2 deletions system/defines.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '1.4.3');
define('GRAV_VERSION', '1.5.0');
define('GRAV_TESTING', false);
define('DS', '/');

if (!defined('GRAV_PHP_MIN')) {
define('GRAV_PHP_MIN', '5.5.9');
define('GRAV_PHP_MIN', '5.6.0');
}

// Directories and Paths
Expand Down
10 changes: 0 additions & 10 deletions system/src/Grav/Framework/Collection/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class ArrayCollection extends BaseArrayCollection implements CollectionInterface
*/
public function reverse()
{
// TODO: remove when PHP 5.6 is minimum (with doctrine/collections v1.4).
if (!method_exists($this, 'createFrom')) {
return new static(array_reverse($this->toArray()));
}

return $this->createFrom(array_reverse($this->toArray()));
}

Expand All @@ -42,11 +37,6 @@ public function shuffle()
$keys = $this->getKeys();
shuffle($keys);

// TODO: remove when PHP 5.6 is minimum (with doctrine/collections v1.4).
if (!method_exists($this, 'createFrom')) {
return new static(array_replace(array_flip($keys), $this->toArray()));
}

return $this->createFrom(array_replace(array_flip($keys), $this->toArray()));
}

Expand Down
12 changes: 1 addition & 11 deletions system/src/Grav/Framework/Object/Base/ObjectCollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ public function copy()
$list[$key] = is_object($value) ? clone $value : $value;
}

// TODO: remove when PHP 5.6 is minimum (with doctrine/collections v1.4).
if (!method_exists($this, 'createFrom')) {
return new static($list);
}

return $this->createFrom($list);
}

Expand Down Expand Up @@ -170,12 +165,7 @@ public function collectionGroup($property)
{
$collections = [];
foreach ($this->group($property) as $id => $elements) {
// TODO: remove when PHP 5.6 is minimum (with doctrine/collections v1.4).
if (!method_exists($this, 'createFrom')) {
$collection = new static($elements);
} else {
$collection = $this->createFrom($elements);
}
$collection = $this->createFrom($elements);

$collections[$id] = $collection;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ protected function doHasProperty($property)
}

/**
* @param string $property Object property to be fetched.
* @param mixed $default Default value if property has not been set.
* @param bool $doCreate Set true to create variable.
* @return mixed Property value.
* @param string $property Object property to be fetched.
* @param mixed $default Default value if property has not been set.
* @param callable|bool $doCreate Set true to create variable.
* @return mixed Property value.
*/
protected function &doGetProperty($property, $default = null, $doCreate = false)
{
Expand Down

0 comments on commit 87b0d80

Please sign in to comment.