Skip to content

Commit

Permalink
Merge pull request #8790 from portabilis/upgrate-php81
Browse files Browse the repository at this point in the history
Faz upgrade para o PHP 8.1
  • Loading branch information
jrbarros authored Jul 14, 2022
2 parents 88d2d47 + 33a64d6 commit b27f452
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ facilitar o desenvolvimento.

#### Servidor

- [PHP](http://php.net/) versão 8.0
- [PHP](http://php.net/) versão 8.1
- [Composer](https://getcomposer.org/)
- [Postgres](https://www.postgresql.org/)
- [Nginx](https://www.nginx.com/)
Expand Down
2 changes: 1 addition & 1 deletion docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.0-fpm-alpine
FROM php:8.1-fpm-alpine

LABEL maintainer="Portabilis <contato@portabilis.com.br>"

Expand Down
2 changes: 1 addition & 1 deletion ieducar/lib/CoreExt/Controller/Dispatcher/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected function _getUrlPath()
$path = explode('/', $path);

$baseurl = parse_url($this->getRequest()->getBaseurl(), PHP_URL_PATH);
$baseurl = explode('/', $baseurl);
$baseurl = is_null($baseurl) ? [''] : explode('/', $baseurl);

$script = explode('/', $this->getRequest()->get('SCRIPT_FILENAME'));
$script = array_pop($script);
Expand Down
10 changes: 10 additions & 0 deletions ieducar/lib/CoreExt/Session/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public function getSessionData()
/**
* @link http://br.php.net/manual/en/arrayaccess.offsetexists.php
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
$value = $this->getSessionStorage()->read($offset);
Expand All @@ -148,6 +149,7 @@ public function offsetExists($offset)
/**
* @link http://br.php.net/manual/en/arrayaccess.offsetget.php
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if ($this->offsetExists($offset)) {
Expand All @@ -160,6 +162,7 @@ public function offsetGet($offset)
/**
* @link http://br.php.net/manual/en/arrayaccess.offsetset.php
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->getSessionStorage()->write((string) $offset, $value);
Expand All @@ -168,6 +171,7 @@ public function offsetSet($offset, $value)
/**
* @link http://br.php.net/manual/en/arrayaccess.offsetunset.php
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
$this->getSessionStorage()->remove($offset);
Expand Down Expand Up @@ -231,6 +235,7 @@ public function __unset($key)
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->getSessionStorage()->count();
Expand All @@ -243,6 +248,7 @@ public function count()
*
* @link http://br.php.net/manual/en/iterator.current.php
*/
#[\ReturnTypeWillChange]
public function current()
{
$this->getSessionData();
Expand All @@ -253,6 +259,7 @@ public function current()
/**
* @link http://br.php.net/manual/en/iterator.key.php
*/
#[\ReturnTypeWillChange]
public function key()
{
$data = $this->getSessionData();
Expand All @@ -263,6 +270,7 @@ public function key()
/**
* @link http://br.php.net/manual/en/iterator.next.php
*/
#[\ReturnTypeWillChange]
public function next()
{
$data = $this->getSessionData();
Expand All @@ -273,6 +281,7 @@ public function next()
/**
* @link http://br.php.net/manual/en/iterator.rewind.php
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$data = $this->getSessionData();
Expand All @@ -283,6 +292,7 @@ public function rewind()
/**
* @link http://br.php.net/manual/en/iterator.valid.php
*/
#[\ReturnTypeWillChange]
public function valid()
{
$key = key($this->_sessionData);
Expand Down
2 changes: 1 addition & 1 deletion ieducar/lib/CoreExt/Validate/Numeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function _sanitize($value)
{
// Verifica se possui o ponto decimal e substitui para o
// padrão do locale en_US (ponto ".")
if (str_contains($value, ',')) {
if (!empty($value) && str_contains($value, ',')) {
$value = strtr($value, ',', '.');
$value = floatval($value);
}
Expand Down

0 comments on commit b27f452

Please sign in to comment.