From d3a5b4170a2fcf7e9d61ad5a08f47c72f523acd8 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Mon, 9 May 2022 11:05:55 -0400 Subject: [PATCH] Fix typos in documentation per processwire/processwire-issues#797 --- wire/core/Inputfield.php | 2 +- wire/core/Module.php | 2 +- wire/core/PageArray.php | 2 +- wire/core/Sanitizer.php | 2 +- wire/core/Wire.php | 34 ++++++++++++++++++++++++++-------- wire/core/WireDatabasePDO.php | 2 +- wire/core/WireInput.php | 2 +- 7 files changed, 32 insertions(+), 14 deletions(-) diff --git a/wire/core/Inputfield.php b/wire/core/Inputfield.php index 2aa000ab..239db39e 100644 --- a/wire/core/Inputfield.php +++ b/wire/core/Inputfield.php @@ -651,7 +651,7 @@ abstract class Inputfield extends WireData implements Module { * * - For most public API use, you might consider using the the shorter `Inputfield::attr()` method instead. * - * - When setting the `class` attribute is is preferable to use the `Inputfield::addClass()` method. + * - When setting the `class` attribute it is preferable to use the `Inputfield::addClass()` method. * * - The `$key` argument may contain multiple keys by being specified as an array, or by being a string with multiple * keys separated by "+" or "|", for example: `$inputfield->setAttribute("id+name", "template")`. diff --git a/wire/core/Module.php b/wire/core/Module.php index e5638a4a..411ef428 100644 --- a/wire/core/Module.php +++ b/wire/core/Module.php @@ -312,7 +312,7 @@ * The method should prepare the environment with anything else needed by the module, such as newly created * fields, pages, templates, etc. or installation of other modules. * - * If the install() method determines that the module called be installed for some reason, it should + * If the install() method determines that the module cannot be installed for some reason, it should * throw a `WireException.` * * ### uninstall() diff --git a/wire/core/PageArray.php b/wire/core/PageArray.php index 06d80870..08cc8240 100644 --- a/wire/core/PageArray.php +++ b/wire/core/PageArray.php @@ -75,7 +75,7 @@ class PageArray extends PaginatedArray implements WirePaginatable { protected $keyIndex = array(); /** - * Template mehod that descendant classes may use to validate items added to this WireArray + * Template method that descendant classes may use to validate items added to this WireArray * * #pw-internal * diff --git a/wire/core/Sanitizer.php b/wire/core/Sanitizer.php index dab9b69c..6a22ca78 100644 --- a/wire/core/Sanitizer.php +++ b/wire/core/Sanitizer.php @@ -1749,7 +1749,7 @@ class Sanitizer extends Wire { * @param string $value String you want to convert * @param array $options Options to modify default behavior: * - `newline` (string): Character(s) to replace newlines with (default="\n"). - * - `separator` (string): Character(s) to separate HTML
  • items with (default="\n"). + * - `separator` (string): Character(s) to separate HTML `
  • ` items with (default="\n"). * - `entities` (bool): Entity encode returned value? (default=false). * - `trim` (string): Character(s) to trim from beginning and end of value (default=" -,:;|\n\t"). * @return string Converted string of text diff --git a/wire/core/Wire.php b/wire/core/Wire.php index 302fe243..6de54afe 100644 --- a/wire/core/Wire.php +++ b/wire/core/Wire.php @@ -19,7 +19,7 @@ * #pw-summary-changes Methods to support tracking and retrieval of changes made to the object. * #pw-summary-hooks Methods for managing hooks for an object instance or class. * - * ProcessWire 3.x, Copyright 2021 by Ryan Cramer + * ProcessWire 3.x, Copyright 2022 by Ryan Cramer * https://processwire.com * * #pw-use-constants @@ -1265,13 +1265,19 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable { * #pw-group-notices * * @param string|array|Wire $text Text to include in the notice - * @param int|bool|string $flags Optional flags to alter default behavior: + * @param int|bool|string $flags Optional flags to alter default behavior: + * - `Notice::admin` (constant): Show notice only if user is in the admin. + * - `Notice::allowMarkdown` (constant): Allow basic markdown and bracket markup (see $sanitizer->entitiesMarkdown()). + * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. * - `Notice::debug` (constant): Indicates notice should only be shown when debug mode is active. * - `Notice::log` (constant): Indicates notice should also be logged. * - `Notice::logOnly` (constant): Indicates notice should only be logged. - * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. + * - `Notice::login` (constant): Show notice only if it will be seen by a logged-in user. + * - `Notice::noGroup` (constant): Indicates notice should not group with others of the same type (where supported). + * - `Notice::prepend` (constant): Indicates notice should prepend rather than append. + * - `Notice::superuser` (constant): Show notice only if current user is a superuser. * - `true` (boolean): Shortcut for the `Notice::log` constant. - * - In 3.0.149+ you may also specify a space-separated string of flag names. + * - In 3.0.149+ you may also specify a space-separated string of flag names, i.e. "admin log noGroup". * @return $this * @see Wire::messages(), Wire::warning(), Wire::error() * @@ -1297,12 +1303,18 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable { * * @param string|array|Wire $text Text to include in the notice * @param int|bool|string $flags Optional flags to alter default behavior: + * - `Notice::admin` (constant): Show notice only if user is in the admin. + * - `Notice::allowMarkdown` (constant): Allow basic markdown and bracket markup (see $sanitizer->entitiesMarkdown()). + * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. * - `Notice::debug` (constant): Indicates notice should only be shown when debug mode is active. * - `Notice::log` (constant): Indicates notice should also be logged. * - `Notice::logOnly` (constant): Indicates notice should only be logged. - * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. + * - `Notice::login` (constant): Show notice only if it will be seen by a logged-in user. + * - `Notice::noGroup` (constant): Indicates notice should not group with others of the same type (where supported). + * - `Notice::prepend` (constant): Indicates notice should prepend rather than append. + * - `Notice::superuser` (constant): Show notice only if current user is a superuser. * - `true` (boolean): Shortcut for the `Notice::log` constant. - * - In 3.0.149+ you may also specify a space-separated string of flag names. + * - In 3.0.149+ you may also specify a space-separated string of flag names, i.e. "admin log noGroup". * @return $this * @see Wire::warnings(), Wire::message(), Wire::error() * @@ -1330,12 +1342,18 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable { * * @param string|array|Wire $text Text to include in the notice * @param int|bool|string $flags Optional flags to alter default behavior: + * - `Notice::admin` (constant): Show notice only if user is in the admin. + * - `Notice::allowMarkdown` (constant): Allow basic markdown and bracket markup (see $sanitizer->entitiesMarkdown()). + * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. * - `Notice::debug` (constant): Indicates notice should only be shown when debug mode is active. * - `Notice::log` (constant): Indicates notice should also be logged. * - `Notice::logOnly` (constant): Indicates notice should only be logged. - * - `Notice::allowMarkup` (constant): Indicates notice should allow the use of HTML markup tags. + * - `Notice::login` (constant): Show notice only if it will be seen by a logged-in user. + * - `Notice::noGroup` (constant): Indicates notice should not group with others of the same type (where supported). + * - `Notice::prepend` (constant): Indicates notice should prepend rather than append. + * - `Notice::superuser` (constant): Show notice only if current user is a superuser. * - `true` (boolean): Shortcut for the `Notice::log` constant. - * - In 3.0.149+ you may also specify a space-separated string of flag names. + * - In 3.0.149+ you may also specify a space-separated string of flag names, i.e. "admin log noGroup". * @return $this * @see Wire::errors(), Wire::message(), Wire::warning() * diff --git a/wire/core/WireDatabasePDO.php b/wire/core/WireDatabasePDO.php index b7c1959c..4fdc883a 100644 --- a/wire/core/WireDatabasePDO.php +++ b/wire/core/WireDatabasePDO.php @@ -1461,7 +1461,7 @@ class WireDatabasePDO extends Wire implements WireDatabase { } /** - * Escape a string value, same as $db->quote() but without surrounding quotes + * Escape a string value, same as $database->quote() but without surrounding quotes * * #pw-group-sanitization * diff --git a/wire/core/WireInput.php b/wire/core/WireInput.php index f95943cd..fdfd7af8 100644 --- a/wire/core/WireInput.php +++ b/wire/core/WireInput.php @@ -378,7 +378,7 @@ class WireInput extends Wire { * * The whitelist is a list of variables specifically set by the application as sanitized for use elsewhere in the application. * This whitelist is not specifically used by ProcessWire unless you populate it from your templates or the API. - * When populated, it is used by the MarkupPagerNav module (for instance) to ensure that sanitizedd query string (GET) variables + * When populated, it is used by the MarkupPagerNav module (for instance) to ensure that sanitized query string (GET) variables * are maintained across paginations. * * ~~~~~