PHP Classes

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

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 45 All time: 10,795 This week: 40Up
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: 21 packages by
Country: France France
Age: ???
All time rank: 289780 in France France
Week rank: 4 Up1 in France France Up
Innovation award
Innovation award
Nominee: 15x

Winner: 2x

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 (24)  
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 (24)  /  .github  
File Role Description
Files folder imageworkflows (1 file)

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

  Files folder image Files (24)  /  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 (24)  /  app  /  Bags  
File Role Description
  Plain text file WordsBag.php Class Class source

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

  Files folder image Files (24)  /  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 (24)  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source

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

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

  Files folder image Files (24)  /  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 (24)  /  resources  
File Role Description
Files folder imageviews (1 file)

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

  Files folder image Files (24)  /  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 (24)  /  tests  /  Unit  
File Role Description
Files folder imageBags (1 file)
Files folder imageNodes (2 files)

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

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:45
This week:0
All time:10,795
This week:40Up