diff --git a/user_guide_src/source/cli/cli_library.rst b/user_guide_src/source/cli/cli_library.rst
index 4ae0d61169a3..fca90f546f33 100644
--- a/user_guide_src/source/cli/cli_library.rst
+++ b/user_guide_src/source/cli/cli_library.rst
@@ -137,7 +137,7 @@ to STDERR, instead of STDOUT, like ``write()`` and ``color()`` do. This can be u
for errors so they don't have to sift through all of the information, only the actual error messages. You use it
exactly as you would the ``write()`` method::
- CLI::error('Cannot write to file: '. $file);
+ CLI::error('Cannot write to file: ' . $file);
**wrap()**
@@ -170,11 +170,11 @@ every line after the first line, so that you will have a crisp column edge on th
{
CLI::write(
// Display the title on the left of the row
- $title[$i].' '.
+ $title[$i] . ' ' .
// Wrap the descriptions in a right-hand column
// with its left side 3 characters wider than
// the longest item on the left.
- CLI::wrap($descriptions[$i], 40, $maxlen+3)
+ CLI::wrap($descriptions[$i], 40, $maxlen + 3)
);
}
diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst
index 9c709c597724..a827d37ae7d1 100755
--- a/user_guide_src/source/database/query_builder.rst
+++ b/user_guide_src/source/database/query_builder.rst
@@ -435,9 +435,9 @@ searches.
::
- $builder->like('title', 'match', 'before'); // Produces: WHERE `title` LIKE '%match' ESCAPE '!'
- $builder->like('title', 'match', 'after'); // Produces: WHERE `title` LIKE 'match%' ESCAPE '!'
- $builder->like('title', 'match', 'both'); // Produces: WHERE `title` LIKE '%match%' ESCAPE '!'
+ $builder->like('title', 'match', 'before'); // Produces: WHERE `title` LIKE '%match' ESCAPE '!'
+ $builder->like('title', 'match', 'after'); // Produces: WHERE `title` LIKE 'match%' ESCAPE '!'
+ $builder->like('title', 'match', 'both'); // Produces: WHERE `title` LIKE '%match%' ESCAPE '!'
#. **Associative array method:**
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
index 3546ccf893ac..8e9fdc426157 100644
--- a/user_guide_src/source/database/results.rst
+++ b/user_guide_src/source/database/results.rst
@@ -169,9 +169,9 @@ it returns the current row and moves the internal data pointer ahead.
You can optionally pass 'object' (default) or 'array' in order to specify
the returned value's type::
- $query->getUnbufferedRow(); // object
- $query->getUnbufferedRow('object'); // object
- $query->getUnbufferedRow('array'); // associative array
+ $query->getUnbufferedRow(); // object
+ $query->getUnbufferedRow('object'); // object
+ $query->getUnbufferedRow('array'); // associative array
*********************
Custom Result Objects
@@ -251,7 +251,7 @@ Example::
if (isset($row))
{
- echo $row->email; // access attributes
+ echo $row->email; // access attributes
echo $row->last_login('Y-m-d'); // access class methods
}
diff --git a/user_guide_src/source/helpers/text_helper.rst b/user_guide_src/source/helpers/text_helper.rst
index 93d9dd58c4c1..1c2f08868dd1 100755
--- a/user_guide_src/source/helpers/text_helper.rst
+++ b/user_guide_src/source/helpers/text_helper.rst
@@ -148,13 +148,13 @@ The following functions are available:
after each other. Example::
$string = "Fred, Bill,, Joe, Jimmy";
- $string = reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"
+ $string = reduce_multiples($string, ","); // results in "Fred, Bill, Joe, Jimmy"
If the third parameter is set to TRUE it will remove occurrences of the
character at the beginning and the end of the string. Example::
$string = ",Fred, Bill,, Joe, Jimmy,";
- $string = reduce_multiples($string, ", ", TRUE); //results in "Fred, Bill, Joe, Jimmy"
+ $string = reduce_multiples($string, ", ", TRUE); // results in "Fred, Bill, Joe, Jimmy"
.. php:function:: quotes_to_entities($str)
diff --git a/user_guide_src/source/outgoing/response.rst b/user_guide_src/source/outgoing/response.rst
index 1dffaa31c98b..941a9ceff800 100644
--- a/user_guide_src/source/outgoing/response.rst
+++ b/user_guide_src/source/outgoing/response.rst
@@ -111,7 +111,7 @@ HTTP Caching
============
Built into the HTTP specification are tools help the client (often the web browser) cache the results. Used correctly,
-this can lend a huge performance boost to your application because it will tell the client that they don't need
+this can lead to a huge performance boost to your application because it will tell the client that they don't need
to contact the getServer at all since nothing has changed. And you can't get faster than that.
This are handled through the ``Cache-Control`` and ``ETag`` headers. This guide is not the proper place for a thorough
diff --git a/user_guide_src/source/outgoing/table.rst b/user_guide_src/source/outgoing/table.rst
index e6d14d1864dd..40302e904287 100644
--- a/user_guide_src/source/outgoing/table.rst
+++ b/user_guide_src/source/outgoing/table.rst
@@ -36,12 +36,12 @@ method described in the function reference below).
$table = new \CodeIgniter\View\Table();
- $data = array(
- array('Name', 'Color', 'Size'),
- array('Fred', 'Blue', 'Small'),
- array('Mary', 'Red', 'Large'),
- array('John', 'Green', 'Medium')
- );
+ $data = [
+ ['Name', 'Color', 'Size'],
+ ['Fred', 'Blue', 'Small'],
+ ['Mary', 'Red', 'Large'],
+ ['John', 'Green', 'Medium'],
+ ];
echo $table->generate($data);
@@ -91,38 +91,38 @@ The Table Class permits you to set a table template with which you can
specify the design of your layout. Here is the template prototype::
$template = [
- 'table_open' => '
',
+ 'table_open' => '',
- 'thead_open' => '',
- 'thead_close' => '',
+ 'thead_open' => '',
+ 'thead_close' => '',
- 'heading_row_start' => '',
- 'heading_row_end' => '
',
- 'heading_cell_start' => '',
- 'heading_cell_end' => ' | ',
+ 'heading_row_start' => '',
+ 'heading_row_end' => '
',
+ 'heading_cell_start' => '',
+ 'heading_cell_end' => ' | ',
- 'tfoot_open' => '',
- 'tfoot_close' => '',
+ 'tfoot_open' => '',
+ 'tfoot_close' => '',
- 'footing_row_start' => '',
- 'footing_row_end' => '
',
- 'footing_cell_start' => '',
- 'footing_cell_end' => ' | ',
+ 'footing_row_start' => '',
+ 'footing_row_end' => '
',
+ 'footing_cell_start' => '',
+ 'footing_cell_end' => ' | ',
- 'tbody_open' => '',
- 'tbody_close' => '',
+ 'tbody_open' => '',
+ 'tbody_close' => '',
- 'row_start' => '',
- 'row_end' => '
',
- 'cell_start' => '',
- 'cell_end' => ' | ',
+ 'row_start' => '',
+ 'row_end' => '
',
+ 'cell_start' => '',
+ 'cell_end' => ' | ',
- 'row_alt_start' => '',
- 'row_alt_end' => '
',
- 'cell_alt_start' => '',
- 'cell_alt_end' => ' | ',
+ 'row_alt_start' => '',
+ 'row_alt_end' => '
',
+ 'cell_alt_start' => '',
+ 'cell_alt_end' => ' | ',
- 'table_close' => '
'
+ 'table_close' => '
'
];
$table->setTemplate($template);
diff --git a/user_guide_src/source/testing/controllers.rst b/user_guide_src/source/testing/controllers.rst
index a0fe6f398920..a6d2db307106 100644
--- a/user_guide_src/source/testing/controllers.rst
+++ b/user_guide_src/source/testing/controllers.rst
@@ -41,8 +41,8 @@ to run as the parameter::
public function testShowCategories()
{
$result = $this->withURI('http://example.com/categories')
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
$this->assertTrue($result->isOK());
}
@@ -63,7 +63,7 @@ Specifies the class name of the controller to test. The first parameter must be
Executes the specified method within the controller. The only parameter is the name of the method to run::
$results = $this->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->execute('showCategories');
This returns a new helper class that provides a number of routines for checking the response itself. See below
for details.
@@ -76,8 +76,8 @@ Allows you to pass in a modified version of **Config\App.php** to test with diff
$config->appTimezone = 'America/Chicago';
$results = $this->withConfig($config)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
If you do not provide one, the application's App config file will be used.
@@ -89,8 +89,8 @@ Allows you to provide an **IncomingRequest** instance tailored to your testing n
$request->setLocale($locale);
$results = $this->withRequest($request)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
If you do not provide one, a new IncomingRequest instance with the default application values will be passed
into your controller.
@@ -102,8 +102,8 @@ Allows you to provide a **Response** instance::
$response = new CodeIgniter\HTTP\Response(new Config\App());
$results = $this->withResponse($response)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
If you do not provide one, a new Response instance with the default application values will be passed
into your controller.
@@ -115,9 +115,9 @@ Allows you to provide a **Logger** instance::
$logger = new CodeIgniter\Log\Handlers\FileHandler();
$results = $this->withResponse($response)
- -> withLogger($logger)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->withLogger($logger)
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
If you do not provide one, a new Logger instance with the default configuration values will be passed
into your controller.
@@ -129,8 +129,8 @@ This is helpful if you need to check URI segments within your controller. The on
representing a valid URI::
$results = $this->withURI('http://example.com/forums/categories')
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
It is a good practice to always provide the URI during testing to avoid surprises.
@@ -142,8 +142,8 @@ you need to set a JSON value as the body. The only parameter is a string that re
$body = json_encode(['foo' => 'bar']);
$results = $this->withBody($body)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
Checking the Response
=====================
@@ -157,8 +157,8 @@ This provides a simple check that the response would be considered a "successful
the HTTP status code is within the 200 or 300 ranges::
$results = $this->withBody($body)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
if ($results->isOK())
{
@@ -170,8 +170,8 @@ the HTTP status code is within the 200 or 300 ranges::
Checks to see if the final response was a redirection of some sort::
$results = $this->withBody($body)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
if ($results->isRedirect())
{
@@ -183,8 +183,8 @@ Checks to see if the final response was a redirection of some sort::
You can access the Request object that was generated with this method::
$results = $this->withBody($body)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
$request = $results->request();
@@ -193,8 +193,8 @@ You can access the Request object that was generated with this method::
This allows you access to the response object that was generated, if any::
$results = $this->withBody($body)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
$response = $results->response();
@@ -204,8 +204,8 @@ You can access the body of the response that would have been sent to the client
be generated HTML, or a JSON response, etc.::
$results = $this->withBody($body)
- ->controller(\App\Controllers\ForumController::class)
- ->execute('showCategories');
+ ->controller(\App\Controllers\ForumController::class)
+ ->execute('showCategories');
$body = $results->getBody();