Skip to content

Commit

Permalink
Fixing bugs related to quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
christopheexakat committed Dec 3, 2023
1 parent fc5293b commit dfc9eac
Show file tree
Hide file tree
Showing 11 changed files with 683 additions and 454 deletions.
23 changes: 0 additions & 23 deletions Annex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,71 +53,53 @@ External links

List of external links mentioned in this documentation.

* `$HTTP_RAW_POST_DATA variable <https://www.php.net/manual/en/reserved.variables.httprawpostdata.php>`_
* `[HttpFoundation] Make sessions secure and lazy #24523 <https://github.com/symfony/symfony/pull/24523>`_
* `Ambassador <https://exakat.readthedocs.io/en/latest/Reports.html#ambassador>`_
* `Aronduby Dump <https://github.com/aronduby/dump>`_
* `Atif Shahab Qureshi <https://twitter.com/Atif__Shahab>`_
* `Backward incompatible changes PHP 7.0 <https://www.php.net/manual/en/migration70.incompatible.php>`_
* `Benoit Burnichon <https://twitter.com/BenoitBurnichon>`_
* `Bitwise Operators <https://www.php.net/manual/en/language.operators.bitwise.php>`_
* `Brandon Savage <https://twitter.com/BrandonSavage>`_
* `Carbon <https://carbon.nesbot.com/docs/>`_
* `Carnage <https://twitter.com/giveupalready>`_
* `cat: write error: Broken pipe <https://askubuntu.com/questions/421663/cat-write-error-broken-pipe>`_
* `Classes Abstraction <https://www.php.net/abstract>`_
* `Data structures <http://docs.php.net/manual/en/book.ds.php>`_
* `DCDFLIB <https://people.sc.fsu.edu/~jburkardt/c_src/cdflib/cdflib.html>`_
* `Deprecate and remove INTL_IDNA_VARIANT_2003 <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>`_
* `directive error_reporting <https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting>`_
* `Docker <http://www.docker.com/>`_
* `Docker image <https://hub.docker.com/r/exakat/exakat/>`_
* `download <https://www.exakat.io/download-exakat/>`_
* `Empty Catch Clause <http://wiki.c2.com/?EmptyCatchClause>`_
* `Enchant spelling library <https://www.php.net/manual/en/book.enchant.php>`_
* `Exakat <http://www.exakat.io/>`_
* `Exakat Cloud <https://www.exakat.io/exakat-cloud/>`_
* `Exakat SAS <https://www.exakat.io/get-php-expertise/>`_
* `exakat/exakat <https://hub.docker.com/r/exakat/exakat/>`_
* `ext/hash extension <http://www.php.net/manual/en/book.hash.php>`_
* `FAM <http://oss.sgi.com/projects/fam/>`_
* `foreach <https://www.php.net/manual/en/control-structures.foreach.php>`_
* `Frederic Bouchery <https://twitter.com/FredBouchery/>`_
* `George Peter Banyard <https://twitter.com/Girgias>`_
* `Github.com/exakat/exakat <https://github.com/exakat/exakat>`_
* `global namespace <https://www.php.net/manual/en/language.namespaces.global.php>`_
* `graphviz <http://www.graphviz.org/>`_
* `Gremlin server <http://tinkerpop.apache.org/>`_
* `hash_algos <https://www.php.net/hash_algos>`_
* `Holger Woltersdorf <https://twitter.com/hollodotme>`_
* `How to fix Headers already sent error in PHP <http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php>`_
* `https://www.exakat.io/versions <https://www.exakat.io/versions>`_
* `https://www.exakat.io/versions/index.php?file=latest <https://www.exakat.io/versions/index.php?file=latest>`_
* `ICU <http://site.icu-project.org/>`_
* `IERS <https://www.iers.org/IERS/EN/Home/home_node.html>`_
* `Installing Exakat to monitor several projects []=> <https://www.exakat.io/installing-exakat-to-monitor-several-projects/>`_
* `Internal Constructor Behavior <https://wiki.php.net/rfc/internal_constructor_behaviour>`_
* `Is it a bad practice to have multiple classes in the same file? <https://stackoverflow.com/questions/360643/is-it-a-bad-practice-to-have-multiple-classes-in-the-same-file>`_
* `Isset Ternary <https://wiki.php.net/rfc/isset_ternary>`_
* `Jordi Boggiano <https://twitter.com/seldaek>`_
* `Judy C library <http://judy.sourceforge.net/>`_
* `libeio <http://software.schmorp.de/pkg/libeio.html>`_
* `libmongoc <https://github.com/mongodb/mongo-c-driver>`_
* `list <https://www.php.net/manual/en/function.list.php>`_
* `list() Reference Assignment <https://wiki.php.net/rfc/list_reference_assignment>`_
* `Logical Operators <https://www.php.net/manual/en/language.operators.logical.php>`_
* `Marco Pivetta tweet <https://twitter.com/Ocramius/status/811504929357660160>`_
* `mcrypt_create_iv() <https://www.php.net/manual/en/function.mcrypt-create-iv.php>`_
* `Migration80 <https://exakat.readthedocs.io/en/latest/Reports.html#migration80>`_
* `MongoDB driver <https://www.php.net/mongo>`_
* `mysqli <https://www.php.net/manual/en/book.mysqli.php>`_
* `Optimize array_unique() <https://github.com/php/php-src/commit/6c2c7a023da4223e41fea0225c51a417fc8eb10d>`_
* `Option to make json_encode and json_decode throw exceptions on errors <https://ayesh.me/Upgrade-PHP-7.3#json-exceptions>`_
* `original idea <https://twitter.com/b_viguier/status/940173951908700161>`_
* `parent <https://www.php.net/manual/en/keyword.parent.php>`_
* `PCRE <https://www.php.net/pcre>`_
* `pg_last_error <https://www.php.net/manual/en/function.pg-last-error.php>`_
* `PHP 7.3 Removed Functions <https://www.php.net/manual/en/migration73.incompatible.php#migration70.incompatible.removed-functions>`_
* `PHP <https://www.php.net/>`_
* `PHP Tags <https://www.php.net/manual/en/language.basic-syntax.phptags.php>`_
* `plantuml <http://plantuml.com/>`_
Expand All @@ -131,14 +113,9 @@ List of external links mentioned in this documentation.
* `RFC 7230 <https://tools.ietf.org/html/rfc7230>`_
* `RFC 822 (MIME) <http://www.faqs.org/rfcs/rfc822.html>`_
* `RFC 959 <http://www.faqs.org/rfcs/rfc959>`_
* `Scope Resolution Operator (::) <https://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php>`_
* `Specification pattern <https://en.wikipedia.org/wiki/Specification_pattern>`_
* `Static Keyword <https://www.php.net/manual/en/language.oop5.static.php>`_
* `Text <https://exakat.readthedocs.io/en/latest/Reports.html#text>`_
* `Tutorial 1: Let’s learn by example <https://docs.phalconphp.com/en/latest/reference/tutorial.html>`_
* `Type Casting <https://php.net/manual/en/language.types.type-juggling.php#language.types.typecasting>`_
* `Type declarations <https://www.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration>`_
* `unset <https://www.php.net/unset>`_
* `V8 Javascript Engine <https://bugs.chromium.org/p/v8/issues/list>`_
* `Vagrant file <https://github.com/exakat/exakat-vagrant>`_
* `Vladimir Reznichenko <https://twitter.com/kalessil>`_
Expand Down
8 changes: 7 additions & 1 deletion Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ Here is the release note of exakat.

