Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHP dependency to 7.2 #1670

Merged
merged 2 commits into from
Jan 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php

php:
- 7.1
- 7.2
- 7.3
- nightly
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/

## Server Requirements

PHP version 7.1 or higher is required, with the following extensions installed:
PHP version 7.2 or higher is required, with the following extensions installed:


- [intl](http://php.net/manual/en/intl.requirements.php)
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
Expand Down
2 changes: 1 addition & 1 deletion admin/framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/

## Server Requirements

PHP version 7.1 or higher is required, with the following extensions installed:
PHP version 7.2 or higher is required, with the following extensions installed:

- [intl](http://php.net/manual/en/intl.requirements.php)
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
Expand Down
2 changes: 1 addition & 1 deletion admin/framework/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://codeigniter.com",
"license": "MIT",
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-curl": "*",
"ext-intl": "*",
"kint-php/kint": "^2.1",
Expand Down
2 changes: 1 addition & 1 deletion admin/starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The user guide updating and deployment is a bit awkward at the moment, but we ar

## Server Requirements

PHP version 7.1 or higher is required, with the following extensions installed:
PHP version 7.2 or higher is required, with the following extensions installed:

- [intl](http://php.net/manual/en/intl.requirements.php)
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
Expand Down
2 changes: 1 addition & 1 deletion admin/starter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://codeigniter.com",
"license": "MIT",
"require": {
"php": ">=7.1",
"php": ">=7.2",
"codeigniter4/framework": "^4@alpha"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion admin/userguide/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://codeigniter.com",
"license": "MIT",
"require": {
"php": ">=7.1",
"php": ">=7.2",
"codeigniter4/framework": "^4"
},
"support": {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "https://codeigniter.com",
"license": "MIT",
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-curl": "*",
"ext-intl": "*",
"ext-json": "*",
Expand Down
2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you change anything that requires a change to documentation then you will nee

### Compatibility

CodeIgniter4 requires PHP 7.1.
CodeIgniter4 requires PHP 7.2.

### Branching

Expand Down
2 changes: 1 addition & 1 deletion contributing/guidelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ be highlighted in the next release after it has been merged.
PHP Compatibility
=================

CodeIgniter4 requires PHP 7.1.
CodeIgniter4 requires PHP 7.2.

Backwards Compatibility
=======================
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// Valid PHP Version?
$minPHPVersion = '7.1';
$minPHPVersion = '7.2';
if (phpversion() < $minPHPVersion)
{
die("Your PHP version must be {$minPHPVersion} or higher to run CodeIgniter. Current version: " . phpversion());
Expand Down
2 changes: 1 addition & 1 deletion system/Autoloader/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ protected function discoverComposerNamespaces()
{
return false;
}

$composer = include COMPOSER_PATH;

$paths = $composer->getPrefixesPsr4();
Expand Down
2 changes: 1 addition & 1 deletion system/Commands/Server/Serve.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
class Serve extends BaseCommand
{
protected $minPHPVersion = '7.1';
protected $minPHPVersion = '7.2';

protected $group = 'CodeIgniter';
protected $name = 'serve';
Expand Down
18 changes: 8 additions & 10 deletions system/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ public function __set(string $key, $value = null)
}

$isNullable = false;
$castTo = false;
$castTo = false;

if(array_key_exists($key, $this->_options['casts']))
if (array_key_exists($key, $this->_options['casts']))
{
$isNullable = substr($this->_options['casts'][$key],0,1) === '?';
$castTo = $isNullable ? substr($this->_options['casts'][$key], 1) : $this->_options['casts'][$key];
$isNullable = substr($this->_options['casts'][$key], 0, 1) === '?';
$castTo = $isNullable ? substr($this->_options['casts'][$key], 1) : $this->_options['casts'][$key];
}

if(!$isNullable || !is_null($value))
if (! $isNullable || ! is_null($value))
{
// Array casting requires that we serialize the value
// when setting it so that it can easily be stored
Expand All @@ -293,7 +293,6 @@ public function __set(string $key, $value = null)
{
$value = json_encode($value);
}

}

// if a set* method exists for this key,
Expand All @@ -318,7 +317,6 @@ public function __set(string $key, $value = null)
return $this;
}


//--------------------------------------------------------------------

/**
Expand Down Expand Up @@ -443,13 +441,13 @@ protected function mutateDate($value)

protected function castAs($value, string $type)
{
if(substr($type,0,1) === '?')
if (substr($type, 0, 1) === '?')
{
if($value === null)
if ($value === null)
{
return null;
}
$type = substr($type,1);
$type = substr($type, 1);
}

switch($type)
Expand Down
3 changes: 1 addition & 2 deletions system/Helpers/html_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ function img($src = '', bool $indexPage = false, $attributes = ''): string
$src['alt'] = $attributes['alt'] ?? '';
}


$img = '<img';

foreach ($src as $k => $v)
Expand All @@ -185,7 +184,7 @@ function img($src = '', bool $indexPage = false, $attributes = ''): string
}

// prevent passing "alt" to stringify_attributes
if(is_array($attributes) && isset($attributes['alt']))
if (is_array($attributes) && isset($attributes['alt']))
{
unset($attributes['alt']);
}
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/installation/upgrade_4xx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ subforum for an uptodate list!

**Namespaces**

- CI4 is built for PHP7.1+, and everything in the framework is namespaced, except for the helpers.
- CI4 is built for PHP7.2+, and everything in the framework is namespaced, except for the helpers.

**Application Structure**

Expand Down
6 changes: 3 additions & 3 deletions user_guide_src/source/intro/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Server Requirements
###################

`PHP <http://php.net/>`_ version 7.1 or newer is required, with the
`PHP <http://php.net/>`_ version 7.2 or newer is required, with the
`*intl* extension <http://php.net/manual/en/intl.requirements.php>`_
installed. `Why 7.1 <https://gophp71.org/>`_?
installed.

The following PHP extensions should be enabled on your server:
``php-json``, ``php-mbstring``, ``php-mysqlnd``, `php-xml``
Expand All @@ -17,7 +17,7 @@ Currently supported databases are:

- MySQL (5.1+) via the *MySQLi* driver
- PostgreSQL via the *Postgre* driver
- SqLite3 via the *SQLite3* driver
- SQLite3 via the *SQLite3* driver

Not all of the drivers have been converted/rewritten for CodeIgniter4.
The list below shows the outstanding ones.
Expand Down
2 changes: 1 addition & 1 deletion user_guide_src/source/testing/feature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ Asserts that $fragment is found within the JSON response. It does not need to ma
// Is true
$this->assertJSONFragment(['config' => ['key-a']);

.. note:: This simply uses phpUnit's own `assertArraySubset() <https://phpunit.readthedocs.io/en/7.1/assertions.html#assertarraysubset>`_
.. note:: This simply uses phpUnit's own `assertArraySubset() <https://phpunit.readthedocs.io/en/7.2/assertions.html#assertarraysubset>`_
method to do the comparison.

**assertJSONExact($test)**
Expand Down