Top 100 PHP
Exakat - Turn PHP into Analytics
by dams
4M ago
PHP Tops 100 Here are various top 100 of the most popular structures in PHP. All those structures are surveyed in a corpus of more than 3000 open source projects, and storted by frequency on usage. You can use these lists to improve your knowledge of PHP. Top 100 PHP functions Top 100 PHP classes Top 100 PHP native constants Top 5 PHP attributes Top 100 PHP interfaces (TBP) Top 100 PHP traits : N/A Top 100 PHP enumeration : N/A Do you want to see another top 100 featured here? Drop us a note! The post Top 100 PHP appeared first on Exakat ..read more
Visit website
PHP extended classes
Exakat - Turn PHP into Analytics
by dams
1y ago
PHP extended classes Recently, I discovered that Datetime::createFromImmutable is now returning a static type : it returns an object of the type that called the method. This is only useful when the class has been extended by another class. This means that the Datetime class is extended enough for PHP to acknowledge it and adapts its features. Extending PHP native classes is possible, though I rarely used it in my own code : initially, it sounded odd. Then, of course, I remembered the Exception class, and all its derivative. So, it is actually common. The question became : “Which of PHP classes ..read more
Visit website
Fix inherited static variables in PHP 8.1
Exakat - Turn PHP into Analytics
by dams
2y ago
Remove static variables One discreet update of PHP 8.1 is the upgrade of PHP static variables behavior in classes : Static variables in methods inheritance. Let’s review what are static variables in PHP, why they were problematic so far, and strategies to upgrade the code to remove this problem. PHP static variables While static properties and methods are quite known, static variables are more of a secret. They look like this in the code : <?php function counter() { static $count = 0; return ++$count; } echo count(); // 1 echo count(); // 2 ?> Contrary to mundane vari ..read more
Visit website
Installing Exakat to monitor several projects
Exakat - Turn PHP into Analytics
by dams
2y ago
Installing Exakat to monitor several projects Exakat is the smart Static analysis tool for PHP. It reviews the source for PHP compatibility (8.0, 8.1, 8.2 already, Security, and much more. When running it for several projects, it is convenient to use the ‘projects’ style of installation, more than the ‘in-code’ configuration. The ‘projects’ installation is organized around the ‘projects’ folder, where each code source will have its own folder. That way, you may have several source code ready, with their own local caches and distinct audits. It is most convenient when you run the audits locally ..read more
Visit website
Prepare for PHP migration with Exakat
Exakat - Turn PHP into Analytics
by dams
2y ago
Prepare for PHP migration with Exakat Exakat detects compatibility issues in your code, for each minor PHP versions since PHP 5.3. It scans the source for function apparence or disappearance, new syntax and behaviors. init-project-done With a local docker system and access to your code, you can use the following command line to execute Exakat. : docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat init -p sculpin -R git@github.com:sculpin/sculpin.git This creates a folder called ‘projects’ in your local directory, and initialize the project called ‘sculpin ..read more
Visit website
From PHP code to static analysis
Exakat - Turn PHP into Analytics
by dams
4y ago
From PHP code to static analysis Static analysis is the review of the PHP code, without executing it. In a word, it means reading the code, and understanding it, just like developers do when they modify a piece of PHP. It is the same process, with different tools. Here is the path from PHP code to static analysis. Manual code review Manual review is a slow process, where a reviewer reads the code, and uses his experience and know-how to discover poorly coded classes. Such reviews report high level errors, close to architecture and conception levels, and common errors, at the line of code level ..read more
Visit website
PHP Typehint usage in 2019
Exakat - Turn PHP into Analytics
by dams
4y ago
Overall Typehint Usage PHP typehints were introduced in PHP 5. Ever since, they have grown in features and usage. Where are we at the moment ? We scanned the Open Source community repositories. 89% of all PHP code source use types hinting, at least a little.  Typehint Coverage This number is very high, yet it represents very different situations. Here is a breakdown of the actual coverage of parameters and return type. The graph below presents the % of parameters and return type that are explicitly defined in a code source.  This graph goes from 0% to 100%. This reflects a wide ran ..read more
Visit website
Exakat 1.9.9 Review
Exakat - Turn PHP into Analytics
by dams
4y ago
Exakat 1.9.9 Review Exakat focuses on automated updates this week : two new reports (and sections) provide recommendations to use Rector and Php-cs-fixer for fixing, en masse, issues found during an audit. Also, no less than 9 new rules were added to Exakat, and a new inventory for mbstring encoding.  The Exakat 1.9.9 review is the best interpreter of the source code. Fixing code automatically While Exakat focuses on finding the most intricate bugs, other tools are able to fix en masse code. Among such tools, Rector and PHP-cs-fixer are doing a fine job, taking some laborious w ..read more
Visit website
Exakat 1.9.8 Review
Exakat - Turn PHP into Analytics
by dams
4y ago
Exakat 1.9.8 review Exakat 1.9.8 Review This week, Exakat upgrades the presentation of the inventories. It refactored the method definition detection, and added new rule for hiding parameters and wrong case. Several modernisations were applied, in particular to the ‘Insufficient typehint’ rule. Coding is inherently risky, and it helps to readd the Exakat 1.9.7 review. Upgraded Inventories Code inventories represents the code syntaxes of the same kind, gathered in one place. By syntaxes, we mean the same type. That may be if/then, while, foreach, strings, but also incoming variab ..read more
Visit website
Exakat 1.9.7 Review
Exakat - Turn PHP into Analytics
by dams
4y ago
This week, Exakat added a new inventory for too many chained object. The engine upgraded the storage of Typehint and Default values, which lead to several modernisation and coverage extensions, such as ‘typehint are for interface or abstract classes’, and ‘Never used parameters’.  Code is like a series of baby steps, and a good Exakat 1.9.7 review. Too Many Chained Objects Chaining objects is a classic sight in any PHP code. To reach a resource across the code, one need to call several methods :  Main::get('root')->getUsers($id)->getAddress(self::Current)::$zip_code->f ..read more
Visit website

Follow Exakat - Turn PHP into Analytics on FeedSpot

Continue with Google
Continue with Apple
OR