+ Analysis
+ New analysis : report non-static method called from static method
+ New analysis : report properties that are untyped, uninitialized, and no set in the constructor.
+ New analysis : report traits used in a type
+ New analysis : report short assignations on appends (should not be possible)
+ Updated analysis : report usage of static properties with ??= and other short assignations
+ New analysis : added support for the friend attribute

+ Tokenizer
+
+ Fixed bug with short assignment left operand not being marked as read as well as written
+ Added fullnspath to Staticclass atom

**Version 2.6.2 (, 2023-11-21)**

Expand Down
52 changes: 26 additions & 26 deletions Reference/Cases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,9 @@ $line is build in several steps, then then final version is added to $content. I
foreach($records as $record)
{
$line = implode("\\ . getDelimiter() . "\\, $record);
$line = "\\ . $line;
$line .= "\\r\n\;
$line = implode("\"" . getDelimiter() . "\"", $record);
$line = "\"" . $line;
$line .= "\"\r\n";
$line = parseRelateFields($line, $record, $customRelateFields);
$content .= $line;
}
Expand Down Expand Up @@ -1089,7 +1089,7 @@ The array_walk() function is called on the plugin's list. Each element is regist
$plugins,
function ($plugin) use ($app) {
/** @var Plugin $plugin */
$provider = (strpos($plugin->getClassName(), '\') === false)
$provider = (strpos($plugin->getClassName(), '\\') === false)
? sprintf('phpDocumentor\Plugin\%s\ServiceProvider', $plugin->getClassName())
: $plugin->getClassName();
if (!class_exists($provider)) {
Expand Down Expand Up @@ -2416,7 +2416,7 @@ The ConstructHiddenValues function builds the ConstructHiddenSubValues function.
}
} else // Exit recurse
{
$Result = "<input type="hidden" name=\\ . htmlspecialchars($Name) . "\" value=\"" . htmlspecialchars($Value) . "\/>\n\;
$Result = "<input type="hidden" name=\"" . htmlspecialchars($Name) . "\" value=\"" . htmlspecialchars($Value) . "\" />\n";
}
return $Result;
Expand Down Expand Up @@ -3180,15 +3180,15 @@ This actually decodes into a copyright notice.

'function cleanAndSanitizeScriptHeader(& $output)
{
$requiredOne = <span>Copyright &#169; Zurmo Inc., 2013. All rights reserved.;....'
$requiredOne = "<span>Copyright &#169; Zurmo Inc., 2013. All rights reserved.";....'


.. code-block:: php
eval(\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x63\x6c\x65\x61\x6e\x41\x6e\x64\x53\x61\x6e\x69\x74\x69\x7a\x65\x53\x63\x72 .
\x69\x70\x74\x48\x65\x61\x64\x65\x72\x28\x26\x20\x24\x6f\x75\x74\x70\x75\x74\x29\x0d\x0a\x20\x20\x20\x20\x20\x20 .
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7b\x0d\x0a\x20\x20\x20\x20\x20\x20\x20 .
\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x24\x72\x65\x71\x75\x69\x72 .
eval("\x66\x75\x6e\x63\x74\x69\x6f\x6e\x20\x63\x6c\x65\x61\x6e\x41\x6e\x64\x53\x61\x6e\x69\x74\x69\x7a\x65\x53\x63\x72" .
"\x69\x70\x74\x48\x65\x61\x64\x65\x72\x28\x26\x20\x24\x6f\x75\x74\x70\x75\x74\x29\x0d\x0a\x20\x20\x20\x20\x20\x20" .
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7b\x0d\x0a\x20\x20\x20\x20\x20\x20\x20" .
"\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x24\x72\x65\x71\x75\x69\x72" .
// several more lines like that
Expand Down Expand Up @@ -3592,12 +3592,12 @@ Use expression is only reached when the csrf token is checked. This probably sav
*/
require_once(../../globals.php);
require_once($srcdir/patient.inc);
require_once($srcdir/options.inc.php);
require_once("../../globals.php");
require_once("$srcdir/patient.inc");
require_once("$srcdir/options.inc.php");
if (!empty($_POST)) {
if (!verifyCsrfToken($_POST[csrf_token_form])) {
if (!verifyCsrfToken($_POST["csrf_token_form"])) {
csrfNotVerified();
}
}
Expand Down Expand Up @@ -4400,9 +4400,9 @@ The three calls to str_replace() could be replaced by one, using array arguments
static function jsValue($string) {
return
preg_replace('/\r?\n/', "\n",
str_replace('"', "\\\,
str_replace('"', "\"",
str_replace("'", "\'",
str_replace("\", "\\",
str_replace("\\", "\\",
$string))));
}
Expand All @@ -4421,7 +4421,7 @@ Since str_replace is already using an array, the second argument must also be an
$text = strip_tags($text);
$text = str_replace(array(\n, \r, \t), '', $text);
$text = str_replace(array("\n", "\r", "\t"), '', $text);
$text = str_replace('&nbsp;', ' ', $text);
$text = trim($text);
Expand Down Expand Up @@ -4659,8 +4659,8 @@ This code is creating some directories for Javascript or CSS (from the directori
if ($env == 'prod') {
$checkPaths = [
$assetsFullPath,
$assetsFullPath/css,
$assetsFullPath/js,
"$assetsFullPath/css",
"$assetsFullPath/js",
];
array_walk($checkPaths, function ($path) {
if (!file_exists($path)) {
Expand Down Expand Up @@ -9210,7 +9210,7 @@ HuMo-Gen
$reltext=$neph." ".$spantext.__(' of ');
}
else { $reltext=$neph." ".$degree; }
} elseif ($selected_language==he){
} elseif ($selected_language=="he"){
if($sexe=='m') { $nephniece = __('nephew'); }
///............
Expand Down Expand Up @@ -9893,13 +9893,13 @@ This class has a long list of private properties. It also has an equally long (m
class User
{
/**
* @Column(name=""id"", type=""integer"")
* @GeneratedValue(strategy=""AUTO"")
* @Column(name=id, type=integer)
* @GeneratedValue(strategy=AUTO)
*/
private $id;
/**
* @OneToMany(targetEntity=""ONote"", mappedBy=""user"")
* @OneToMany(targetEntity=ONote, mappedBy=user)
*/
private $oNotes;
Expand Down Expand Up @@ -10448,7 +10448,7 @@ WordPress

:ref:`use-session\_start()-options`, in wp-admin/includes/misc.php:74.

This code actually loads the file, join it, then split it again. file() would be sufficient.
This code actually loads the file, join it, then split it again. file() would be sufficient.

.. code-block:: php
Expand Down Expand Up @@ -10839,7 +10839,7 @@ $product is defined with a reference in the method signature, but it is also use
$props_to_update = $force ? $meta_key_to_props : $this->get_props_to_update( $product, $meta_key_to_props );
foreach ( $props_to_update as $meta_key => $prop ) {
$value = $product->{get_$prop}( 'edit' );
$value = $product->{"get_$prop"}( 'edit' );
$updated = update_post_meta( $product->get_id(), $meta_key, $value );
if ( $updated ) {
$this->updated_props[] = $prop;
Expand Down Expand Up @@ -11714,7 +11714,7 @@ Using PREG_SET_ORDER will remove the usage of the ``$key``variable.
function parse_string_to_array($str)
{
preg_match_all('#(\w+)=([\'"])(.*)\2#U', $str, $matches);
preg_match_all('#(\w+)=([\'"])(.*)\\2#U', $str, $matches);
$params = array();
foreach($matches[1] as $key => $val)
{
Expand Down
4 changes: 2 additions & 2 deletions Reference/Cobblers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ ______
<?php
$a = ;
$a = "";
?>
Expand All @@ -963,7 +963,7 @@ _____
<?php
$a = {$b};
$a = "{$b}";
?>
Expand Down
22 changes: 12 additions & 10 deletions Reference/Reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The Beauty Canon report displays one result per line. This report lists all issu

The title of the analysis is listed on the left, and the analysis short name is listed on the right, for further documentation.

This analysis uses Analysis as default rule. It may otherwise configured with the -T option.
This analysis uses "Analysis" as default rule. It may otherwise configured with the -T option.



Expand Down Expand Up @@ -1030,12 +1030,12 @@ Simple Json format. It is a flat array of objects, all with the same structure.
"project": "sculpin",
"branch": "master",
"lastCommitId": "b7c9027f05d9bff4dc6e92f36d29c4738bfc0b42",
"ruleId": "Classes\/ChildRemoveTypehint",
"ruleId": "Classes\\/ChildRemoveTypehint",
"type": "warning",
"severity": "major",
"fixable": "fixable",
"file": "\/src\/Sculpin\/Core\/Source\/SourceInterface.php",
"namespace": "\sculpin\core\source",
"file": "\\/src\\/Sculpin\\/Core\\/Source\\/SourceInterface.php",
"namespace": "\\sculpin\\core\\source",
"class": "",
"function": "",
"message": "Child Class Removes Typehint",
Expand All @@ -1053,7 +1053,7 @@ This Report may be configured with the [Exakatjson] section, to provide the uuid
::

[Exakatjson]
uuid=1234567abcd;
uuid="1234567abcd";



Expand Down Expand Up @@ -1994,10 +1994,10 @@ Exakat measures a large number of code dimensions, such as number of files, line
::

{
loc: 95950,
locTotal: 140260,
files: 1824,
tokens: 677213
"loc": 95950,
"locTotal": 140260,
"files": 1824,
"tokens": 677213
}


Expand All @@ -2008,7 +2008,9 @@ _____
+--------------+------------------------------------------------------------------+
| Short name | Meters |
+--------------+------------------------------------------------------------------+
| Rulesets | None. |
| Rulesets | This reports works with an arbitrary list of results. |
| | |
| | |
+--------------+------------------------------------------------------------------+
| Type | JSON |
+--------------+------------------------------------------------------------------+
Expand Down

0 comments on commit dfc9eac

Please sign in to comment.