PHP Classes

PHP Wording Detector: Generate reports on the usage of words in classes

Recommend this page to a friend!
  Info   View files Documentation   View files View files (24)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2023-03-10 (11 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 43 All time: 10,746 This week: 358Up
Version License PHP version Categories
php-wording-detector 1.0.0The PHP License5PHP 5, Language, Parsers
Description 

Author

This package can generate reports on the usage of words in classes.

It provides an application that runs from the command line console to analyze the class files inside a given directory.

The package can analyze the words in class files, and then it outputs reports showing the number of times certain words are used and the percentage of the use of the words compared with the total words.

It can also show statistics of the total number of words, distinct words, and the average number of times all words are used.

Innovation Award
PHP Programming Innovation award winner
March 2023
Winner
Domain-driven design (DDD) is an approach to software development that tries to match the programming style with language that uses words that better fit the use of words in a given domain of the problems that applications try to solve.

This package can analyze the words used in the code of PHP classes and generate reports of using words in the code.

This way, developers can see if the words used in their code are the same as those used in application problems and solutions.

Manuel Lemos
Picture of DeGraciaMathieu
  Performance   Level  
Name: DeGraciaMathieu <contact>
Classes: 16 packages by
Country: France France
Age: ???
All time rank: 297381 in France France
Week rank: 8 Up1 in France France Up
Innovation award
Innovation award
Nominee: 11x

Winner: 1x

Documentation

<p align="center"> <img src="https://github.com/DeGraciaMathieu/php-smelly-code-detector/blob/master/arts/robot.png" width="250"> </p>

testing Packagist Version Packagist PHP Version

php-wording-detector

Simple tool to analyze and split the words contained in your variables to check your DDD approach.

Installation

Requires >= PHP 8.1

composer require degraciamathieu/php-wording-detector --dev

Usage

php php-wording-detector inspect {path}
$ php php-wording-detector inspect app
? PHP Wording Detector ?
+-------------+-----------------------+-------------+
| total words | total distincts words | average use |
+-------------+-----------------------+-------------+
| 18'363      | 560                   | 33          |
+-------------+-----------------------+-------------+
+--------------+-------+-------------+
| words        | usage | pourcentage |
+--------------+-------+-------------+
| user         | 1629  | 9%          |
| activity     | 1150  | 6%          |
| exam         | 925   | 5%          |
| organization | 671   | 4%          |
| mode         | 460   | 3%          |
| data         | 416   | 2%          |
| code         | 383   | 2%          |
| builder      | 368   | 2%          |
| part         | 351   | 2%          |
| item         | 350   | 2%          |
| license      | 308   | 2%          |
| request      | 296   | 2%          |
| subscription | 289   | 2%          |
| id           | 228   | 1%          |
| answers      | 225   | 1%          |
| coupon       | 214   | 1%          |
| question     | 200   | 1%          |
| exception    | 182   | under 1%    |
| current      | 161   | under 1%    |
| count        | 160   | under 1%    |
+--------------+-------+-------------+

  Files folder image Files  
File Role Description
Files folder image.github (1 directory)
Files folder imageapp (5 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (3 files)
Files folder imageresources (1 directory)
Files folder imagetests (2 files, 1 directory)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file box.json Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file php-wording-detector Appl. Application script
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file phpunit.yml Data Auxiliary data

  Files folder image Files  /  app  
File Role Description
Files folder imageBags (1 file)
Files folder imageCommands (1 file)
Files folder imageNodes (2 files)
Files folder imageProviders (1 file)
Files folder imageVisitors (1 file)

  Files folder image Files  /  app  /  Bags  
File Role Description
  Plain text file WordsBag.php Class Class source

  Files folder image Files  /  app  /  Commands  
File Role Description
  Plain text file Inspect.php Class Class source

  Files folder image Files  /  app  /  Nodes  
File Role Description
  Plain text file NodeExtractor.php Class Class source
  Plain text file NodeValidator.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source

  Files folder image Files  /  app  /  Visitors  
File Role Description
  Plain text file ClassVisitor.php Class Class source

  Files folder image Files  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files  /  config  
File Role Description
  Plain text file app.php Class Class source
  Plain text file commands.php Class Class source
  Accessible without login Plain text file view.php Aux. Auxiliary script

  Files folder image Files  /  resources  
File Role Description
Files folder imageviews (1 file)

  Files folder image Files  /  resources  /  views  
File Role Description
  Accessible without login Plain text file inspect.blade.php Aux. Auxiliary script

  Files folder image Files  /  tests  
File Role Description
Files folder imageUnit (2 directories)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files  /  tests  /  Unit  
File Role Description
Files folder imageBags (1 file)
Files folder imageNodes (2 files)

  Files folder image Files  /  tests  /  Unit  /  Bags  
File Role Description
  Plain text file WordsBagTest.php Class Class source

  Files folder image Files  /  tests  /  Unit  /  Nodes  
File Role Description
  Plain text file NodeExtractorTest.php Class Class source
  Plain text file NodeValidatorTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:43
This week:0
All time:10,746
This week:358Up