Welcome Guest, Not a member yet? Register   Sign In
CI4 - problems
#1

I have declared(strict_types=1); in nearly all the CI4 files and the following errors were showing but have now been fixed and can be seen here 

https://ci4-strict.tk



folder: /app
Code:
CRITICAL - 2019-09-17 03:36:12 --> ini_set() expects parameter 2 to be string, integer given
#0 /var/www/ci4-strict.tk/app/Config/Boot/development.php(11): ini_set('display_errors', 1)
#1 /var/www/ci4-strict.tk/system/CodeIgniter.php(432): require_once('/var/www/ci4-st...')
#2 /var/www/ci4-strict.tk/system/CodeIgniter.php(190): CodeIgniter\CodeIgniter->bootstrapEnvironment()
#3 /var/www/ci4-strict.tk/system/bootstrap.php(167): CodeIgniter\CodeIgniter->initialize()
#4 /var/www/ci4-strict.tk/public_html/index.php(38): require('/var/www/ci4-st...')
#5 {main}
CRITICAL - 2019-09-17 03:36:12 --> Uncaught TypeError: strlen() expects parameter 1 to be string, integer given in /var/www/ci4-strict.tk/system/Debug/Exceptions.php:466
Stack trace:
#0 /var/www/ci4-strict.tk/system/Debug/Exceptions.php(466): strlen(18)
#1 /var/www/ci4-strict.tk/app/Views/errors/html/error_exception.php(37): CodeIgniter\Debug\Exceptions::highlightFile('/var/www/ci4-st...', 11, 15)
#2 /var/www/ci4-strict.tk/system/Debug/Exceptions.php(299): include('/var/www/ci4-st...')
#3 /var/www/ci4-strict.tk/system/Debug/Exceptions.php(170): CodeIgniter\Debug\Exceptions->render(Object(TypeError), 500)
#4 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(TypeError))
#5 {main}
  thrown
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}


// folder system
Code:
CRITICAL - 2019-09-17 03:02:29 --> DateTime::createFromFormat() expects parameter 2 to be string, integer given
#0 /var/www/ci4-strict.tk/system/HTTP/Response.php(717): DateTime::createFromFormat('U', 1568707349)
#1 /var/www/ci4-strict.tk/system/HTTP/Response.php(691): CodeIgniter\HTTP\Response->sendHeaders()
#2 /var/www/ci4-strict.tk/system/CodeIgniter.php(1030): CodeIgniter\HTTP\Response->send()
#3 /var/www/ci4-strict.tk/system/CodeIgniter.php(379): CodeIgniter\CodeIgniter->sendResponse()
#4 /var/www/ci4-strict.tk/system/CodeIgniter.php(245): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#5 /var/www/ci4-strict.tk/public_html/index.php(47): CodeIgniter\CodeIgniter->run()
#6 {main}

Source files are available to download along with installation instructions.
Reply
#2

I don't see a problem statement??
It sounds like you have made a workaround for CI4 not having strict typing??
You have raised this issue before - several threads, in CI4 feature requests, CI4 discussion and CI4 support.
How is not having strict typing a problem?

There was a PR submitted(https://github.com/codeigniter4/CodeIgniter4/pull/1493), which was not accepted because there are a number of places where we want flexible typing.
Reply
#3

(09-17-2019, 11:42 AM)ciadmin Wrote: I don't see a problem statement??
It sounds like you have made a workaround for CI4 not having strict typing??
You have raised this issue before - several threads, in CI4 feature requests, CI4 discussion and CI4 support.
How is not having strict typing a problem?

There was a PR submitted(https://github.com/codeigniter4/CodeIgniter4/pull/1493), which was not accepted because there are a number of places where we want flexible typing.

> I don't see a problem statement??
There are two logs files showing three CRITICAL errors.


> It sounds like you have made a workaround for CI4 not having strict typing??
I changed the incorrect function parameter types in accordance with the PHP manual's specifications.


> You have raised this issue before - several threads, in CI4 feature requests, CI4 discussion and CI4 support.
I have just checked the latest CI4 source files and the functions parameters have not been rectified? How can I request these errors to be modified because every time a new version is released it is necessary to manually make the changes.


> How is not having strict typing a problem?
When not having strict typing it is possible that the function parameter type is incorrect and PHP type juggling will not guess the desired value.


> There was a PR submitted(https://github.com/codeigniter4/CodeIgniter4/pull/1493), which was not accepted because there are a number of places where we want flexible typing.
I will reply later because I have guests arriving very shortly.
Reply
#4

Those CRITICAL errors only show with strict typing, right?
And CI4 does not use strict typing.
You have posted this in the CI4 support forum, suggesting there is a problem with the framework, but it is instead with your changes to it, isn't it?
That doesn't make these an error in the framework, but rather a feature request on your part, which not everyone agrees with.
Reply
#5

OK, point taken and accept that CI4 does not use strict_types.

The first CRITERIA states that the PHP function: "ini_set() expects parameter 2 to be string, integer given"

Is it acceptable to request changes that conform to the PHP Standards?
Reply
#6

You are free to submit a PR for that, of course. However the integer '1' is typecast to the string '1' when strict is not defined so it's not strictly necessary, but no harm being proper on that. Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB