Skip to content

Commit

Permalink
version 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
christopheexakat committed Oct 10, 2023
1 parent 9936b00 commit 987855d
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 23 deletions.
3 changes: 3 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ Here is the release note of exakat.
+ New analysis : report usage PHP 8.3 new dynamic
+ New analysis : static variables may be initialized with arbitrary expression in PHP 8.3
+ New analysis : report when an interface's class constant visibility is not public when in the class
+ Updated analysis : upgraded pre-calculate used variable in closure
+ Updated analysis : Insufficient typehint (extended coverage)
+ New analysis : Report final trait method that are overwritten

+ Tokenizer
+ Added support for typed constants
Expand Down
2 changes: 1 addition & 1 deletion Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Introduction
============

This is the documentation of the Exakat engine, version 2.5.3 (Build 1483), on Fri, 06 Oct 2023 08:21:21 +0000.
This is the documentation of the Exakat engine, version 2.6.0 (Build 1483), on Mon, 09 Oct 2023 13:45:49 +0000.

What is Exakat ?
----------------
Expand Down
65 changes: 62 additions & 3 deletions Reference/Rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Rules
Introduction
------------------------

Exakat provides unique 1592 rules to detect BUGS, CODE SMELLS, SECURITY OR QUALITY ISSUES in your PHP code.
Exakat provides unique 1593 rules to detect BUGS, CODE SMELLS, SECURITY OR QUALITY ISSUES in your PHP code.

Each rule is documented with code example to allow you to remediate your code. If you want to automate remediation, ours cobblers can are there to fix the issues in your code for your.

Expand Down Expand Up @@ -26115,6 +26115,62 @@ _____
+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


.. _traits-finaltraitsarefinal:

.. _final-traits-are-final:

Final Traits Are Final
++++++++++++++++++++++

A final method in a trait is also final when in its importing class. This means that the importing class may redefine it, but not the children.


.. code-block:: php

<?php

trait t {
final function FFinal() {}
final function FNotFinalInClass() {}
function FNotFinal() {} // This is a normal method
}

class x {
use t;

function FNotFinalInClass() {}

}

class y extends x {
function FFinal() {} // This is KO, as it is final in the trait
function FNotFinalInClass() {} // This is OK, the class as priority
function FNotFinal() {}
}
?>

Specs
_____

+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Short name | Traits/FinalTraitsAreFinal |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Rulesets | :ref:`All <ruleset-All>`, :ref:`CompatibilityPHP53 <ruleset-CompatibilityPHP53>`, :ref:`CompatibilityPHP54 <ruleset-CompatibilityPHP54>`, :ref:`CompatibilityPHP55 <ruleset-CompatibilityPHP55>`, :ref:`CompatibilityPHP56 <ruleset-CompatibilityPHP56>`, :ref:`CompatibilityPHP70 <ruleset-CompatibilityPHP70>`, :ref:`CompatibilityPHP71 <ruleset-CompatibilityPHP71>`, :ref:`CompatibilityPHP72 <ruleset-CompatibilityPHP72>`, :ref:`CompatibilityPHP73 <ruleset-CompatibilityPHP73>`, :ref:`CompatibilityPHP74 <ruleset-CompatibilityPHP74>`, :ref:`CompatibilityPHP80 <ruleset-CompatibilityPHP80>`, :ref:`CompatibilityPHP81 <ruleset-CompatibilityPHP81>`, :ref:`CompatibilityPHP82 <ruleset-CompatibilityPHP82>` |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Exakat since | 2.5.3 |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| PHP Version | With PHP 8.3 and older |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Severity | Minor |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Time To Fix | Quick (30 mins) |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Precision | High |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Available in | |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


.. _structures-gotokeydirectly:

.. _find-key-directly:
Expand Down Expand Up @@ -57067,6 +57123,8 @@ Pre-Calculate Use

In a `closure <https://www.php.net/`closure <https://www.php.net/closure>`_>`_, it is faster to pass a final value, rather than calculate it at call time.

In the ``use`` clause of the `closure <https://www.php.net/`closure <https://www.php.net/closure>`_>`_, make sure that the passed variables do not require any more processing, such as a call to another function or an extra expression.


.. code-block:: php

Expand Down Expand Up @@ -82499,9 +82557,9 @@ _____
Useless Type Check
++++++++++++++++++

With typehint, some checks on the arguments are now handled by the type system.
With the type system, checking the type of arguments is handled by PHP.

In particular, a type hinted argument can't be null, unless it is explicitly nullable, or has a ``null`` value as default.
In particular, a typed argument can't be null, unless it is explicitly nullable, or has a ``null`` value as default.


.. code-block:: php
Expand Down Expand Up @@ -96956,6 +97014,7 @@ List of analyzers, by version of introduction, newest to oldest. In parenthesis,
* :ref:`Could Be array_combine() <could-be-array\_combine()>`
* :ref:`Could Use Yield From <could-use-yield-from>`
* :ref:`Default Then Discard <default-then-discard>`
* :ref:`Final Traits Are Final <final-traits-are-final>`
* :ref:`Identical Case In Switch <identical-case-in-switch>`
* :ref:`Incompatible Property Between Class And Trait <incompatible-property-between-class-and-trait>`
* :ref:`Inherited Class Constant Visibility <inherited-class-constant-visibility>`
Expand Down

0 comments on commit 987855d

Please sign in to comment.