thiagobarros2/file-counter

A simple way to test how many files are into a given dir based on extension
8,397
Install
composer require thiagobarros2/file-counter
Latest Version:v1.3.0
PHP:^8.2
License:MIT
Last Updated:Feb 3, 2024
Links: GitHub  ·  Packagist
Maintainer: thiagobarros2

Instalation

# development
$ composer require thiagobarros2/file-counter --dev

# production
$ composer require thiagobarros2/file-counter

# warning: this package can be of course used in production but was thought to be a dev-dependency

Usage

<?php

namespace src;

use ThiagoBarros\FileCounter\Counter;

function yourFunction() {
    $number_of_files = Counter::number_of_files('path_to_dir', 'file_extension'); //the file_extension param can be provided with or without '.'    
    return $number_of_files;
});

<?php

namespace src;

use ThiagoBarros\FileCounter\Lister;

function yourFunction() {
    $files_by_extension = Lister::files_by_extension('path_to_dir');     
    return $files_by_extension;
});

Related Packages

pestphp/pest-plugin-agent

AI agent verification plugin for Pest

60,329 6
nekofar/pest-plugin-mock-client

Pest Plugin for Mock HTTP client

22 1
quadraecom/pest-plugin-selectors

Add CSS selector-based testing capabilities to Pest

2,035 1
pestphp/pest-plugin-type-coverage

The Type Coverage plugin for Pest PHP.

4,810,598 36